diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0- Adapter.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0- Adapter.json new file mode 100644 index 000000000..8a9e232ac --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0- Adapter.json @@ -0,0 +1,600 @@ +{ + "data": { + "id": "ember-data-5.3.0- Adapter", + "type": "class", + "attributes": { + "name": " Adapter", + "shortname": " Adapter", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/experimental-preview-types", + "namespace": "", + "file": "../../ember-data-types/q/minimum-adapter-interface.ts", + "line": 19, + "description": "
\n

\n ⚠️ This is LEGACY documentation for a feature that is no longer encouraged to be used.\n If starting a new app or thinking of implementing a new adapter, consider writing a\n Handler instead to be used with the RequestManager\n

\n
\n\n

The following documentation describes the methods an\n adapter should implement with descriptions around when an\n application might expect these methods to be called.

\n

Methods that are not required are marked as optional.

\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "../ember-data-types/q/minimum-adapter-interface.ts", + "line": 38, + "description": "

adapter.findRecord takes a request for a resource of a given type and id combination\nand should return a Promise which fulfills with data for a single resource matching that\ntype and id.

\n

The response will be fed to the associated serializer's normalizeResponse method with the\nrequestType set to findRecord, which should return a JSON:API document.

\n

The final result after normalization to JSON:API will be added to store via store.push where\nit will merge with any existing data for the record.

\n

⚠️ If the adapter's response resolves to a false-y value, the associated serializer.normalizeResponse\ncall will NOT be made. In this scenario you may need to do at least a minimum amount of response\nprocessing within the adapter.

\n

adapter.findRecord is called whenever the store needs to load, reload, or backgroundReload\nthe resource data for a given type and id.

\n", + "itemtype": "method", + "name": "findRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "The store service that initiated the request being normalized", + "type": "Store" + }, + { + "name": "schema", + "description": "An object with methods for accessing information about\n the type, attributes and relationships of the primary type associated with the request.", + "type": "ModelSchema" + }, + { + "name": "id", + "description": "", + "type": "String" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "a promise resolving with resource data to feed to the associated serializer", + "type": "Promise" + }, + "class": " Adapter", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/q/minimum-adapter-interface.ts", + "line": 67, + "description": "

adapter.findAll takes a request for resources of a given type and should return\n a Promise which fulfills with a collection of resource data matching that type.

\n

The response will be fed to the associated serializer's normalizeResponse method\n with the requestType set to findAll, which should return a JSON:API document.

\n

The final result after normalization to JSON:API will be added to store via store.push where\nit will merge with any existing records for type. Existing records for the type will not be removed.

\n

⚠️ If the adapter's response resolves to a false-y value, the associated serializer.normalizeResponse\ncall will NOT be made. In this scenario you may need to do at least a minimum amount of response\nprocessing within the adapter.

\n

adapter.findAll is called whenever store.findAll is asked to reload or backgroundReload.\nThe records in the response are merged with the contents of the store. Existing records for\nthe type will not be removed.

\n

See also shouldReloadAll and shouldBackgroundReloadAll

\n", + "itemtype": "method", + "name": "findAll", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "The store service that initiated the request being normalized", + "type": "Store" + }, + { + "name": "schema", + "description": "An object with methods for accessing information about\n the type, attributes and relationships of the primary type associated with the request.", + "type": "ModelSchema" + }, + { + "name": "sinceToken", + "description": "This parameter is no longer used and will always be null.", + "type": "Null" + }, + { + "name": "snapshotRecordArray", + "description": "an object containing any passed in options,\n adapterOptions, and the ability to access a snapshot for each existing record of the type.", + "type": "SnapshotRecordArray" + } + ], + "return": { + "description": "a promise resolving with resource data to feed to the associated serializer", + "type": "Promise" + }, + "class": " Adapter", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/q/minimum-adapter-interface.ts", + "line": 104, + "description": "

adapter.query takes a request for resources of a given type and should return\n a Promise which fulfills with a collection of resource data matching that type.

\n

The response will be fed to the associated serializer's normalizeResponse method\n with the requestType set to query, which should return a JSON:API document.

\n

As with findAll, the final result after normalization to JSON:API will be added to\nstore via store.push where it will merge with any existing records for type.

\n

⚠️ If the adapter's response resolves to a false-y value, the associated serializer.normalizeResponse\ncall will NOT be made. In this scenario you may need to do at least a minimum amount of response\nprocessing within the adapter.

\n

adapter.query is called whenever store.query is called or a previous query result is\nasked to reload.

\n

Existing records for the type will not be removed. The key difference is in the result\nreturned by the store. For findAll the result is all known records of the type,\nwhile for query it will only be the records returned from adapter.query.

\n", + "itemtype": "method", + "name": "query", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "The store service that initiated the request being normalized", + "type": "Store" + }, + { + "name": "schema", + "description": "An object with methods for accessing information about\n the type, attributes and relationships of the primary type associated with the request.", + "type": "ModelSchema" + }, + { + "name": "query", + "description": "", + "type": "Object" + }, + { + "name": "recordArray", + "description": "", + "type": "Collection" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "a promise resolving with resource data to feed to the associated serializer", + "type": "Promise" + }, + "class": " Adapter", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/q/minimum-adapter-interface.ts", + "line": 143, + "description": "

adapter.queryRecord takes a request for resource of a given type and should return\n a Promise which fulfills with data for a single resource matching that type.

\n

The response will be fed to the associated serializer's normalizeResponse method\n with the requestType set to queryRecord, which should return a JSON:API document.

\n

The final result after normalization to JSON:API will be added to store via store.push where\nit will merge with any existing data for the returned record.

\n

⚠️ If the adapter's response resolves to a false-y value, the associated serializer.normalizeResponse\ncall will NOT be made. In this scenario you may need to do at least a minimum amount of response\nprocessing within the adapter.

\n", + "itemtype": "method", + "name": "queryRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "The store service that initiated the request being normalized", + "type": "Store" + }, + { + "name": "schema", + "description": "An object with methods for accessing information about\n the type, attributes and relationships of the primary type associated with the request.", + "type": "ModelSchema" + }, + { + "name": "query", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "return": { + "description": "a promise resolving with resource data to feed to the associated serializer", + "type": "Promise" + }, + "class": " Adapter", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/q/minimum-adapter-interface.ts", + "line": 173, + "description": "

adapter.createRecord takes a request to create a resource of a given type and should\nreturn a Promise which fulfills with data for the newly created resource.

\n

The response will be fed to the associated serializer's normalizeResponse method\n with the requestType set to createRecord, which should return a JSON:API document.

\n

The final result after normalization to JSON:API will be added to store via store.push where\nit will merge with any existing data for the record.

\n

⚠️ If the adapter's response resolves to a false-y value, the associated serializer.normalizeResponse\ncall will NOT be made. In this scenario you may need to do at least a minimum amount of response\nprocessing within the adapter.

\n

If the adapter rejects or throws an error the record will enter an error state and the attributes\nthat had attempted to be saved will still be considered dirty.

\n

InvalidErrors

\n

When rejecting a createRecord request due to validation issues during save (typically a 422 status code),\nyou may throw an InvalidError.

\n

Throwing an InvalidError makes per-attribute errors available for records to use in the UI as needed.\nRecords can also use this information to mark themselves as being in an invalid state.\nFor more reading see the RecordData Errors RFC

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
let error = new Error(errorMessage);\n\n// these two properties combined\n// alert EmberData to this error being for\n// invalid properties on the record during\n// the request\nerror.isAdapterError = true;\nerror.code = 'InvalidError';\n\n// A JSON:API formatted array of errors\n// See https://jsonapi.org/format/#errors\nerror.errors = [];\n\nthrow error;
\n
\n
\n \n", + "itemtype": "method", + "name": "createRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "The store service that initiated the request being normalized", + "type": "Store" + }, + { + "name": "schema", + "description": "An object with methods for accessing information about\n the type, attributes and relationships of the primary type associated with the request.", + "type": "ModelSchema" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "a promise resolving with resource data to feed to the associated serializer", + "type": "Promise" + }, + "class": " Adapter", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/q/minimum-adapter-interface.ts", + "line": 226, + "description": "

adapter.updateRecord takes a request to update a resource of a given type and should\nreturn a Promise which fulfills with the updated data for the resource.

\n

The response will be fed to the associated serializer's normalizeResponse method\n with the requestType set to updateRecord, which should return a JSON:API document.

\n

The final result after normalization to JSON:API will be added to store via store.push where\nit will merge with any existing data for the record.

\n

⚠️ If the adapter's response resolves to a false-y value, the associated serializer.normalizeResponse\ncall will NOT be made. In this scenario you may need to do at least a minimum amount of response\nprocessing within the adapter.

\n

If the adapter rejects or throws an error the record will enter an error state and the attributes\nthat had attempted to be saved will still be considered dirty.

\n

InvalidErrors

\n

When rejecting a createRecord request due to validation issues during save (typically a 422 status code),\nyou may throw an InvalidError.

\n

Throwing an InvalidError makes per-attribute errors available for records to use in the UI as needed.\nRecords can also use this information to mark themselves as being in an invalid state.\nFor more reading see the RecordData Errors RFC

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
let error = new Error(errorMessage);\n\n// these two properties combined\n// alert EmberData to this error being for\n// invalid properties on the record during\n// the request\nerror.isAdapterError = true;\nerror.code = 'InvalidError';\n\n// A JSON:API formatted array of errors\n// See https://jsonapi.org/format/#errors\nerror.errors = [];\n\nthrow error;
\n
\n
\n \n", + "itemtype": "method", + "name": "updateRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "The store service that initiated the request being normalized", + "type": "Store" + }, + { + "name": "schema", + "description": "An object with methods for accessing information about\n the type, attributes and relationships of the primary type associated with the request.", + "type": "ModelSchema" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "class": " Adapter", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/q/minimum-adapter-interface.ts", + "line": 278, + "description": "

adapter.deleteRecord takes a request to delete a resource of a given type and\nshould return a Promise which resolves when that deletion is complete.

\n

Usually the response will be empty, but you may include additional updates in the\nresponse. The response will be fed to the associated serializer's normalizeResponse method\nwith the requestType set to deleteRecord, which should return a JSON:API document.

\n

The final result after normalization to JSON:API will be added to store via store.push where\nit will merge with any existing data.

\n

⚠️ If the adapter's response resolves to a false-y value, the associated serializer.normalizeResponse\ncall will NOT be made. In this scenario you may need to do at least a minimum amount of response\nprocessing within the adapter.

\n

If the adapter rejects or errors the record will need to be saved again once the reason\nfor the error is addressed in order to persist the deleted state.

\n", + "itemtype": "method", + "name": "deleteRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "The store service that initiated the request being normalized", + "type": "Store" + }, + { + "name": "schema", + "description": "An object with methods for accessing information about\n the type, attributes and relationships of the primary type associated with the request.", + "type": "ModelSchema" + }, + { + "name": "snapshot", + "description": "A Snapshot containing the record's current data", + "type": "Snapshot" + } + ], + "return": { + "description": "" + }, + "class": " Adapter", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/q/minimum-adapter-interface.ts", + "line": 306, + "description": "

adapter.findBelongsTo takes a request to fetch a related resource located at a\nrelatedLink and should return a Promise which fulfills with data for a single\n resource.

\n

⚠️ This method is only called if the store previously received relationship information for a resource\ncontaining a related link.

\n

If the cache does not have a link for the relationship then findRecord will be used if a type and id\nfor the related resource is known.

\n

The response will be fed to the associated serializer's normalizeResponse method\n with the requestType set to findBelongsTo, which should return a JSON:API document.

\n

The final result after normalization to JSON:API will be added to store via store.push where\nit will merge with any existing data.

\n

⚠️ If the adapter's response resolves to a false-y value, the associated serializer.normalizeResponse\ncall will NOT be made. In this scenario you may need to do at least a minimum amount of response\nprocessing within the adapter.

\n", + "itemtype": "method", + "name": "findBelongsTo [OPTIONAL]", + "access": "public", + "tagname": "", + "optional": 1, + "params": [ + { + "name": "store", + "description": "The store service that initiated the request being normalized", + "type": "Store" + }, + { + "name": "snapshot", + "description": "A Snapshot containing the parent record's current data", + "type": "Snapshot" + }, + { + "name": "relatedLink", + "description": "The link at which the associated resource might be found", + "type": "String" + }, + { + "name": "relationship", + "description": "", + "type": "RelationshipSchema" + } + ], + "return": { + "description": "a promise resolving with resource data to feed to the associated serializer", + "type": "Promise" + }, + "class": " Adapter", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/q/minimum-adapter-interface.ts", + "line": 343, + "description": "

adapter.findHasMany takes a request to fetch a related resource collection located\n at a relatedLink and should return a Promise which fulfills with data for that\n collection.

\n

⚠️ This method is only called if the store previously received relationship information for a resource\ncontaining a related link.

\n

If the cache does not have a link for the relationship but the type and id of\nrelated resources are known then findRecord will be used for each individual related\nresource.

\n

The response will be fed to the associated serializer's normalizeResponse method\n with the requestType set to findHasMany, which should return a JSON:API document.

\n

The final result after normalization to JSON:API will be added to store via store.push where\nit will merge with any existing data.

\n

⚠️ If the adapter's response resolves to a false-y value, the associated serializer.normalizeResponse\ncall will NOT be made. In this scenario you may need to do at least a minimum amount of response\nprocessing within the adapter.

\n", + "itemtype": "method", + "name": "findhasMany [OPTIONAL]", + "access": "public", + "tagname": "", + "optional": 1, + "params": [ + { + "name": "store", + "description": "The store service that initiated the request being normalized", + "type": "Store" + }, + { + "name": "snapshot", + "description": "A Snapshot containing the parent record's current data", + "type": "Snapshot" + }, + { + "name": "relatedLink", + "description": "The link at which the associated resource collection might be found", + "type": "String" + }, + { + "name": "relationship", + "description": "", + "type": "RelationshipSchema" + } + ], + "return": { + "description": "a promise resolving with resource data to feed to the associated serializer", + "type": "Promise" + }, + "class": " Adapter", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/q/minimum-adapter-interface.ts", + "line": 381, + "description": "

⚠️ This Method is only called if coalesceFindRequests is true. The array passed to it is determined\nby the adapter's groupRecordsForFindMany method, and will be called once per group returned.

\n

adapter.findMany takes a request to fetch a collection of resources and should return a\nPromise which fulfills with data for that collection.

\n

The response will be fed to the associated serializer's normalizeResponse method\n with the requestType set to findMany, which should return a JSON:API document.

\n

The final result after normalization to JSON:API will be added to store via store.push where\nit will merge with any existing data.

\n

⚠️ If the adapter's response resolves to a false-y value, the associated serializer.normalizeResponse\ncall will NOT be made. In this scenario you may need to do at least a minimum amount of response\nprocessing within the adapter.

\n

See also groupRecordsForFindMany and coalesceFindRequests

\n", + "itemtype": "method", + "name": "findMany [OPTIONAL]", + "access": "public", + "tagname": "", + "optional": 1, + "params": [ + { + "name": "store", + "description": "The store service that initiated the request being normalized", + "type": "Store" + }, + { + "name": "schema", + "description": "An object with methods for accessing information about\n the type, attributes and relationships of the primary type associated with the request.", + "type": "ModelSchema" + }, + { + "name": "ids", + "description": "An array of the ids of the resources to fetch", + "type": "Array" + }, + { + "name": "snapshots", + "description": "An array of snapshots of the available data for the resources to fetch", + "type": "Array" + } + ], + "return": { + "description": "a promise resolving with resource data to feed to the associated serializer", + "type": "Promise" + }, + "class": " Adapter", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/q/minimum-adapter-interface.ts", + "line": 412, + "description": "

This method provides the ability to generate an ID to assign to a new record whenever store.createRecord\nis called if no id was provided.

\n

Alternatively you can pass an id into the call to store.createRecord directly.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let id = generateNewId(type);\nlet newRecord = store.createRecord(type, { id });
\n
\n
\n \n", + "itemtype": "method", + "name": "generateIdForRecord [OPTIONAL]", + "access": "public", + "tagname": "", + "optional": 1, + "params": [ + { + "name": "store", + "description": "The store service that initiated the request being normalized", + "type": "Store" + }, + { + "name": "type", + "description": "The type (or modelName) of record being created", + "type": "String" + }, + { + "name": "properties", + "description": "the properties passed as the second arg to `store.createRecord`" + } + ], + "return": { + "description": "a string ID that should be unique (no other models of `type` in the cache should have this `id`)", + "type": "String" + }, + "class": " Adapter", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/q/minimum-adapter-interface.ts", + "line": 452, + "description": "

⚠️ This Method is only called if coalesceFindRequests is true.

\n

This method allows for you to split pending requests for records into multiple findMany\nrequests. It receives an array of snapshots where each snapshot represents a unique record\nrequested via store.findRecord during the most recent runloop that was not found in the\ncache or needs to be reloaded. It should return an array of groups.

\n

A group is an array of snapshots meant to be fetched together by a single findMany request.

\n

By default if this method is not implemented EmberData will call findMany once with all\nrequested records as a single group when coalesceFindRequests is true.

\n

See also findMany and coalesceFindRequests

\n", + "itemtype": "method", + "name": "groupRecordsForFindMany [OPTIONAL]", + "access": "public", + "tagname": "", + "optional": 1, + "params": [ + { + "name": "store", + "description": "The store service that initiated the request being normalized", + "type": "Store" + }, + { + "name": "snapshots", + "description": "An array of snapshots", + "type": "Array" + } + ], + "return": { + "description": "An array of Snapshot arrays", + "type": "Array>" + }, + "class": " Adapter", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/q/minimum-adapter-interface.ts", + "line": 476, + "description": "

When a record is already available in the store and is requested again via store.findRecord,\nand reload is not specified as an option in the request, this method is called to determine\nwhether the record should be reloaded prior to returning the result.

\n

If reload is specified as an option in the request (true or false) this method will not\nbe called.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
store.findRecord('user', '1', { reload: false })
\n
\n
\n \n

The default behavior if this method is not implemented and the option is not specified is to\nnot reload, the same as a return of false.

\n

See also the documentation for shouldBackgroundReloadRecord which defaults to true.

\n", + "itemtype": "method", + "name": "shouldReloadRecord [OPTIONAL]", + "access": "public", + "tagname": "", + "optional": 1, + "params": [ + { + "name": "store", + "description": "The store service that initiated the request being normalized", + "type": "Store" + }, + { + "name": "snapshot", + "description": "A Snapshot containing the record's current data", + "type": "Snapshot" + } + ], + "return": { + "description": "true if the record should be reloaded immediately, false otherwise", + "type": "Boolean" + }, + "class": " Adapter", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/q/minimum-adapter-interface.ts", + "line": 502, + "description": "

When store.findAll(<type>) is called without a reload option, the adapter\nis presented the opportunity to trigger a new request for records of that type.

\n

If reload is specified as an option in the request (true or false) this method will not\nbe called.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
store.findAll('user', { reload: false })
\n
\n
\n \n

The default behavior if this method is not implemented and the option is not specified is to\nnot reload, the same as a return of false.

\n

Note: the Promise returned by store.findAll resolves to the same RecordArray instance\nreturned by store.peekAll for that type, and will include all records in the store for\nthe given type, including any previously existing records not returned by the reload request.

\n", + "itemtype": "method", + "name": "shouldReloadAll [OPTIONAL]", + "access": "public", + "tagname": "", + "optional": 1, + "params": [ + { + "name": "store", + "description": "The store service that initiated the request being normalized", + "type": "Store" + }, + { + "name": "snapshotArray", + "description": "", + "type": "SnapshotRecordArray" + } + ], + "return": { + "description": "true if the a new request for all records of the type in SnapshotRecordArray should be made immediately, false otherwise", + "type": "Boolean" + }, + "class": " Adapter", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/q/minimum-adapter-interface.ts", + "line": 529, + "description": "

When a record is already available in the store and is requested again via store.findRecord,\nand the record does not need to be reloaded prior to return, this method provides the ability\nto specify whether a refresh of the data for the reload should be scheduled to occur in the background.

\n

Users may explicitly declare a record should/should not be background reloaded by passing\nbackgroundReload: true or backgroundReload: false as an option to the request respectively.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
store.findRecord('user', '1', { backgroundReload: false })
\n
\n
\n \n

If the backgroundReload option is not present, this method will be called to determine whether\na backgroundReload should be performed.

\n

The default behavior if this method is not implemented and the option was not specified is to\nbackground reload, the same as a return of true.

\n", + "itemtype": "method", + "name": "shouldBackgroundReloadRecord [OPTIONAL]", + "access": "public", + "tagname": "", + "optional": 1, + "params": [ + { + "name": "store", + "description": "The store service that initiated the request being normalized", + "type": "Store" + }, + { + "name": "snapshot", + "description": "A Snapshot containing the record's current data", + "type": "Snapshot" + } + ], + "return": { + "description": "true if the record should be reloaded in the background, false otherwise", + "type": "Boolean" + }, + "class": " Adapter", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/q/minimum-adapter-interface.ts", + "line": 556, + "description": "

When store.findAll(<type>) is called and a reload is not initiated, the adapter\nis presented the opportunity to trigger a new non-blocking (background) request for\nrecords of that type

\n

Users may explicitly declare that this background request should/should not occur by passing\nbackgroundReload: true or backgroundReload: false as an option to the request respectively.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
store.findAll('user', { backgroundReload: false })
\n
\n
\n \n

The default behavior if this method is not implemented and the option is not specified is to\nperform a reload, the same as a return of true.

\n", + "itemtype": "method", + "name": "shouldBackgroundReloadAll [OPTIONAL]", + "access": "public", + "tagname": "", + "optional": 1, + "params": [ + { + "name": "store", + "description": "The store service that initiated the request being normalized", + "type": "Store" + }, + { + "name": "snapshotArray", + "description": "", + "type": "SnapshotRecordArray" + } + ], + "return": { + "description": "true if the a new request for all records of the type in SnapshotRecordArray should be made in the background, false otherwise", + "type": "Boolean" + }, + "class": " Adapter", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/q/minimum-adapter-interface.ts", + "line": 580, + "description": "

In some situations the adapter may need to perform cleanup when destroyed,\nthat cleanup can be done in destroy.

\n

If not implemented, the store does not inform the adapter of destruction.

\n", + "itemtype": "method", + "name": "destroy [OPTIONAL]", + "access": "public", + "tagname": "", + "optional": 1, + "class": " Adapter", + "module": "@ember-data/experimental-preview-types" + } + ], + "events": [], + "properties": [ + { + "file": "../ember-data-types/q/minimum-adapter-interface.ts", + "line": 433, + "description": "

If your adapter implements findMany, setting this to true will cause findRecord\nrequests triggered within the same runloop to be coalesced into one or more calls\nto adapter.findMany. The number of calls made and the records contained in each call\ncan be tuned by your adapter's groupRecordsForHasMany method.

\n

Implementing coalescing using this flag and the associated methods does not always offer\nthe right level of correctness, timing control or granularity. If your application would\nbe better suited coalescing across multiple types, coalescing for longer than a single runloop,\nor with a more custom request structure, coalescing within your application adapter may prove\nmore effective.

\n", + "itemtype": "property", + "name": "coalesceFindRequests [OPTIONAL]", + "access": "public", + "tagname": "", + "optional": 1, + "type": "{boolean} true if the requests to find individual records should be coalesced, false otherwise", + "class": " Adapter", + "module": "@ember-data/experimental-preview-types" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/experimental-preview-types", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0- Cache.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0- Cache.json new file mode 100644 index 000000000..ea5d14160 --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0- Cache.json @@ -0,0 +1,714 @@ +{ + "data": { + "id": "ember-data-5.3.0- Cache", + "type": "class", + "attributes": { + "name": " Cache", + "shortname": " Cache", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/experimental-preview-types", + "namespace": "", + "file": "../../ember-data-types/cache/cache.ts", + "line": 31, + "description": "

The interface for EmberData Caches.

\n

A Cache handles in-memory storage of Document and Resource\ndata.

\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "../ember-data-types/cache/cache.ts", + "line": 53, + "description": "

Cache the response to a request

\n

Unlike store.push which has UPSERT\nsemantics, put has replace semantics similar to\nthe http method PUT

\n

the individually cacheable resource data it may contain\nshould upsert, but the document data surrounding it should\nfully replace any existing information

\n

Note that in order to support inserting arbitrary data\nto the cache that did not originate from a request put\nshould expect to sometimes encounter a document with only\na content member and therefor must not assume the existence\nof request and response on the document.

\n", + "itemtype": "method", + "name": "put", + "params": [ + { + "name": "doc", + "description": "", + "type": "StructuredDocument" + } + ], + "return": { + "description": "", + "type": "ResourceDocument" + }, + "access": "public", + "tagname": "", + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 77, + "description": "

Update the "remote" or "canonical" (persisted) state of the Cache\nby merging new information into the existing state.

\n

Note: currently the only valid resource operation is a MergeOperation\nwhich occurs when a collision of identifiers is detected.

\n", + "itemtype": "method", + "name": "patch", + "access": "public", + "tagname": "", + "params": [ + { + "name": "op", + "description": "the operation to perform", + "type": "Operation" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 91, + "description": "

Update the "local" or "current" (unpersisted) state of the Cache

\n", + "itemtype": "method", + "name": "mutate", + "params": [ + { + "name": "mutation", + "description": "", + "type": "Mutation" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "access": "public", + "tagname": "", + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 101, + "description": "

Peek resource data from the Cache.

\n

In development, if the return value\nis JSON the return value\nwill be deep-cloned and deep-frozen\nto prevent mutation thereby enforcing cache\nImmutability.

\n

This form of peek is useful for implementations\nthat want to feed raw-data from cache to the UI\nor which want to interact with a blob of data\ndirectly from the presentation cache.

\n

An implementation might want to do this because\nde-referencing records which read from their own\nblob is generally safer because the record does\nnot require retainining connections to the Store\nand Cache to present data on a per-field basis.

\n

This generally takes the place of getAttr as\nan API and may even take the place of getRelationship\ndepending on implementation specifics, though this\nlatter usage is less recommended due to the advantages\nof the Graph handling necessary entanglements and\nnotifications for relational data.

\n", + "itemtype": "method", + "name": "peek", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "", + "type": "StableRecordIdentifier | StableDocumentIdentifier" + } + ], + "return": { + "description": "the known resource data", + "type": "ResourceDocument | ResourceBlob | null" + }, + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 136, + "description": "

Peek the Cache for the existing request data associated with\na cacheable request

\n", + "itemtype": "method", + "name": "peekRequest", + "params": [ + { + "name": "UNKNOWN", + "description": "", + "type": "StableDocumentIdentifier" + } + ], + "return": { + "description": "", + "type": "StableDocumentIdentifier | null" + }, + "access": "public", + "tagname": "", + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 147, + "description": "

Push resource data from a remote source into the cache for this identifier

\n", + "itemtype": "method", + "name": "upsert", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "data", + "description": "" + }, + { + "name": "hasRecord", + "description": "" + } + ], + "return": { + "description": "if `hasRecord` is true then calculated key changes should be returned", + "type": "Void | string[]" + }, + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 162, + "description": "

Create a fork of the cache from the current state.

\n

Applications should typically not call this method themselves,\npreferring instead to fork at the Store level, which will\nutilize this method to fork the cache.

\n", + "itemtype": "method", + "name": "fork", + "access": "public", + "tagname": "", + "return": { + "description": "Promise" + }, + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 175, + "description": "

Merge a fork back into a parent Cache.

\n

Applications should typically not call this method themselves,\npreferring instead to merge at the Store level, which will\nutilize this method to merge the caches.

\n", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "cache", + "description": "", + "type": "Cache" + } + ], + "access": "public", + "tagname": "", + "return": { + "description": "Promise" + }, + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 189, + "description": "

Generate the list of changes applied to all\nrecord in the store.

\n

Each individual resource or document that has\nbeen mutated should be described as an individual\nChange entry in the returned array.

\n

A Change is described by an object containing up to\nthree properties: (1) the identifier of the entity that\nchanged; (2) the op code of that change being one of\nupsert or remove, and if the op is upsert a patch\ncontaining the data to merge into the cache for the given\nentity.

\n

This patch is opaque to the Store but should be understood\nby the Cache and may expect to be utilized by an Adapter\nwhen generating data during a save operation.

\n

It is generally recommended that the patch contain only\nthe updated state, ignoring fields that are unchanged

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
interface Change {\n identifier: StableRecordIdentifier | StableDocumentIdentifier;\n op: 'upsert' | 'remove';\n patch?: unknown;\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "diff", + "access": "public", + "tagname": "", + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 227, + "description": "

Serialize the entire contents of the Cache into a Stream\nwhich may be fed back into a new instance of the same Cache\nvia cache.hydrate.

\n", + "itemtype": "method", + "name": "dump", + "return": { + "description": "", + "type": "Promise" + }, + "access": "public", + "tagname": "", + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 238, + "description": "

hydrate a Cache from a Stream with content previously serialized\nfrom another instance of the same Cache, resolving when hydration\nis complete.

\n

This method should expect to be called both in the context of restoring\nthe Cache during application rehydration after SSR AND at unknown\ntimes during the lifetime of an already booted application when it is\ndesired to bulk-load additional information into the cache. This latter\nbehavior supports optimizing pre/fetching of data for route transitions\nvia data-only SSR modes.

\n", + "itemtype": "method", + "name": "hydrate", + "params": [ + { + "name": "stream", + "description": "", + "type": "ReadableStream" + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "access": "public", + "tagname": "", + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 260, + "description": "

[LIFECYCLE] Signal to the cache that a new record has been instantiated on the client

\n

It returns properties from options that should be set on the record during the create\nprocess. This return value behavior is deprecated.

\n", + "itemtype": "method", + "name": "clientDidCreate", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "createArgs", + "description": "" + } + ], + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 273, + "description": "

[LIFECYCLE] Signals to the cache that a resource\nwill be part of a save transaction.

\n", + "itemtype": "method", + "name": "willCommit", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 283, + "description": "

[LIFECYCLE] Signals to the cache that a resource\nwas successfully updated as part of a save transaction.

\n", + "itemtype": "method", + "name": "didCommit", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "- the primary identifier that was operated on" + }, + { + "name": "data", + "description": "- a document in the cache format containing any updated data" + } + ], + "return": { + "description": "", + "type": "SingleResourceDataDocument" + }, + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 295, + "description": "

[LIFECYCLE] Signals to the cache that a resource\nwas update via a save transaction failed.

\n", + "itemtype": "method", + "name": "commitWasRejected", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "errors", + "description": "" + } + ], + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 306, + "description": "

[LIFECYCLE] Signals to the cache that all data for a resource\nshould be cleared.

\n

This method is a candidate to become a mutation

\n", + "itemtype": "method", + "name": "unloadRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 321, + "description": "

Retrieve the data for an attribute from the cache

\n", + "itemtype": "method", + "name": "getAttr", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "field", + "description": "" + } + ], + "return": { + "description": "", + "type": "Unknown" + }, + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 332, + "description": "

Mutate the data for an attribute in the cache

\n

This method is a candidate to become a mutation

\n", + "itemtype": "method", + "name": "setAttr", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "field", + "description": "" + }, + { + "name": "value", + "description": "" + } + ], + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 345, + "description": "

Query the cache for the changed attributes of a resource.

\n

Returns a map of field names to tuples of [old, new] values

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{ <field>: [<old>, <new>] }
\n
\n
\n ", + "itemtype": "method", + "name": "changedAttrs", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "return": { + "description": "{ : [, ] }", + "type": "Record" + }, + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 361, + "description": "

Query the cache for whether any mutated attributes exist

\n", + "itemtype": "method", + "name": "hasChangedAttrs", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 371, + "description": "

Tell the cache to discard any uncommitted mutations to attributes

\n

This method is a candidate to become a mutation

\n", + "itemtype": "method", + "name": "rollbackAttrs", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "return": { + "description": "the names of fields that were restored", + "type": "String[]" + }, + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 383, + "description": "

Query the cache for the changes to relationships of a resource.

\n

Returns a map of relationship names to RelationshipDiff objects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
type RelationshipDiff =\n | {\n     kind: 'collection';\n     remoteState: StableRecordIdentifier[];\n     additions: Set<StableRecordIdentifier>;\n     removals: Set<StableRecordIdentifier>;\n     localState: StableRecordIdentifier[];\n     reordered: boolean;\n   }\n | {\n     kind: 'resource';\n     remoteState: StableRecordIdentifier | null;\n     localState: StableRecordIdentifier | null;\n   };
\n
\n
\n \n", + "itemtype": "method", + "name": "changedRelationships", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "", + "type": "StableRecordIdentifier" + } + ], + "return": { + "description": "", + "type": "Map" + }, + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 412, + "description": "

Query the cache for whether any mutated attributes exist

\n", + "itemtype": "method", + "name": "hasChangedRelationships", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "", + "type": "StableRecordIdentifier" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 422, + "description": "

Tell the cache to discard any uncommitted mutations to relationships.

\n

This will also discard the change on any appropriate inverses.

\n

This method is a candidate to become a mutation

\n", + "itemtype": "method", + "name": "rollbackRelationships", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "", + "type": "StableRecordIdentifier" + } + ], + "return": { + "description": "the names of relationships that were restored", + "type": "String[]" + }, + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 436, + "description": "

Query the cache for the current state of a relationship property

\n", + "itemtype": "method", + "name": "getRelationship", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "", + "type": "StableRecordIdentifier" + }, + { + "name": "field", + "description": "", + "type": "String" + } + ], + "return": { + "description": "resource relationship object" + }, + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 454, + "description": "

Update the cache state for the given resource to be marked\nas locally deleted, or remove such a mark.

\n

This method is a candidate to become a mutation

\n", + "itemtype": "method", + "name": "setIsDeleted", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "isDeleted", + "description": "", + "type": "Boolean" + } + ], + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 467, + "description": "

Query the cache for any validation errors applicable to the given resource.

\n", + "itemtype": "method", + "name": "getErrors", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "return": { + "description": "", + "type": "JsonApiError[]" + }, + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 477, + "description": "

Query the cache for whether a given resource has any available data

\n", + "itemtype": "method", + "name": "isEmpty", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 487, + "description": "

Query the cache for whether a given resource was created locally and not\nyet persisted.

\n", + "itemtype": "method", + "name": "isNew", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 498, + "description": "

Query the cache for whether a given resource is marked as deleted (but not\nnecessarily persisted yet).

\n", + "itemtype": "method", + "name": "isDeleted", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 509, + "description": "

Query the cache for whether a given resource has been deleted and that deletion\nhas also been persisted.

\n", + "itemtype": "method", + "name": "isDeletionCommitted", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + } + ], + "events": [], + "properties": [ + { + "file": "../ember-data-types/cache/cache.ts", + "line": 41, + "description": "

The Cache Version that this implementation implements.

\n", + "type": "{'2'}", + "access": "public", + "tagname": "", + "itemtype": "property", + "name": "version", + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/experimental-preview-types", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0- Handler.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0- Handler.json new file mode 100644 index 000000000..29d3f9ef5 --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0- Handler.json @@ -0,0 +1,67 @@ +{ + "data": { + "id": "ember-data-5.3.0- Handler", + "type": "class", + "attributes": { + "name": " Handler", + "shortname": " Handler", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/request", + "namespace": "", + "file": "../request/src/-private/types.ts", + "line": 205, + "description": "

Requests are fulfilled by handlers. A handler receives the request context\nas well as a next function with which to pass along a request to the next\nhandler if it so chooses.

\n

A handler may be any object with a request method. This allows both stateful and non-stateful\nhandlers to be utilized.

\n

If a handler calls next, it receives a Future which resolves to a StructuredDocument\nthat it can then compose how it sees fit with its own response.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
type NextFn<P> = (req: RequestInfo) => Future<P>;\n\ninterface Handler {\n async request<T>(context: RequestContext, next: NextFn<P>): T;\n}
\n
\n
\n \n

RequestContext contains a readonly version of the RequestInfo as well as a few methods for building up the StructuredDocument and Future that will be part of the response.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
interface RequestContext<T> {\n readonly request: RequestInfo;\n\n setStream(stream: ReadableStream | Promise<ReadableStream>): void;\n setResponse(response: Response | ResponseInfo): void;\n}
\n
\n
\n \n

A basic fetch handler with support for streaming content updates while\nthe download is still underway might look like the following, where we use\nresponse.clone() to tee the ReadableStream into two streams.

\n

A more efficient handler might read from the response stream, building up the\nresponse content before passing along the chunk downstream.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
const FetchHandler = {\n async request(context) {\n   const response = await fetch(context.request);\n   context.setResponse(reponse);\n   context.setStream(response.clone().body);\n\n   return response.json();\n }\n}
\n
\n
\n \n

Stream Currying

\n

RequestManager.request and next differ from fetch in one crucial detail in that the outer Promise resolves only once the response stream has been processed.

\n

For context, it helps to understand a few of the use-cases that RequestManager\nis intended to allow.

\n
    \n
  • to manage and return streaming content (such as video files)
  • \n
  • to fulfill a request from multiple sources or by splitting one request into multiple requests
      \n
    • for instance one API call for a user and another for the user's friends
    • \n
    • or e.g. fulfilling part of the request from one source (one API, in-memory, localStorage, IndexedDB etc.) and the rest from another source (a different API, a WebWorker, etc.)
    • \n
    \n
  • \n
  • to coalesce multiple requests
  • \n
  • to decorate a request with additional info
      \n
    • e.g. an Auth handler that ensures the correct tokens or headers or cookies are attached.
    • \n
    \n
  • \n
\n
\n

await fetch(<req>) resolves at the moment headers are received. This allows for the body of the request to be processed as a stream by application\ncode while chunks are still being received by the browser.

\n

When an app chooses to await response.json() what occurs is the browser reads the stream to completion and then returns the result. Additionally, this stream may only be read once.

\n

The RequestManager preserves this ability to subscribe to and utilize the stream by either the application or the handler – thereby delivering the full power and flexibility of native APIs – without restricting developers in ways that lead to complicated workarounds.

\n

Each handler may call setStream only once, but may do so at any time until the promise that the handler returns has resolved. The associated promise returned by calling future.getStream will resolve with the stream set by setStream if that method is called, or null if that method\nhas not been called by the time that the handler's request method has resolved.

\n

Handlers that do not create a stream of their own, but which call next, should defensively pipe the stream forward. While this is not required (see automatic currying below) it is better to do so in most cases as otherwise the stream may not become available to downstream handlers or the application until the upstream handler has fully read it.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
context.setStream(future.getStream());
\n
\n
\n \n

Handlers that either call next multiple times or otherwise have reason to create multiple fetch requests should either choose to return no stream, meaningfully combine the streams, or select a single prioritized stream.

\n

Of course, any handler may choose to read and handle the stream, and return either no stream or a different stream in the process.

\n

Automatic Currying of Stream and Response

\n

In order to simplify the common case for handlers which decorate a request, if next is called only a single time and setResponse was never called by the handler, the response set by the next handler in the chain will be applied to that handler's outcome. For instance, this makes the following pattern possible return (await next(<req>)).content;.

\n

Similarly, if next is called only a single time and neither setStream nor getStream was called, we automatically curry the stream from the future returned by next onto the future returned by the handler.

\n

Finally, if the return value of a handler is a Future, we curry content and errors as well, thus enabling the simplest form return next(<req>).

\n

In the case of the Future being returned, Stream proxying is automatic and immediate and does not wait for the Future to resolve.

\n

Handler Order

\n

Request handlers are registered by configuring the manager via use

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const manager = new RequestManager();\n\nmanager.use([Handler1, Handler2]);
\n
\n
\n \n

Handlers will be invoked in the order they are registered ("fifo", first-in first-out), and may only be registered up until the first request is made. It is recommended but not required to register all handlers at one time in order to ensure explicitly visible handler ordering.

\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "../packages/request/src/-private/types.ts", + "line": 318, + "description": "

Method to implement to handle requests. Receives the request\ncontext and a nextFn to call to pass-along the request to\nother handlers.

\n", + "itemtype": "method", + "name": "request", + "access": "public", + "tagname": "", + "params": [ + { + "name": "context", + "description": "" + }, + { + "name": "next", + "description": "" + } + ], + "class": " Handler", + "module": "@ember-data/request" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/request", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0- Serializer.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0- Serializer.json new file mode 100644 index 000000000..28335dc2e --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0- Serializer.json @@ -0,0 +1,223 @@ +{ + "data": { + "id": "ember-data-5.3.0- Serializer", + "type": "class", + "attributes": { + "name": " Serializer", + "shortname": " Serializer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/experimental-preview-types", + "namespace": "", + "file": "../../ember-data-types/q/minimum-serializer-interface.ts", + "line": 26, + "description": "
\n

\n ⚠️ This is LEGACY documentation for a feature that is no longer encouraged to be used.\n If starting a new app or thinking of implementing a new adapter, consider writing a\n Handler instead to be used with the RequestManager\n

\n
\n\n

The following documentation describes the methods an application\n serializer should implement with descriptions around when an\n application might expect these methods to be called.

\n

Methods that are not required are marked as optional.

\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "../ember-data-types/q/minimum-serializer-interface.ts", + "line": 45, + "description": "

This method is responsible for normalizing the value resolved from the promise returned\nby an Adapter request into the format expected by the Store.

\n

The output should be a JSON:API Document\nwith the following additional restrictions:

\n
    \n
  • type should be formatted in the singular dasherized lowercase form
  • \n
  • members (the property names of attributes and relationships) should be formatted\n to match their definition in the corresponding Model definition. Typically this\n will be camelCase.
  • \n
  • lid is\n a valid optional sibling to id and type in both Resources\n and Resource Identifier Objects
  • \n
\n", + "itemtype": "method", + "name": "normalizeResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "The store service that initiated the request being normalized", + "type": "Store" + }, + { + "name": "schema", + "description": "An object with methods for accessing information about\n the type, attributes and relationships of the primary type associated with the request.", + "type": "ModelSchema" + }, + { + "name": "rawPayload", + "description": "The raw JSON response data returned from an API request.\n This correlates to the value the promise returned by the adapter method that performed\n the request resolved to.", + "type": "JSONObject" + }, + { + "name": "id", + "description": "For a findRecord request, this is the id initially provided\n in the call to store.findRecord. Else this value is null.", + "type": "String|null" + }, + { + "name": "requestType", + "description": "The\n type of request the Adapter had been asked to perform.", + "type": "'findRecord' | 'queryRecord' | 'findAll' | 'findBelongsTo' | 'findHasMany' | 'findMany' | 'query' | 'createRecord' | 'deleteRecord' | 'updateRecord'" + } + ], + "return": { + "description": "a document following the structure of a JSON:API Document.", + "type": "JsonApiDocument" + }, + "class": " Serializer", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/q/minimum-serializer-interface.ts", + "line": 93, + "description": "

This method is responsible for serializing an individual record\nvia a Snapshot into the format expected by the API.

\n

This method is called by snapshot.serialize().

\n

When using Model, this method is called by record.serialize().

\n

When using JSONAPIAdapter or RESTAdapter this method is called\nby updateRecord and createRecord if Serializer.serializeIntoHash\nis not implemented.

\n", + "itemtype": "method", + "name": "serialize", + "access": "public", + "tagname": "", + "params": [ + { + "name": "snapshot", + "description": "A Snapshot for the record to serialize", + "type": "Snapshot" + }, + { + "name": "options", + "description": "", + "type": "Object", + "optional": true + } + ], + "class": " Serializer", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/q/minimum-serializer-interface.ts", + "line": 112, + "description": "

This method is intended to normalize data into a JSON:API Document\nwith a data member containing a single Resource.

\n
    \n
  • type should be formatted in the singular, dasherized and lowercase form
  • \n
  • members (the property names of attributes and relationships) should be formatted\n to match their definition in the corresponding Model definition. Typically this\n will be camelCase.
  • \n
  • lid is\n a valid optional sibling to id and type in both Resources\n and Resource Identifier Objects
  • \n
\n

This method is called by the Store when store.normalize(modelName, payload) is\ncalled. It is recommended to use store.serializerFor(modelName).normalizeResponse\nover store.normalize.

\n

This method may be called when also using the RESTSerializer\nwhen serializer.pushPayload is called by store.pushPayload.\nHowever, it is recommended to use store.push over store.pushPayload after normalizing\nthe payload directly.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
function pushPayload(store, modelName, rawPayload) {\n  const ModelClass = store.modelFor(modelName);\n  const serializer = store.serializerFor(modelName);\n  const jsonApiPayload = serializer.normalizeResponse(store, ModelClass, rawPayload, null, 'query');\n\n  return store.push(jsonApiPayload);\n}
\n
\n
\n \n

This method may be called when also using the JSONAPISerializer\nwhen normalizing included records. If mixing serializer usage in this way\nwe recommend implementing this method, but caution that it may lead\nto unexpected mixing of formats.

\n

This method may also be called when normalizing embedded relationships when\nusing the EmbeddedRecordsMixin. If using this mixin in a serializer in\nyour application we recommend implementing this method, but caution that\nit may lead to unexpected mixing of formats.

\n", + "itemtype": "method", + "name": "normalize [OPTIONAL]", + "access": "public", + "tagname": "", + "optional": 1, + "params": [ + { + "name": "schema", + "description": "An object with methods for accessing information about\n the type, attributes and relationships of the primary type associated with the request.", + "type": "ModelSchema" + }, + { + "name": "rawPayload", + "description": "Some raw JSON data to be normalized into a JSON:API Resource.", + "type": "JSONObject" + }, + { + "name": "prop", + "description": "When called by the EmbeddedRecordsMixin this param will be the\n property at which the object provided as rawPayload was found.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "A JSON:API Document\n containing a single JSON:API Resource\n as its primary data.", + "type": "SingleResourceDocument" + }, + "class": " Serializer", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/q/minimum-serializer-interface.ts", + "line": 168, + "description": "

When using JSONAPIAdapter or RESTAdapter this method is called\nby adapter.updateRecord and adapter.createRecord if serializer.serializeIntoHash\nis implemented. If this method is not implemented, serializer.serialize\nwill be called in this case.

\n

You can use this method to customize the root keys serialized into the payload.\nThe hash property should be modified by reference.

\n

For instance, your API may expect resources to be keyed by underscored type in the payload:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
{\n  _user: {\n    type: 'user',\n    id: '1'\n  }\n}
\n
\n
\n \n

Which when using these adapters can be achieved by implementing this method similar\nto the following:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
serializeIntoHash(hash, ModelClass, snapshot, options) {\n  hash[`_${snapshot.modelName}`] = this.serialize(snapshot, options).data;\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "serializeIntoHash [OPTIONAL]", + "access": "public", + "tagname": "", + "optional": 1, + "params": [ + { + "name": "hash", + "description": "A top most object of the request payload onto\n which to append the serialized record" + }, + { + "name": "schema", + "description": "An object with methods for accessing information about\n the type, attributes and relationships of the primary type associated with the request.", + "type": "ModelSchema" + }, + { + "name": "snapshot", + "description": "A Snapshot for the record to serialize", + "type": "Snapshot" + }, + { + "name": "options", + "description": "", + "optional": true + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": " Serializer", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/q/minimum-serializer-interface.ts", + "line": 210, + "description": "

This method allows for normalization of data when store.pushPayload is called\nand should be implemented if you want to use that method.

\n

The method is responsible for pushing new data to the store using store.push\nonce any necessary normalization has occurred, and no data in the store will be\nupdated unless it does so.

\n

The normalized form pushed to the store should be a JSON:API Document\nwith the following additional restrictions:

\n
    \n
  • type should be formatted in the singular, dasherized and lowercase form
  • \n
  • members (the property names of attributes and relationships) should be formatted\n to match their definition in the corresponding Model definition. Typically this\n will be camelCase.
  • \n
  • lid is\n a valid optional sibling to id and type in both Resources\n and Resource Identifier Objects
  • \n
\n

If you need better control over normalization or want access to the records being added or updated\nin the store, we recommended using store.push over store.pushPayload after normalizing\nthe payload directly. This can even take advantage of an existing serializer for the format\nthe data is in, for example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
function pushPayload(store, modelName, rawPayload) {\n  const ModelClass = store.modelFor(modelName);\n  const serializer = store.serializerFor(modelName);\n  const jsonApiPayload = serializer.normalizeResponse(store, ModelClass, rawPayload, null, 'query');\n\n  return store.push(jsonApiPayload);\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "pushPayload [OPTIONAL]", + "access": "public", + "tagname": "", + "optional": 1, + "params": [ + { + "name": "store", + "description": "The store service that initiated the request being normalized", + "type": "Store" + }, + { + "name": "rawPayload", + "description": "The raw JSON response data returned from an API request.\n This JSON should be in the API format expected by the serializer.", + "type": "JSONObject" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": " Serializer", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/q/minimum-serializer-interface.ts", + "line": 254, + "description": "

In some situations the serializer may need to perform cleanup when destroyed,\nthat cleanup can be done in destroy.

\n

If not implemented, the store does not inform the serializer of destruction.

\n", + "itemtype": "method", + "name": "destroy [OPTIONAL]", + "access": "public", + "tagname": "", + "optional": 1, + "class": " Serializer", + "module": "@ember-data/experimental-preview-types" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/experimental-preview-types", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-@ember-data/active-record/request.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-@ember-data/active-record/request.json new file mode 100644 index 000000000..d0e55cf28 --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-@ember-data/active-record/request.json @@ -0,0 +1,155 @@ +{ + "data": { + "id": "ember-data-5.3.0-@ember-data/active-record/request", + "type": "class", + "attributes": { + "name": "@ember-data/active-record/request", + "shortname": "@ember-data/active-record/request", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/active-record/request", + "namespace": "", + "methods": [ + { + "file": "../packages/active-record/src/-private/builders/find-record.ts", + "line": 21, + "description": "

Builds request options to fetch a single resource by a known id or identifier\nconfigured for the url and header expectations of most ActiveRecord APIs.

\n

Basic Usage

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import { findRecord } from '@ember-data/active-record/request';\n\nconst data = await store.request(findRecord('person', '1'));
\n
\n
\n \n

With Options

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { findRecord } from '@ember-data/active-record/request';\n\nconst options = findRecord('person', '1', { include: ['pets', 'friends'] });\nconst data = await store.request(options);
\n
\n
\n \n

With an Identifier

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { findRecord } from '@ember-data/active-record/request';\n\nconst options = findRecord({ type: 'person', id: '1' }, { include: ['pets', 'friends'] });\nconst data = await store.request(options);
\n
\n
\n \n

Supplying Options to Modify the Request Behavior

\n

The following options are supported:

\n
    \n
  • host - The host to use for the request, defaults to the host configured with setBuildURLConfig.
  • \n
  • namespace - The namespace to use for the request, defaults to the namespace configured with setBuildURLConfig.
  • \n
  • resourcePath - The resource path to use for the request, defaults to pluralizing and underscoring the supplied type
  • \n
  • reload - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to false if none is configured.
  • \n
  • backgroundReload - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to false if none is configured.
  • \n
  • urlParamsSetting - an object containing options for how to serialize the query params (see buildQueryParams)
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { findRecord } from '@ember-data/active-record/request';\n\nconst options = findRecord('person', '1', { include: ['pets', 'friends'] }, { namespace: 'api/v2' });\nconst data = await store.request(options);
\n
\n
\n \n", + "itemtype": "method", + "name": "findRecord", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/active-record/request", + "module": "@ember-data/active-record/request" + }, + { + "file": "../packages/active-record/src/-private/builders/query.ts", + "line": 13, + "description": "

Builds request options to query for resources, usually by a primary\ntype, configured for the url and header expectations of most ActiveRecord APIs.

\n

Basic Usage

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import { query } from '@ember-data/active-record/request';\n\nconst data = await store.request(query('person'));
\n
\n
\n \n

With Query Params

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { query } from '@ember-data/active-record/request';\n\nconst options = query('person', { include: ['pets', 'friends'] });\nconst data = await store.request(options);
\n
\n
\n \n

Supplying Options to Modify the Request Behavior

\n

The following options are supported:

\n
    \n
  • host - The host to use for the request, defaults to the host configured with setBuildURLConfig.
  • \n
  • namespace - The namespace to use for the request, defaults to the namespace configured with setBuildURLConfig.
  • \n
  • resourcePath - The resource path to use for the request, defaults to pluralizing and underscoring the supplied type
  • \n
  • reload - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to false if none is configured.
  • \n
  • backgroundReload - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to false if none is configured.
  • \n
  • urlParamsSetting - an object containing options for how to serialize the query params (see buildQueryParams)
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { query } from '@ember-data/active-record/request';\n\nconst options = query('person', { include: ['pets', 'friends'] }, { reload: true });\nconst data = await store.request(options);
\n
\n
\n \n", + "itemtype": "method", + "name": "query", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "query", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/active-record/request", + "module": "@ember-data/active-record/request" + }, + { + "file": "../packages/active-record/src/-private/builders/save-record.ts", + "line": 27, + "description": "

Builds request options to delete record for resources,\nconfigured for the url, method and header expectations of ActiveRecord APIs.

\n

Basic Usage

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { deleteRecord } from '@ember-data/active-record/request';\n\nconst person = this.store.peekRecord('person', '1');\n\n// mark record as deleted\nstore.deleteRecord(person);\n\n// persist deletion\nconst data = await store.request(deleteRecord(person));
\n
\n
\n \n

Supplying Options to Modify the Request Behavior

\n

The following options are supported:

\n
    \n
  • host - The host to use for the request, defaults to the host configured with setBuildURLConfig.
  • \n
  • namespace - The namespace to use for the request, defaults to the namespace configured with setBuildURLConfig.
  • \n
  • resourcePath - The resource path to use for the request, defaults to pluralizing the supplied type
  • \n
  • reload - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to false if none is configured.
  • \n
  • backgroundReload - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to false if none is configured.
  • \n
  • urlParamsSetting - an object containing options for how to serialize the query params (see buildQueryParams)
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { deleteRecord } from '@ember-data/active-record/request';\n\nconst person = this.store.peekRecord('person', '1');\n\n// mark record as deleted\nstore.deleteRecord(person);\n\n// persist deletion\nconst options = deleteRecord(person, { namespace: 'api/v1' });\nconst data = await store.request(options);
\n
\n
\n \n", + "itemtype": "method", + "name": "deleteRecord", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "record", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/active-record/request", + "module": "@ember-data/active-record/request" + }, + { + "file": "../packages/active-record/src/-private/builders/save-record.ts", + "line": 107, + "description": "

Builds request options to create new record for resources,\nconfigured for the url, method and header expectations of most ActiveRecord APIs.

\n

Basic Usage

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { createRecord } from '@ember-data/active-record/request';\n\nconst person = this.store.createRecord('person', { name: 'Ted' });\nconst data = await store.request(createRecord(person));
\n
\n
\n \n

Supplying Options to Modify the Request Behavior

\n

The following options are supported:

\n
    \n
  • host - The host to use for the request, defaults to the host configured with setBuildURLConfig.
  • \n
  • namespace - The namespace to use for the request, defaults to the namespace configured with setBuildURLConfig.
  • \n
  • resourcePath - The resource path to use for the request, defaults to pluralizing the supplied type
  • \n
  • reload - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to false if none is configured.
  • \n
  • backgroundReload - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to false if none is configured.
  • \n
  • urlParamsSetting - an object containing options for how to serialize the query params (see buildQueryParams)
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { createRecord } from '@ember-data/active-record/request';\n\nconst person = this.store.createRecord('person', { name: 'Ted' });\nconst options = createRecord(person, { namespace: 'api/v1' });\nconst data = await store.request(options);
\n
\n
\n \n", + "itemtype": "method", + "name": "createRecord", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "record", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/active-record/request", + "module": "@ember-data/active-record/request" + }, + { + "file": "../packages/active-record/src/-private/builders/save-record.ts", + "line": 176, + "description": "

Builds request options to update existing record for resources,\nconfigured for the url, method and header expectations of most ActiveRecord APIs.

\n

Basic Usage

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { updateRecord } from '@ember-data/active-record/request';\n\nconst person = this.store.peekRecord('person', '1');\nperson.name = 'Chris';\nconst data = await store.request(updateRecord(person));
\n
\n
\n \n

Supplying Options to Modify the Request Behavior

\n

The following options are supported:

\n
    \n
  • patch - Allows caller to specify whether to use a PATCH request instead of a PUT request, defaults to false.
  • \n
  • host - The host to use for the request, defaults to the host configured with setBuildURLConfig.
  • \n
  • namespace - The namespace to use for the request, defaults to the namespace configured with setBuildURLConfig.
  • \n
  • resourcePath - The resource path to use for the request, defaults to pluralizing the supplied type
  • \n
  • reload - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to false if none is configured.
  • \n
  • backgroundReload - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to false if none is configured.
  • \n
  • urlParamsSetting - an object containing options for how to serialize the query params (see buildQueryParams)
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import { updateRecord } from '@ember-data/active-record/request';\n\nconst person = this.store.peekRecord('person', '1');\nperson.name = 'Chris';\nconst options = updateRecord(person, { patch: true });\nconst data = await store.request(options);
\n
\n
\n \n", + "itemtype": "method", + "name": "updateRecord", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "record", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/active-record/request", + "module": "@ember-data/active-record/request" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/active-record/request", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-@ember-data/adapter/rest.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-@ember-data/adapter/rest.json new file mode 100644 index 000000000..d59f1c77f --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-@ember-data/adapter/rest.json @@ -0,0 +1,68 @@ +{ + "data": { + "id": "ember-data-5.3.0-@ember-data/adapter/rest", + "type": "class", + "attributes": { + "name": "@ember-data/adapter/rest", + "shortname": "@ember-data/adapter/rest", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/adapter/rest", + "namespace": "", + "methods": [ + { + "file": "../packages/adapter/src/rest.ts", + "line": 1464, + "description": "

Helper function that translates the options passed to jQuery.ajax into a format that fetch expects.

\n", + "itemtype": "method", + "name": "fetchOptions", + "params": [ + { + "name": "_options", + "description": "", + "type": "Object" + }, + { + "name": "adapter", + "description": "", + "type": "Adapter" + } + ], + "access": "private", + "tagname": "", + "return": { + "description": "", + "type": "Object" + }, + "class": "@ember-data/adapter/rest", + "module": "@ember-data/adapter/rest" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/adapter/rest", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-@ember-data/json-api/request.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-@ember-data/json-api/request.json new file mode 100644 index 000000000..537bf876e --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-@ember-data/json-api/request.json @@ -0,0 +1,211 @@ +{ + "data": { + "id": "ember-data-5.3.0-@ember-data/json-api/request", + "type": "class", + "attributes": { + "name": "@ember-data/json-api/request", + "shortname": "@ember-data/json-api/request", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/json-api/request", + "namespace": "", + "methods": [ + { + "file": "../packages/json-api/src/-private/builders/find-record.ts", + "line": 15, + "description": "

Builds request options to fetch a single resource by a known id or identifier\nconfigured for the url and header expectations of most JSON:API APIs.

\n

Basic Usage

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import { findRecord } from '@ember-data/json-api/request';\n\nconst data = await store.request(findRecord('person', '1'));
\n
\n
\n \n

With Options

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { findRecord } from '@ember-data/json-api/request';\n\nconst options = findRecord('person', '1', { include: ['pets', 'friends'] });\nconst data = await store.request(options);
\n
\n
\n \n

With an Identifier

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { findRecord } from '@ember-data/json-api/request';\n\nconst options = findRecord({ type: 'person', id: '1' }, { include: ['pets', 'friends'] });\nconst data = await store.request(options);
\n
\n
\n \n

Supplying Options to Modify the Request Behavior

\n

The following options are supported:

\n
    \n
  • host - The host to use for the request, defaults to the host configured with setBuildURLConfig.
  • \n
  • namespace - The namespace to use for the request, defaults to the namespace configured with setBuildURLConfig.
  • \n
  • resourcePath - The resource path to use for the request, defaults to pluralizing the supplied type
  • \n
  • reload - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to false if none is configured.
  • \n
  • backgroundReload - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to false if none is configured.
  • \n
  • urlParamsSetting - an object containing options for how to serialize the query params (see buildQueryParams)
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { findRecord } from '@ember-data/json-api/request';\n\nconst options = findRecord('person', '1', { include: ['pets', 'friends'] }, { namespace: 'api/v2' });\nconst data = await store.request(options);
\n
\n
\n \n", + "itemtype": "method", + "name": "findRecord", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/json-api/request", + "module": "@ember-data/json-api/request" + }, + { + "file": "../packages/json-api/src/-private/builders/query.ts", + "line": 11, + "description": "

Builds request options to query for resources, usually by a primary\ntype, configured for the url and header expectations of most JSON:API APIs.

\n

Basic Usage

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import { query } from '@ember-data/json-api/request';\n\nconst data = await store.request(query('person'));
\n
\n
\n \n

With Query Params

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { query } from '@ember-data/json-api/request';\n\nconst options = query('person', { include: ['pets', 'friends'] });\nconst data = await store.request(options);
\n
\n
\n \n

Supplying Options to Modify the Request Behavior

\n

The following options are supported:

\n
    \n
  • host - The host to use for the request, defaults to the host configured with setBuildURLConfig.
  • \n
  • namespace - The namespace to use for the request, defaults to the namespace configured with setBuildURLConfig.
  • \n
  • resourcePath - The resource path to use for the request, defaults to pluralizing the supplied type
  • \n
  • reload - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to false if none is configured.
  • \n
  • backgroundReload - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to false if none is configured.
  • \n
  • urlParamsSetting - an object containing options for how to serialize the query params (see buildQueryParams)
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { query } from '@ember-data/json-api/request';\n\nconst options = query('person', { include: ['pets', 'friends'] }, { reload: true });\nconst data = await store.request(options);
\n
\n
\n \n", + "itemtype": "method", + "name": "query", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "query", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/json-api/request", + "module": "@ember-data/json-api/request" + }, + { + "file": "../packages/json-api/src/-private/builders/save-record.ts", + "line": 26, + "description": "

Builds request options to delete record for resources,\nconfigured for the url, method and header expectations of most JSON:API APIs.

\n

Basic Usage

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { deleteRecord } from '@ember-data/json-api/request';\n\nconst person = this.store.peekRecord('person', '1');\n\n// mark record as deleted\nstore.deleteRecord(person);\n\n// persist deletion\nconst data = await store.request(deleteRecord(person));
\n
\n
\n \n

Supplying Options to Modify the Request Behavior

\n

The following options are supported:

\n
    \n
  • host - The host to use for the request, defaults to the host configured with setBuildURLConfig.
  • \n
  • namespace - The namespace to use for the request, defaults to the namespace configured with setBuildURLConfig.
  • \n
  • resourcePath - The resource path to use for the request, defaults to pluralizing the supplied type
  • \n
  • reload - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to false if none is configured.
  • \n
  • backgroundReload - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to false if none is configured.
  • \n
  • urlParamsSetting - an object containing options for how to serialize the query params (see buildQueryParams)
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { deleteRecord } from '@ember-data/json-api/request';\n\nconst person = this.store.peekRecord('person', '1');\n\n// mark record as deleted\nstore.deleteRecord(person);\n\n// persist deletion\nconst options = deleteRecord(person, { namespace: 'api/v1' });\nconst data = await store.request(options);
\n
\n
\n \n", + "itemtype": "method", + "name": "deleteRecord", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "record", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/json-api/request", + "module": "@ember-data/json-api/request" + }, + { + "file": "../packages/json-api/src/-private/builders/save-record.ts", + "line": 106, + "description": "

Builds request options to create new record for resources,\nconfigured for the url, method and header expectations of most JSON:API APIs.

\n

Basic Usage

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { createRecord } from '@ember-data/json-api/request';\n\nconst person = this.store.createRecord('person', { name: 'Ted' });\nconst data = await store.request(createRecord(person));
\n
\n
\n \n

Supplying Options to Modify the Request Behavior

\n

The following options are supported:

\n
    \n
  • host - The host to use for the request, defaults to the host configured with setBuildURLConfig.
  • \n
  • namespace - The namespace to use for the request, defaults to the namespace configured with setBuildURLConfig.
  • \n
  • resourcePath - The resource path to use for the request, defaults to pluralizing the supplied type
  • \n
  • reload - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to false if none is configured.
  • \n
  • backgroundReload - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to false if none is configured.
  • \n
  • urlParamsSetting - an object containing options for how to serialize the query params (see buildQueryParams)
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { createRecord } from '@ember-data/json-api/request';\n\nconst person = this.store.createRecord('person', { name: 'Ted' });\nconst options = createRecord(person, { namespace: 'api/v1' });\nconst data = await store.request(options);
\n
\n
\n \n", + "itemtype": "method", + "name": "createRecord", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "record", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/json-api/request", + "module": "@ember-data/json-api/request" + }, + { + "file": "../packages/json-api/src/-private/builders/save-record.ts", + "line": 175, + "description": "

Builds request options to update existing record for resources,\nconfigured for the url, method and header expectations of most JSON:API APIs.

\n

Basic Usage

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { updateRecord } from '@ember-data/json-api/request';\n\nconst person = this.store.peekRecord('person', '1');\nperson.name = 'Chris';\nconst data = await store.request(updateRecord(person));
\n
\n
\n \n

Supplying Options to Modify the Request Behavior

\n

The following options are supported:

\n
    \n
  • patch - Allows caller to specify whether to use a PATCH request instead of a PUT request, defaults to false.
  • \n
  • host - The host to use for the request, defaults to the host configured with setBuildURLConfig.
  • \n
  • namespace - The namespace to use for the request, defaults to the namespace configured with setBuildURLConfig.
  • \n
  • resourcePath - The resource path to use for the request, defaults to pluralizing the supplied type
  • \n
  • reload - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to false if none is configured.
  • \n
  • backgroundReload - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to false if none is configured.
  • \n
  • urlParamsSetting - an object containing options for how to serialize the query params (see buildQueryParams)
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import { updateRecord } from '@ember-data/json-api/request';\n\nconst person = this.store.peekRecord('person', '1');\nperson.name = 'Chris';\nconst options = updateRecord(person, { patch: true });\nconst data = await store.request(options);
\n
\n
\n \n", + "itemtype": "method", + "name": "updateRecord", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "record", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/json-api/request", + "module": "@ember-data/json-api/request" + }, + { + "file": "../packages/json-api/src/-private/serialize.ts", + "line": 10, + "description": "

Serializes the current state of a resource or array of resources for use with POST or PUT requests.

\n", + "itemtype": "method", + "name": "serializeResources", + "static": 1, + "access": "public", + "tagname": "", + "params": [ + { + "name": "cache}", + "description": "", + "type": "Cache" + }, + { + "name": "identifier", + "description": "", + "type": "StableRecordIdentifier" + } + ], + "return": { + "description": "An object with a `data` property containing the serialized resource patch", + "type": "Object" + }, + "class": "@ember-data/json-api/request", + "module": "@ember-data/json-api/request" + }, + { + "file": "../packages/json-api/src/-private/serialize.ts", + "line": 47, + "description": "

Serializes changes to a resource for use with PATCH requests.

\n

Only attributes which are changed are serialized.\nOnly relationships which are changed are serialized.

\n

Collection relationships serialize the collection as a whole.

\n

If you would like to serialize updates to a collection more granularly\n(for instance, as operations) request the diff from the store and\nserialize as desired:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
const relationshipDiffMap = cache.changedRelationships(identifier);
\n
\n
\n \n", + "itemtype": "method", + "name": "serializePatch", + "static": 1, + "access": "public", + "tagname": "", + "params": [ + { + "name": "cache}", + "description": "", + "type": "Cache" + }, + { + "name": "identifier", + "description": "", + "type": "StableRecordIdentifier" + } + ], + "return": { + "description": "An object with a `data` property containing the serialized resource patch", + "type": "Object" + }, + "class": "@ember-data/json-api/request", + "module": "@ember-data/json-api/request" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/json-api/request", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-@ember-data/model.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-@ember-data/model.json new file mode 100644 index 000000000..13f0727bf --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-@ember-data/model.json @@ -0,0 +1,125 @@ +{ + "data": { + "id": "ember-data-5.3.0-@ember-data/model", + "type": "class", + "attributes": { + "name": "@ember-data/model", + "shortname": "@ember-data/model", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/model", + "namespace": "", + "methods": [ + { + "file": "../packages/model/src/-private/attr.js", + "line": 14, + "itemtype": "method", + "description": "

attr defines an attribute on a Model.\nBy default, attributes are passed through as-is, however you can specify an\noptional type to have the value automatically transformed.\nEmber Data ships with four basic transform types: string, number,\nboolean and date. You can define your own transforms by subclassing\nTransform.

\n

Note that you cannot use attr to define an attribute of id.

\n

attr takes an optional hash as a second parameter, currently\nsupported options are:

\n
    \n
  • defaultValue: Pass a string or a function to be called to set the attribute\nto a default value if and only if the key is absent from the payload response.
  • \n
\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/models/user.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Model, { attr } from '@ember-data/model';\n\nexport default class UserModel extends Model {\n  @attr('text', {\n    uppercase: true\n  })\n  text;\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/transforms/text.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
export default class TextTransform {\n  serialize(value, options) {\n    if (options.uppercase) {\n      return value.toUpperCase();\n    }\n\n    return value;\n  }\n\n  deserialize(value) {\n    return value;\n  }\n\n  static create() {\n    return new this();\n  }\n}
\n
\n
\n \n", + "name": "attr", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "type", + "description": "the attribute type", + "type": "String|Object" + }, + { + "name": "options", + "description": "a hash of options", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Attribute" + }, + "class": "@ember-data/model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/belongs-to.js", + "line": 13, + "itemtype": "method", + "description": "

belongsTo is used to define One-To-One and One-To-Many\nrelationships on a Model.

\n

belongsTo takes an optional hash as a second parameter, currently\nsupported options are:

\n
    \n
  • async: A boolean value used to explicitly declare this to be an async relationship. The default is true.
  • \n
  • inverse: A string used to identify the inverse property on a\nrelated model in a One-To-Many relationship. See Explicit Inverses
  • \n
  • polymorphic A boolean value to mark the relationship as polymorphic
  • \n
\n

One-To-One

\n

To declare a one-to-one relationship between two models, use\nbelongsTo:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/models/user.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Model, { belongsTo } from '@ember-data/model';\n\nexport default class UserModel extends Model {\n  @belongsto('post', {\n    async: false,\n    inverse: null\n  })\n  post;\n}
\n
\n
\n \n

In contrast to async relationship, accessing a sync relationship\nwill always return the record (Model instance) for the existing\nlocal resource, or null. But it will error on access when\na related resource is known to exist and it has not been loaded.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
let post = comment.post;
\n
\n
\n

@hasmany('comment', { async: false, inverse: 'post' }) comments;\n}

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
```app/models/comment.js\nimport Model, { belongsTo } from '@ember-data/model';\n\nexport default class CommentModel extends Model {
\n
\n
\n ", + "name": "belongsTo", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "modelName", + "description": "(optional) type of the relationship", + "type": "String" + }, + { + "name": "options", + "description": "(optional) a hash of options", + "type": "Object" + } + ], + "return": { + "description": "relationship", + "type": "Ember.computed" + }, + "class": "@ember-data/model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/has-many.js", + "line": 41, + "itemtype": "method", + "description": "

hasMany is used to define One-To-Many and Many-To-Many\nrelationships on a Model.

\n

hasMany takes an optional hash as a second parameter, currently\nsupported options are:

\n
    \n
  • async: A boolean value used to explicitly declare this to be an async relationship. The default is true.
  • \n
  • inverse: A string used to identify the inverse property on a related model.
  • \n
  • polymorphic A boolean value to mark the relationship as polymorphic
  • \n
\n

One-To-Many

\n

To declare a one-to-many relationship between two models, use\nbelongsTo in combination with hasMany, like this:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/models/post.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Model, { hasMany } from '@ember-data/model';\n\nexport default class PostModel extends Model {\n  @hasmany('comment', {\n    async: false\n  })\n  comments;\n}
\n
\n
\n \n

In contrast to async relationship, accessing a sync relationship\nwill always return a ManyArray instance\ncontaining the existing local resources. But it will error on access\nwhen any of the known related resources have not been loaded.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
post.comments.forEach((comment) => {\n\n});
\n
\n
\n

If you are using links with sync relationships, you have to use\nref.reload to fetch the resources.\n @belongsto('post') bluePost;\n}

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
```app/models/post.js\nimport Model, { hasMany } from '@ember-data/model';\n\nexport default class PostModel extends Model {
\n
\n
\n ", + "name": "hasMany", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "type", + "description": "(optional) type of the relationship", + "type": "String" + }, + { + "name": "options", + "description": "(optional) a hash of options", + "type": "Object" + } + ], + "return": { + "description": "relationship", + "type": "Ember.computed" + }, + "class": "@ember-data/model", + "module": "@ember-data/model" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/model", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-@ember-data/request-utils.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-@ember-data/request-utils.json new file mode 100644 index 000000000..08c5d0d81 --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-@ember-data/request-utils.json @@ -0,0 +1,187 @@ +{ + "data": { + "id": "ember-data-5.3.0-@ember-data/request-utils", + "type": "class", + "attributes": { + "name": "@ember-data/request-utils", + "shortname": "@ember-data/request-utils", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/request-utils", + "namespace": "", + "methods": [ + { + "file": "../packages/request-utils/src/index.ts", + "line": 60, + "description": "

Sets the global configuration for buildBaseURL\nfor host and namespace values for the application.

\n

These values may still be overridden by passing\nthem to buildBaseURL directly.

\n

This method may be called as many times as needed

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
type BuildURLConfig = {\n  host: string;\n  namespace: string'\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "setBuildURLConfig", + "static": 1, + "access": "public", + "tagname": "", + "params": [ + { + "name": "config", + "description": "", + "type": "BuildURLConfig" + } + ], + "return": { + "description": "void" + }, + "class": "@ember-data/request-utils", + "module": "@ember-data/request-utils" + }, + { + "file": "../packages/request-utils/src/index.ts", + "line": 185, + "description": "

Builds a URL for a request based on the provided options.\nDoes not include support for building query params (see buildQueryParams)\nso that it may be composed cleanly with other query-params strategies.

\n

Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { buildBaseURL } from '@ember-data/request-utils';\n\nconst url = buildBaseURL({\n  host: 'https://api.example.com',\n  namespace: 'api/v1',\n  resourcePath: 'emberDevelopers',\n  op: 'query',\n  identifier: { type: 'ember-developer' }\n});\n\n// => 'https://api.example.com/api/v1/emberDevelopers'
\n
\n
\n \n

On the surface this may seem like a lot of work to do something simple, but\nit is designed to be composable with other utilities and interfaces that the\naverage product engineer will never need to see or use.

\n

A few notes:

\n
    \n
  • resourcePath is optional, but if it is not provided, identifier.type will be used.
  • \n
  • host and namespace are optional, but if they are not provided, the values globally\n configured via setBuildURLConfig will be used.
  • \n
  • op is required and must be one of the following:
      \n
    • 'findRecord' 'query' 'findMany' 'findRelatedCollection' 'findRelatedRecord'` 'createRecord' 'updateRecord' 'deleteRecord'
    • \n
    \n
  • \n
  • Depending on the value of op, identifier or identifiers will be required.
  • \n
\n", + "itemtype": "method", + "name": "buildBaseURL", + "static": 1, + "access": "public", + "tagname": "", + "params": [ + { + "name": "urlOptions", + "description": "" + } + ], + "return": { + "description": "string" + }, + "class": "@ember-data/request-utils", + "module": "@ember-data/request-utils" + }, + { + "file": "../packages/request-utils/src/index.ts", + "line": 338, + "description": "

filter out keys of an object that have falsy values or point to empty arrays\nreturning a new object with only those keys that have truthy values / non-empty arrays

\n", + "itemtype": "method", + "name": "filterEmpty", + "static": 1, + "access": "public", + "tagname": "", + "params": [ + { + "name": "source", + "description": "object to filter keys with empty values from", + "type": "Record" + } + ], + "return": { + "description": "A new object with the keys that contained empty values removed", + "type": "Record" + }, + "class": "@ember-data/request-utils", + "module": "@ember-data/request-utils" + }, + { + "file": "../packages/request-utils/src/index.ts", + "line": 363, + "description": "

Sorts query params by both key and value returning a new URLSearchParams\nobject with the keys inserted in sorted order.

\n

Treats included specially, splicing it into an array if it is a string and sorting the array.

\n

Options:

\n
    \n
  • arrayFormat: 'bracket' | 'indices' | 'repeat' | 'comma'
  • \n
\n

'bracket': appends [] to the key for every value e.g. &ids[]=1&ids[]=2\n'indices': appends [i] to the key for every value e.g. &ids[0]=1&ids[1]=2\n'repeat': appends the key for every value e.g. &ids=1&ids=2\n'comma' (default): appends the key once with a comma separated list of values e.g. &ids=1,2

\n", + "itemtype": "method", + "name": "sortQueryParams", + "static": 1, + "access": "public", + "tagname": "", + "params": [ + { + "name": "params", + "description": "", + "type": "URLSearchParams | object" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "A URLSearchParams with keys inserted in sorted order", + "type": "URLSearchParams" + }, + "class": "@ember-data/request-utils", + "module": "@ember-data/request-utils" + }, + { + "file": "../packages/request-utils/src/index.ts", + "line": 445, + "description": "

Sorts query params by both key and value, returning a query params string

\n

Treats included specially, splicing it into an array if it is a string and sorting the array.

\n

Options:

\n
    \n
  • arrayFormat: 'bracket' | 'indices' | 'repeat' | 'comma'
  • \n
\n

'bracket': appends [] to the key for every value e.g. ids[]=1&ids[]=2\n'indices': appends [i] to the key for every value e.g. ids[0]=1&ids[1]=2\n'repeat': appends the key for every value e.g. ids=1&ids=2\n'comma' (default): appends the key once with a comma separated list of values e.g. ids=1,2

\n", + "itemtype": "method", + "name": "sortQueryParams", + "static": 1, + "access": "public", + "tagname": "", + "params": [ + { + "name": "params", + "description": "", + "type": "URLSearchParams | object" + }, + { + "name": "options", + "description": "", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A sorted query params string without the leading `?`", + "type": "String" + }, + "class": "@ember-data/request-utils", + "module": "@ember-data/request-utils" + }, + { + "file": "../packages/request-utils/src/index.ts", + "line": 488, + "description": "

Parses a string Cache-Control header value into an object with the following structure:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
 interface CacheControlValue {\n immutable?: boolean;\n 'max-age'?: number;\n 'must-revalidate'?: boolean;\n 'must-understand'?: boolean;\n 'no-cache'?: boolean;\n 'no-store'?: boolean;\n 'no-transform'?: boolean;\n 'only-if-cached'?: boolean;\n private?: boolean;\n 'proxy-revalidate'?: boolean;\n public?: boolean;\n 's-maxage'?: number;\n 'stale-if-error'?: number;\n 'stale-while-revalidate'?: number;\n }
\n
\n
\n \n", + "itemtype": "method", + "name": "parseCacheControl", + "static": 1, + "access": "public", + "tagname": "", + "params": [ + { + "name": "header", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "CacheControlValue" + }, + "class": "@ember-data/request-utils", + "module": "@ember-data/request-utils" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/request-utils", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-@ember-data/rest/request.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-@ember-data/rest/request.json new file mode 100644 index 000000000..bc4bd861a --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-@ember-data/rest/request.json @@ -0,0 +1,155 @@ +{ + "data": { + "id": "ember-data-5.3.0-@ember-data/rest/request", + "type": "class", + "attributes": { + "name": "@ember-data/rest/request", + "shortname": "@ember-data/rest/request", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/rest/request", + "namespace": "", + "methods": [ + { + "file": "../packages/rest/src/-private/builders/find-record.ts", + "line": 21, + "description": "

Builds request options to fetch a single resource by a known id or identifier\nconfigured for the url and header expectations of most REST APIs.

\n

Basic Usage

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import { findRecord } from '@ember-data/rest/request';\n\nconst data = await store.request(findRecord('person', '1'));
\n
\n
\n \n

With Options

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { findRecord } from '@ember-data/rest/request';\n\nconst options = findRecord('person', '1', { include: ['pets', 'friends'] });\nconst data = await store.request(options);
\n
\n
\n \n

With an Identifier

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { findRecord } from '@ember-data/rest/request';\n\nconst options = findRecord({ type: 'person', id: '1' }, { include: ['pets', 'friends'] });\nconst data = await store.request(options);
\n
\n
\n \n

Supplying Options to Modify the Request Behavior

\n

The following options are supported:

\n
    \n
  • host - The host to use for the request, defaults to the host configured with setBuildURLConfig.
  • \n
  • namespace - The namespace to use for the request, defaults to the namespace configured with setBuildURLConfig.
  • \n
  • resourcePath - The resource path to use for the request, defaults to pluralizing and camelCasing the supplied type
  • \n
  • reload - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to false if none is configured.
  • \n
  • backgroundReload - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to false if none is configured.
  • \n
  • urlParamsSetting - an object containing options for how to serialize the query params (see buildQueryParams)
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { findRecord } from '@ember-data/rest/request';\n\nconst options = findRecord('person', '1', { include: ['pets', 'friends'] }, { namespace: 'api/v2' });\nconst data = await store.request(options);
\n
\n
\n \n", + "itemtype": "method", + "name": "findRecord", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/rest/request", + "module": "@ember-data/rest/request" + }, + { + "file": "../packages/rest/src/-private/builders/query.ts", + "line": 13, + "description": "

Builds request options to query for resources, usually by a primary\ntype, configured for the url and header expectations of most REST APIs.

\n

Basic Usage

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import { query } from '@ember-data/rest/request';\n\nconst data = await store.request(query('person'));
\n
\n
\n \n

With Query Params

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { query } from '@ember-data/rest/request';\n\nconst options = query('person', { include: ['pets', 'friends'] });\nconst data = await store.request(options);
\n
\n
\n \n

Supplying Options to Modify the Request Behavior

\n

The following options are supported:

\n
    \n
  • host - The host to use for the request, defaults to the host configured with setBuildURLConfig.
  • \n
  • namespace - The namespace to use for the request, defaults to the namespace configured with setBuildURLConfig.
  • \n
  • resourcePath - The resource path to use for the request, defaults to pluralizing and camelCasing the supplied type
  • \n
  • reload - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to false if none is configured.
  • \n
  • backgroundReload - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to false if none is configured.
  • \n
  • urlParamsSetting - an object containing options for how to serialize the query params (see buildQueryParams)
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { query } from '@ember-data/rest/request';\n\nconst options = query('person', { include: ['pets', 'friends'] }, { reload: true });\nconst data = await store.request(options);
\n
\n
\n \n", + "itemtype": "method", + "name": "query", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "query", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/rest/request", + "module": "@ember-data/rest/request" + }, + { + "file": "../packages/rest/src/-private/builders/save-record.ts", + "line": 27, + "description": "

Builds request options to delete record for resources,\nconfigured for the url, method and header expectations of REST APIs.

\n

Basic Usage

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { deleteRecord } from '@ember-data/rest/request';\n\nconst person = this.store.peekRecord('person', '1');\n\n// mark record as deleted\nstore.deleteRecord(person);\n\n// persist deletion\nconst data = await store.request(deleteRecord(person));
\n
\n
\n \n

Supplying Options to Modify the Request Behavior

\n

The following options are supported:

\n
    \n
  • host - The host to use for the request, defaults to the host configured with setBuildURLConfig.
  • \n
  • namespace - The namespace to use for the request, defaults to the namespace configured with setBuildURLConfig.
  • \n
  • resourcePath - The resource path to use for the request, defaults to pluralizing the supplied type
  • \n
  • reload - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to false if none is configured.
  • \n
  • backgroundReload - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to false if none is configured.
  • \n
  • urlParamsSetting - an object containing options for how to serialize the query params (see buildQueryParams)
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { deleteRecord } from '@ember-data/rest/request';\n\nconst person = this.store.peekRecord('person', '1');\n\n// mark record as deleted\nstore.deleteRecord(person);\n\n// persist deletion\nconst options = deleteRecord(person, { namespace: 'api/v1' });\nconst data = await store.request(options);
\n
\n
\n \n", + "itemtype": "method", + "name": "deleteRecord", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "record", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/rest/request", + "module": "@ember-data/rest/request" + }, + { + "file": "../packages/rest/src/-private/builders/save-record.ts", + "line": 107, + "description": "

Builds request options to create new record for resources,\nconfigured for the url, method and header expectations of most REST APIs.

\n

Basic Usage

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { createRecord } from '@ember-data/rest/request';\n\nconst person = this.store.createRecord('person', { name: 'Ted' });\nconst data = await store.request(createRecord(person));
\n
\n
\n \n

Supplying Options to Modify the Request Behavior

\n

The following options are supported:

\n
    \n
  • host - The host to use for the request, defaults to the host configured with setBuildURLConfig.
  • \n
  • namespace - The namespace to use for the request, defaults to the namespace configured with setBuildURLConfig.
  • \n
  • resourcePath - The resource path to use for the request, defaults to pluralizing the supplied type
  • \n
  • reload - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to false if none is configured.
  • \n
  • backgroundReload - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to false if none is configured.
  • \n
  • urlParamsSetting - an object containing options for how to serialize the query params (see buildQueryParams)
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { createRecord } from '@ember-data/rest/request';\n\nconst person = this.store.createRecord('person', { name: 'Ted' });\nconst options = createRecord(person, { namespace: 'api/v1' });\nconst data = await store.request(options);
\n
\n
\n \n", + "itemtype": "method", + "name": "createRecord", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "record", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/rest/request", + "module": "@ember-data/rest/request" + }, + { + "file": "../packages/rest/src/-private/builders/save-record.ts", + "line": 176, + "description": "

Builds request options to update existing record for resources,\nconfigured for the url, method and header expectations of most REST APIs.

\n

Basic Usage

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { updateRecord } from '@ember-data/rest/request';\n\nconst person = this.store.peekRecord('person', '1');\nperson.name = 'Chris';\nconst data = await store.request(updateRecord(person));
\n
\n
\n \n

Supplying Options to Modify the Request Behavior

\n

The following options are supported:

\n
    \n
  • patch - Allows caller to specify whether to use a PATCH request instead of a PUT request, defaults to false.
  • \n
  • host - The host to use for the request, defaults to the host configured with setBuildURLConfig.
  • \n
  • namespace - The namespace to use for the request, defaults to the namespace configured with setBuildURLConfig.
  • \n
  • resourcePath - The resource path to use for the request, defaults to pluralizing the supplied type
  • \n
  • reload - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to false if none is configured.
  • \n
  • backgroundReload - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to false if none is configured.
  • \n
  • urlParamsSetting - an object containing options for how to serialize the query params (see buildQueryParams)
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import { updateRecord } from '@ember-data/rest/request';\n\nconst person = this.store.peekRecord('person', '1');\nperson.name = 'Chris';\nconst options = updateRecord(person, { patch: true });\nconst data = await store.request(options);
\n
\n
\n \n", + "itemtype": "method", + "name": "updateRecord", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "record", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/rest/request", + "module": "@ember-data/rest/request" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/rest/request", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-@ember-data/store.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-@ember-data/store.json new file mode 100644 index 000000000..6f454674b --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-@ember-data/store.json @@ -0,0 +1,136 @@ +{ + "data": { + "id": "ember-data-5.3.0-@ember-data/store", + "type": "class", + "attributes": { + "name": "@ember-data/store", + "shortname": "@ember-data/store", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/store", + "namespace": "", + "methods": [ + { + "file": "../ember-data-types/q/identifier.ts", + "line": 123, + "description": "

Configures how unique identifier lid strings are generated by @ember-data/store.

\n

This configuration MUST occur prior to the store instance being created.

\n

Takes a method which can expect to receive various data as its first argument\nand the name of a bucket as its second argument.

\n

Currently there are two buckets, 'record' and 'document'.

\n

Resource (Record) Identity

\n

If the bucket is record the method must return a unique (to at-least\nthe given bucket) string identifier for the given data as a string to be\nused as the lid of an Identifier token.

\n

This method will only be called by either getOrCreateRecordIdentifier or\ncreateIdentifierForNewRecord when an identifier for the supplied data\nis not already known via lid or type + id combo and one needs to be\ngenerated or retrieved from a proprietary cache.

\n

data will be the same data argument provided to getOrCreateRecordIdentifier\nand in the createIdentifierForNewRecord case will be an object with\nonly type as a key.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { setIdentifierGenerationMethod } from '@ember-data/store';\n\nexport function initialize(applicationInstance) {\n  // note how `count` here is now scoped to the application instance\n  // for our generation method by being inside the closure provided\n  // by the initialize function\n  let count = 0;\n\n  setIdentifierGenerationMethod((resource, bucket) => {\n    return resource.lid || `my-key-${count++}`;\n  });\n}\n\nexport default {\n  name: 'configure-ember-data-identifiers',\n  initialize\n};
\n
\n
\n \n

Document Identity

\n

If the bucket is document the method will receive the associated\nimmutable request passed to store.request as its first argument\nand should return a unique string for the given request if the document\nshould be cached, and null if it should not be cached.

\n

Note, the request result will still be passed to the cache via Cache.put,\nbut caches should take this as a signal that the document should not itself\nbe cached, while its contents may still be used to update other cache state.

\n

The presence of cacheOptions.key on the request will take precedence\nfor the document cache key, and this method will not be called if it is\npresent.

\n

The default method implementation for this bucket is to return null\nfor all requests whose method is not GET, and to return the url for\nthose where it is.

\n

This means that queries via POST MUST provide cacheOptions.key or\nimplement this hook.

\n

⚠️ Caution: Requests that do not have a method assigned are assumed to be GET

\n", + "itemtype": "method", + "name": "setIdentifierGenerationMethod", + "params": [ + { + "name": "method", + "description": "" + } + ], + "access": "public", + "tagname": "", + "static": 1, + "class": "@ember-data/store", + "module": "@ember-data/store" + }, + { + "file": "../ember-data-types/q/identifier.ts", + "line": 204, + "description": "

Configure a callback for when the identifier cache encounters new resource\ndata for an existing resource.

\n

This configuration MUST occur prior to the store instance being created.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
import { setIdentifierUpdateMethod } from '@ember-data/store';
\n
\n
\n \n

Takes a method which can expect to receive an existing Identifier alongside\nsome new data to consider as a second argument. This is an opportunity\nfor secondary lookup tables and caches associated with the identifier\nto be amended.

\n

This method is called everytime updateRecordIdentifier is called and\n with the same arguments. It provides the opportunity to update secondary\n lookup tables for existing identifiers.

\n

It will always be called after an identifier created with createIdentifierForNewRecord\n has been committed, or after an update to the record a RecordIdentifier\n is assigned to has been committed. Committed here meaning that the server\n has acknowledged the update (for instance after a call to .save())

\n

If id has not previously existed, it will be assigned to the Identifier\n prior to this UpdateMethod being called; however, calls to the parent method\n updateRecordIdentifier that attempt to change the id or calling update\n without providing an id when one is missing will throw an error.

\n", + "itemtype": "method", + "name": "setIdentifierUpdateMethod", + "params": [ + { + "name": "method", + "description": "" + } + ], + "access": "public", + "tagname": "", + "static": 1, + "class": "@ember-data/store", + "module": "@ember-data/store" + }, + { + "file": "../ember-data-types/q/identifier.ts", + "line": 245, + "description": "

Configure a callback for when the identifier cache is going to release an identifier.

\n

This configuration MUST occur prior to the store instance being created.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
import { setIdentifierForgetMethod } from '@ember-data/store';
\n
\n
\n \n

Takes method which can expect to receive an existing Identifier that should be eliminated\nfrom any secondary lookup tables or caches that the user has populated for it.

\n", + "itemtype": "method", + "name": "setIdentifierForgetMethod", + "params": [ + { + "name": "method", + "description": "" + } + ], + "access": "public", + "tagname": "", + "static": 1, + "class": "@ember-data/store", + "module": "@ember-data/store" + }, + { + "file": "../ember-data-types/q/identifier.ts", + "line": 265, + "description": "

Configure a callback for when the identifier cache is being torn down.

\n

This configuration MUST occur prior to the store instance being created.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
import { setIdentifierResetMethod } from '@ember-data/store';
\n
\n
\n \n

Takes a method which can expect to be called when the parent application is destroyed.

\n

If you have properly used a WeakMap to encapsulate the state of your customization\nto the application instance, you may not need to implement the resetMethod.

\n", + "itemtype": "method", + "name": "setIdentifierResetMethod", + "params": [ + { + "name": "method", + "description": "" + } + ], + "access": "public", + "tagname": "", + "static": 1, + "class": "@ember-data/store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/caches/instance-cache.ts", + "line": 34, + "description": "

Retrieves the unique referentially-stable RecordIdentifier\nassigned to the given record instance.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { recordIdentifierFor } from "@ember-data/store";\n// ... gain access to a record, for instance with peekRecord or findRecord\nconst record = store.peekRecord("user", "1");\n// get the identifier for the record (see docs for StableRecordIdentifier)\nconst identifier = recordIdentifierFor(record);\n// access the identifier's properties.\nconst { id, type, lid } = identifier;
\n
\n
\n \n", + "itemtype": "method", + "name": "recordIdentifierFor", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "record", + "description": "a record instance previously obstained from the store.", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "StableRecordIdentifier" + }, + "class": "@ember-data/store", + "module": "@ember-data/store" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/store", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-@ember-data/tracking.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-@ember-data/tracking.json new file mode 100644 index 000000000..3b4791a13 --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-@ember-data/tracking.json @@ -0,0 +1,104 @@ +{ + "data": { + "id": "ember-data-5.3.0-@ember-data/tracking", + "type": "class", + "attributes": { + "name": "@ember-data/tracking", + "shortname": "@ember-data/tracking", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/tracking", + "namespace": "", + "methods": [ + { + "file": "../packages/tracking/src/-private.ts", + "line": 150, + "description": "

Run method without subscribing to any tracked properties\ncontrolled by EmberData.

\n

This should rarely be used except by libraries that really\nknow what they are doing. It is most useful for wrapping\ncertain kinds of fetch/query logic from within a Resource\nhook or other similar pattern.

\n", + "itemtype": "method", + "name": "untracked", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "method", + "description": "" + } + ], + "return": { + "description": "result of invoking method" + }, + "class": "@ember-data/tracking", + "module": "@ember-data/tracking" + }, + { + "file": "../packages/tracking/src/-private.ts", + "line": 173, + "description": "

Run the method, subscribing to any tracked properties\nmanaged by EmberData that were accessed or written during\nthe method's execution as per-normal but while allowing\ninterleaving of reads and writes.

\n

This is useful when for instance you want to perform\na mutation based on existing state that must be read first.

\n", + "itemtype": "method", + "name": "transact", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "method", + "description": "" + } + ], + "return": { + "description": "result of invoking method" + }, + "class": "@ember-data/tracking", + "module": "@ember-data/tracking" + }, + { + "file": "../packages/tracking/src/-private.ts", + "line": 196, + "description": "

A helpful utility for creating a new function that\nalways runs in a transaction. E.G. this "memoizes"\ncalling transact(fn), currying args as necessary.

\n", + "itemtype": "method", + "name": "memoTransact", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "method", + "description": "" + } + ], + "return": { + "description": "a function that will invoke method in a transaction with any provided args and return its result" + }, + "class": "@ember-data/tracking", + "module": "@ember-data/tracking" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/tracking", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-AbortError.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-AbortError.json new file mode 100644 index 000000000..950dd6a3e --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-AbortError.json @@ -0,0 +1,49 @@ +{ + "data": { + "id": "ember-data-5.3.0-AbortError", + "type": "class", + "attributes": { + "name": "AbortError", + "shortname": "AbortError", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/adapter/error", + "namespace": "", + "file": "../adapter/src/error.js", + "line": 217, + "description": "

A AbortError is used by an adapter to signal that a request to\nthe external API was aborted. For example, this can occur if the user\nnavigates away from the current page after a request to the external API\nhas been initiated but before a response has been received.

\n", + "access": "public", + "tagname": "", + "extends": "AdapterError", + "methods": [], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-data-5.3.0-AdapterError", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/adapter/error", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-Adapter.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-Adapter.json new file mode 100644 index 000000000..598c0a0e5 --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-Adapter.json @@ -0,0 +1,552 @@ +{ + "data": { + "id": "ember-data-5.3.0-Adapter", + "type": "class", + "attributes": { + "name": "Adapter", + "shortname": "Adapter", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/adapter", + "namespace": "", + "file": "../adapter/src/index.ts", + "line": 197, + "description": "

An adapter is an object that receives requests from a store and\ntranslates them into the appropriate action to take against your\npersistence layer. The persistence layer is usually an HTTP API but\nmay be anything, such as the browser's local storage. Typically the\nadapter is not invoked directly instead its functionality is accessed\nthrough the store.

\n
\n

⚠️ CAUTION you likely want the docs for Adapter\nas extending this abstract class is unnecessary.

\n
\n

Creating an Adapter

\n

Create a new subclass of Adapter in the app/adapters folder:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n
import Adapter from '@ember-data/adapter';\n\nexport default Adapter.extend({\n  // ...your code here\n});
\n
\n
\n \n

Model-specific adapters can be created by putting your adapter\nclass in an app/adapters/ + model-name + .js file of the application.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/post.js
1\n2\n3\n4\n5\n
import Adapter from '@ember-data/adapter';\n\nexport default Adapter.extend({\n  // ...Post-specific adapter code goes here\n});
\n
\n
\n \n

Adapter is an abstract base class that you should override in your\napplication to customize it for your backend. The minimum set of methods\nthat you should implement is:

\n
    \n
  • findRecord()
  • \n
  • createRecord()
  • \n
  • updateRecord()
  • \n
  • deleteRecord()
  • \n
  • findAll()
  • \n
  • query()
  • \n
\n

To improve the network performance of your application, you can optimize\nyour adapter by overriding these lower-level methods:

\n
    \n
  • findMany()
  • \n
\n

For an example of the implementation, see RESTAdapter, the\nincluded REST adapter.

\n", + "access": "public", + "tagname": "", + "extends": "Ember.EmberObject", + "methods": [ + { + "file": "../packages/adapter/src/index.ts", + "line": 260, + "description": "

The findRecord() method is invoked when the store is asked for a record that\nhas not previously been loaded. In response to findRecord() being called, you\nshould query your persistence layer for a record with the given ID. The findRecord\nmethod should return a promise that will resolve to a JavaScript object that will be\nnormalized by the serializer.

\n

Here is an example of the findRecord implementation:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Adapter from '@ember-data/adapter';\nimport RSVP from 'RSVP';\nimport $ from 'jquery';\n\nexport default class ApplicationAdapter extends Adapter {\n  findRecord(store, type, id, snapshot) {\n    return new RSVP.Promise(function(resolve, reject) {\n      $.getJSON(`/${type.modelName}/${id}`).then(function(data) {\n        resolve(data);\n      }, function(jqXHR) {\n        reject(jqXHR);\n      });\n    });\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "findRecord", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "", + "type": "Model" + }, + { + "name": "id", + "description": "", + "type": "String" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "access": "public", + "tagname": "", + "class": "Adapter", + "module": "@ember-data/adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 302, + "description": "

The findAll() method is used to retrieve all records for a given type.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Adapter from '@ember-data/adapter';\nimport RSVP from 'RSVP';\nimport $ from 'jquery';\n\nexport default class ApplicationAdapter extends Adapter {\n  findAll(store, type) {\n    return new RSVP.Promise(function(resolve, reject) {\n      $.getJSON(`/${type.modelName}`).then(function(data) {\n        resolve(data);\n      }, function(jqXHR) {\n        reject(jqXHR);\n      });\n    });\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "findAll", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "", + "type": "Model" + }, + { + "name": "neverSet", + "description": "a value is never provided to this argument", + "type": "Undefined" + }, + { + "name": "snapshotRecordArray", + "description": "", + "type": "SnapshotRecordArray" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "access": "public", + "tagname": "", + "class": "Adapter", + "module": "@ember-data/adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 345, + "description": "

This method is called when you call query on the store.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Adapter from '@ember-data/adapter';\nimport RSVP from 'RSVP';\nimport $ from 'jquery';\n\nexport default class ApplicationAdapter extends Adapter {\n  query(store, type, query) {\n    return new RSVP.Promise(function(resolve, reject) {\n      $.getJSON(`/${type.modelName}`, query).then(function(data) {\n        resolve(data);\n      }, function(jqXHR) {\n        reject(jqXHR);\n      });\n    });\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "query", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "", + "type": "Model" + }, + { + "name": "query", + "description": "", + "type": "Object" + }, + { + "name": "recordArray", + "description": "", + "type": "Collection" + }, + { + "name": "adapterOptions", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "access": "public", + "tagname": "", + "class": "Adapter", + "module": "@ember-data/adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 384, + "description": "

The queryRecord() method is invoked when the store is asked for a single\nrecord through a query object.

\n

In response to queryRecord() being called, you should always fetch fresh\ndata. Once found, you can asynchronously call the store's push() method\nto push the record into the store.

\n

Here is an example queryRecord implementation:

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Adapter, { BuildURLMixin } from '@ember-data/adapter';\nimport RSVP from 'RSVP';\nimport $ from 'jquery';\n\nexport default class ApplicationAdapter extends Adapter.extend(BuildURLMixin) {\n  queryRecord(store, type, query) {\n    return new RSVP.Promise(function(resolve, reject) {\n      $.getJSON(`/${type.modelName}`, query).then(function(data) {\n        resolve(data);\n      }, function(jqXHR) {\n        reject(jqXHR);\n      });\n    });\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "queryRecord", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "", + "type": "Subclass of Model" + }, + { + "name": "query", + "description": "", + "type": "Object" + }, + { + "name": "adapterOptions", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "access": "public", + "tagname": "", + "class": "Adapter", + "module": "@ember-data/adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 429, + "description": "

If the globally unique IDs for your records should be generated on the client,\nimplement the generateIdForRecord() method. This method will be invoked\neach time you create a new record, and the value returned from it will be\nassigned to the record's primaryKey.

\n

Most traditional REST-like HTTP APIs will not use this method. Instead, the ID\nof the record will be set by the server, and your adapter will update the store\nwith the new ID when it calls didCreateRecord(). Only implement this method if\nyou intend to generate record IDs on the client-side.

\n

The generateIdForRecord() method will be invoked with the requesting store as\nthe first parameter and the newly created record as the second parameter:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import Adapter from '@ember-data/adapter';\nimport { v4 } from 'uuid';\n\nexport default class ApplicationAdapter extends Adapter {\n  generateIdForRecord(store, type, inputProperties) {\n    return v4();\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "generateIdForRecord", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "the Model class of the record", + "type": "Model" + }, + { + "name": "inputProperties", + "description": "a hash of properties to set on the\n newly created record.", + "type": "Object" + } + ], + "return": { + "description": "id", + "type": "(String|Number)" + }, + "access": "public", + "tagname": "", + "class": "Adapter", + "module": "@ember-data/adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 463, + "description": "

Proxies to the serializer's serialize method.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Adapter from '@ember-data/adapter';\n\nexport default class ApplicationAdapter extends Adapter {\n  createRecord(store, type, snapshot) {\n    let data = this.serialize(snapshot, { includeId: true });\n    let url = `/${type.modelName}`;\n\n    // ...\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "serialize", + "params": [ + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "serialized snapshot", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Adapter", + "module": "@ember-data/adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 491, + "description": "

Implement this method in a subclass to handle the creation of\nnew records.

\n

Serializes the record and sends it to the server.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n
import Adapter from '@ember-data/adapter';\nimport RSVP from 'RSVP';\nimport $ from 'jquery';\n\nexport default class ApplicationAdapter extends Adapter {\n  createRecord(store, type, snapshot) {\n    let data = this.serialize(snapshot, { includeId: true });\n\n    return new RSVP.Promise(function (resolve, reject) {\n      $.ajax({\n        type: 'POST',\n        url: `/${type.modelName}`,\n        dataType: 'json',\n        data: data\n      }).then(function (data) {\n        resolve(data);\n      }, function (jqXHR) {\n        jqXHR.then = null; // tame jQuery's ill mannered promises\n        reject(jqXHR);\n      });\n    });\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "createRecord", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "the Model class of the record", + "type": "Model" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "access": "public", + "tagname": "", + "class": "Adapter", + "module": "@ember-data/adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 539, + "description": "

Implement this method in a subclass to handle the updating of\na record.

\n

Serializes the record update and sends it to the server.

\n

The updateRecord method is expected to return a promise that will\nresolve with the serialized record. This allows the backend to\ninform the Ember Data store the current state of this record after\nthe update. If it is not possible to return a serialized record\nthe updateRecord promise can also resolve with undefined and the\nEmber Data store will assume all of the updates were successfully\napplied on the backend.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n
import Adapter from '@ember-data/adapter';\nimport RSVP from 'RSVP';\nimport $ from 'jquery';\n\nexport default class ApplicationAdapter extends Adapter {\n  updateRecord(store, type, snapshot) {\n    let data = this.serialize(snapshot, { includeId: true });\n    let id = snapshot.id;\n\n    return new RSVP.Promise(function(resolve, reject) {\n      $.ajax({\n        type: 'PUT',\n        url: `/${type.modelName}/${id}`,\n        dataType: 'json',\n        data: data\n      }).then(function(data) {\n        resolve(data);\n      }, function(jqXHR) {\n        jqXHR.then = null; // tame jQuery's ill mannered promises\n        reject(jqXHR);\n      });\n    });\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "updateRecord", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "the Model class of the record", + "type": "Model" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "access": "public", + "tagname": "", + "class": "Adapter", + "module": "@ember-data/adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 596, + "description": "

Implement this method in a subclass to handle the deletion of\na record.

\n

Sends a delete request for the record to the server.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n
import Adapter from '@ember-data/adapter';\nimport RSVP from 'RSVP';\nimport $ from 'jquery';\n\nexport default class ApplicationAdapter extends Adapter {\n  deleteRecord(store, type, snapshot) {\n    let data = this.serialize(snapshot, { includeId: true });\n    let id = snapshot.id;\n\n    return new RSVP.Promise(function(resolve, reject) {\n      $.ajax({\n        type: 'DELETE',\n        url: `/${type.modelName}/${id}`,\n        dataType: 'json',\n        data: data\n      }).then(function(data) {\n        resolve(data)\n      }, function(jqXHR) {\n        jqXHR.then = null; // tame jQuery's ill mannered promises\n        reject(jqXHR);\n      });\n    });\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "deleteRecord", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "the Model class of the record", + "type": "Model" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "access": "public", + "tagname": "", + "class": "Adapter", + "module": "@ember-data/adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 667, + "description": "

The store will call findMany instead of multiple findRecord\nrequests to find multiple records at once if coalesceFindRequests\nis true.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Adapter from '@ember-data/adapter';\nimport RSVP from 'RSVP';\nimport $ from 'jquery';\n\nexport default class ApplicationAdapter extends Adapter {\n  findMany(store, type, ids, snapshots) {\n    return new RSVP.Promise(function(resolve, reject) {\n      $.ajax({\n        type: 'GET',\n        url: `/${type.modelName}/`,\n        dataType: 'json',\n        data: { filter: { id: ids.join(',') } }\n      }).then(function(data) {\n        resolve(data);\n      }, function(jqXHR) {\n        jqXHR.then = null; // tame jQuery's ill mannered promises\n        reject(jqXHR);\n      });\n    });\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "findMany", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "the Model class of the records", + "type": "Model" + }, + { + "name": "ids", + "description": "", + "type": "Array" + }, + { + "name": "snapshots", + "description": "", + "type": "Array" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "access": "public", + "tagname": "", + "class": "Adapter", + "module": "@ember-data/adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 705, + "description": "

Organize records into groups, each of which is to be passed to separate\ncalls to findMany.

\n

For example, if your API has nested URLs that depend on the parent, you will\nwant to group records by their parent.

\n

The default implementation returns the records as a single group.

\n", + "itemtype": "method", + "name": "groupRecordsForFindMany", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "snapshots", + "description": "", + "type": "Array" + } + ], + "return": { + "description": "an array of arrays of records, each of which is to be\n loaded separately by `findMany`.", + "type": "Array" + }, + "class": "Adapter", + "module": "@ember-data/adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 725, + "description": "

This method is used by the store to determine if the store should\nreload a record from the adapter when a record is requested by\nstore.findRecord.

\n

If this method returns true, the store will re-fetch a record from\nthe adapter. If this method returns false, the store will resolve\nimmediately using the cached record.

\n

For example, if you are building an events ticketing system, in which users\ncan only reserve tickets for 20 minutes at a time, and want to ensure that\nin each route you have data that is no more than 20 minutes old you could\nwrite:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
shouldReloadRecord(store, ticketSnapshot) {\n  let lastAccessedAt = ticketSnapshot.attr('lastAccessedAt');\n  let timeDiff = moment().diff(lastAccessedAt, 'minutes');\n\n  if (timeDiff > 20) {\n    return true;\n  } else {\n    return false;\n  }\n}
\n
\n
\n \n

This method would ensure that whenever you do store.findRecord('ticket',\nid) you will always get a ticket that is no more than 20 minutes old. In\ncase the cached version is more than 20 minutes old, findRecord will not\nresolve until you fetched the latest version.

\n

By default this hook returns false, as most UIs should not block user\ninteractions while waiting on data update.

\n

Note that, with default settings, shouldBackgroundReloadRecord will always\nre-fetch the records in the background even if shouldReloadRecord returns\nfalse. You can override shouldBackgroundReloadRecord if this does not\nsuit your use case.

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "shouldReloadRecord", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Adapter", + "module": "@ember-data/adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 776, + "description": "

This method is used by the store to determine if the store should\nreload all records from the adapter when records are requested by\nstore.findAll.

\n

If this method returns true, the store will re-fetch all records from\nthe adapter. If this method returns false, the store will resolve\nimmediately using the cached records.

\n

For example, if you are building an events ticketing system, in which users\ncan only reserve tickets for 20 minutes at a time, and want to ensure that\nin each route you have data that is no more than 20 minutes old you could\nwrite:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
shouldReloadAll(store, snapshotArray) {\n  let snapshots = snapshotArray.snapshots();\n\n  return snapshots.any((ticketSnapshot) => {\n    let lastAccessedAt = ticketSnapshot.attr('lastAccessedAt');\n    let timeDiff = moment().diff(lastAccessedAt, 'minutes');\n\n    if (timeDiff > 20) {\n      return true;\n    } else {\n      return false;\n    }\n  });\n}
\n
\n
\n \n

This method would ensure that whenever you do store.findAll('ticket') you\nwill always get a list of tickets that are no more than 20 minutes old. In\ncase a cached version is more than 20 minutes old, findAll will not\nresolve until you fetched the latest versions.

\n

By default, this method returns true if the passed snapshotRecordArray\nis empty (meaning that there are no records locally available yet),\notherwise, it returns false.

\n

Note that, with default settings, shouldBackgroundReloadAll will always\nre-fetch all the records in the background even if shouldReloadAll returns\nfalse. You can override shouldBackgroundReloadAll if this does not suit\nyour use case.

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "shouldReloadAll", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "snapshotRecordArray", + "description": "", + "type": "SnapshotRecordArray" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Adapter", + "module": "@ember-data/adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 832, + "description": "

This method is used by the store to determine if the store should\nreload a record after the store.findRecord method resolves a\ncached record.

\n

This method is only checked by the store when the store is\nreturning a cached record.

\n

If this method returns true the store will re-fetch a record from\nthe adapter.

\n

For example, if you do not want to fetch complex data over a mobile\nconnection, or if the network is down, you can implement\nshouldBackgroundReloadRecord as follows:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
shouldBackgroundReloadRecord(store, snapshot) {\n  let { downlink, effectiveType } = navigator.connection;\n\n  return downlink > 0 && effectiveType === '4g';\n}
\n
\n
\n \n

By default, this hook returns true so the data for the record is updated\nin the background.

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "shouldBackgroundReloadRecord", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Adapter", + "module": "@ember-data/adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 869, + "description": "

This method is used by the store to determine if the store should\nreload a record array after the store.findAll method resolves\nwith a cached record array.

\n

This method is only checked by the store when the store is\nreturning a cached record array.

\n

If this method returns true the store will re-fetch all records\nfrom the adapter.

\n

For example, if you do not want to fetch complex data over a mobile\nconnection, or if the network is down, you can implement\nshouldBackgroundReloadAll as follows:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
shouldBackgroundReloadAll(store, snapshotArray) {\n  let { downlink, effectiveType } = navigator.connection;\n\n  return downlink > 0 && effectiveType === '4g';\n}
\n
\n
\n \n

By default this method returns true, indicating that a background reload\nshould always be triggered.

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "shouldBackgroundReloadAll", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "snapshotRecordArray", + "description": "", + "type": "SnapshotRecordArray" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Adapter", + "module": "@ember-data/adapter" + } + ], + "events": [], + "properties": [ + { + "file": "../packages/adapter/src/index.ts", + "line": 645, + "description": "

By default the store will try to coalesce all findRecord calls within the same runloop\ninto as few requests as possible by calling groupRecordsForFindMany and passing it into a findMany call.\nYou can opt out of this behaviour by either not implementing the findMany hook or by setting\ncoalesceFindRequests to false.

\n", + "itemtype": "property", + "name": "coalesceFindRequests", + "access": "public", + "tagname": "", + "type": "{boolean}", + "class": "Adapter", + "module": "@ember-data/adapter" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "Ember.EmberObject", + "type": "missing" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-data-5.3.0-RESTAdapter" + } + ] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/adapter", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-AdapterError.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-AdapterError.json new file mode 100644 index 000000000..b18c008e1 --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-AdapterError.json @@ -0,0 +1,79 @@ +{ + "data": { + "id": "ember-data-5.3.0-AdapterError", + "type": "class", + "attributes": { + "name": "AdapterError", + "shortname": "AdapterError", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/adapter/error", + "namespace": "", + "file": "../adapter/src/error.js", + "line": 6, + "description": "

Overview

\n
\n

\n ⚠️ This is LEGACY documentation for a feature that is no longer encouraged to be used.\n If starting a new app or thinking of implementing a new adapter, consider writing a\n Handler instead to be used with the RequestManager\n

\n
\n\n

An AdapterError is used by an adapter to signal that an error occurred\nduring a request to an external API. It indicates a generic error, and\nsubclasses are used to indicate specific error states.

\n

To create a custom error to signal a specific error state in communicating\nwith an external API, extend the AdapterError. For example, if the\nexternal API exclusively used HTTP 503 Service Unavailable to indicate\nit was closed for maintenance:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
error.js
1\n2\n3\n
import AdapterError from '@ember-data/adapter/error';\n\nexport default AdapterError.extend({ message: "Down for maintenance." });
\n
\n
\n \n

This error would then be returned by an adapter's handleResponse method:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import JSONAPIAdapter from '@ember-data/adapter/json-api';\nimport MaintenanceError from './maintenance-error';\n\nexport default class ApplicationAdapter extends JSONAPIAdapter {\n  handleResponse(status) {\n    if (503 === status) {\n      return new MaintenanceError();\n    }\n\n    return super.handleResponse(...arguments);\n  }\n}
\n
\n
\n \n

And can then be detected in an application and used to send the user to an\nunder-maintenance route:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Route from '@ember/routing/route';\nimport MaintenanceError from '../adapters/maintenance-error';\n\nexport default class ApplicationRoute extends Route {\n  actions: {\n    error(error, transition) {\n      if (error instanceof MaintenanceError) {\n        this.transitionTo('under-maintenance');\n        return;\n      }\n\n      // ...other error handling logic\n    }\n  }\n}
\n
\n
\n \n

@mainName @ember-data/adapter/error\n @tag main

\n", + "_main": true, + "access": "public", + "tagname": "", + "methods": [], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-data-5.3.0-InvalidError" + }, + { + "type": "class", + "id": "ember-data-5.3.0-TimeoutError" + }, + { + "type": "class", + "id": "ember-data-5.3.0-AbortError" + }, + { + "type": "class", + "id": "ember-data-5.3.0-UnauthorizedError" + }, + { + "type": "class", + "id": "ember-data-5.3.0-ForbiddenError" + }, + { + "type": "class", + "id": "ember-data-5.3.0-NotFoundError" + }, + { + "type": "class", + "id": "ember-data-5.3.0-ConflictError" + }, + { + "type": "class", + "id": "ember-data-5.3.0-ServerError" + } + ] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/adapter/error", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-BelongsToReference.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-BelongsToReference.json new file mode 100644 index 000000000..ccd47cbfe --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-BelongsToReference.json @@ -0,0 +1,214 @@ +{ + "data": { + "id": "ember-data-5.3.0-BelongsToReference", + "type": "class", + "attributes": { + "name": "BelongsToReference", + "shortname": "BelongsToReference", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/model", + "namespace": "", + "file": "../model/src/-private/references/belongs-to.ts", + "line": 42, + "description": "

A BelongsToReference is a low-level API that allows users and\naddon authors to perform meta-operations on a belongs-to\nrelationship.

\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "../packages/model/src/-private/references/belongs-to.ts", + "line": 135, + "itemtype": "method", + "description": "

The id of the record that this reference refers to. Together, the\ntype() and id() methods form a composite key for the identity\nmap. This can be used to access the id of an async relationship\nwithout triggering a fetch that would normally happen if you\nattempted to use record.relationship.id.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n
// models/blog.js\nimport Model, { belongsTo } from '@ember-data/model';\n\nexport default class BlogModel extends Model {\n  @belongsto('user', { async: true, inverse: null }) user;\n}\n\nlet blog = store.push({\n   data: {\n     type: 'blog',\n     id: 1,\n     relationships: {\n       user: {\n         data: { type: 'user', id: 1 }\n       }\n     }\n   }\n });\nlet userRef = blog.belongsTo('user');\n\n// get the identifier of the reference\nif (userRef.remoteType() === "id") {\n   let id = userRef.id();\n }
\n
\n
\n \n", + "name": "id", + "access": "public", + "tagname": "", + "return": { + "description": "The id of the record in this belongsTo relationship.", + "type": "String" + }, + "class": "BelongsToReference", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/references/belongs-to.ts", + "line": 179, + "description": "

The link Ember Data will use to fetch or reload this belongs-to\nrelationship. By default it uses only the "related" resource linkage.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n
// models/blog.js\nimport Model, { belongsTo } from '@ember-data/model';\nexport default Model.extend({\n   user: belongsTo('user', { async: true, inverse: null })\n });\n\nlet blog = store.push({\n   data: {\n     type: 'blog',\n     id: 1,\n     relationships: {\n       user: {\n         links: {\n           related: '/articles/1/author'\n         }\n       }\n     }\n   }\n });\nlet userRef = blog.belongsTo('user');\n\n// get the identifier of the reference\nif (userRef.remoteType() === "link") {\n   let link = userRef.link();\n }
\n
\n
\n \n", + "itemtype": "method", + "name": "link", + "access": "public", + "tagname": "", + "return": { + "description": "The link Ember Data will use to fetch or reload this belongs-to relationship.", + "type": "String" + }, + "class": "BelongsToReference", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/references/belongs-to.ts", + "line": 229, + "description": "

any links that have been received for this relationship

\n", + "itemtype": "method", + "name": "links", + "access": "public", + "tagname": "", + "return": { + "description": "" + }, + "class": "BelongsToReference", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/references/belongs-to.ts", + "line": 242, + "description": "

The meta data for the belongs-to relationship.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n
// models/blog.js\nimport Model, { belongsTo } from '@ember-data/model';\nexport default Model.extend({\n   user: belongsTo('user', { async: true, inverse: null })\n });\n\nlet blog = store.push({\n   data: {\n     type: 'blog',\n     id: 1,\n     relationships: {\n       user: {\n         links: {\n           related: {\n             href: '/articles/1/author'\n           },\n         },\n         meta: {\n           lastUpdated: 1458014400000\n         }\n       }\n     }\n   }\n });\n\nlet userRef = blog.belongsTo('user');\n\nuserRef.meta() // { lastUpdated: 1458014400000 }
\n
\n
\n \n", + "itemtype": "method", + "name": "meta", + "access": "public", + "tagname": "", + "return": { + "description": "The meta information for the belongs-to relationship.", + "type": "Object" + }, + "class": "BelongsToReference", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/references/belongs-to.ts", + "line": 297, + "itemtype": "method", + "description": "

This returns a string that represents how the reference will be\nlooked up when it is loaded. If the relationship has a link it will\nuse the "link" otherwise it defaults to "id".

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/models/post.js
1\n2\n3\n4\n5\n
import Model, { hasMany } from '@ember-data/model';\n\nexport default class PostModel extends Model {\n  @hasmany('comment', { async: true, inverse: null }) comments;\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
let post = store.push({\n  data: {\n    type: 'post',\n    id: 1,\n    relationships: {\n      comments: {\n        data: [{ type: 'comment', id: 1 }]\n      }\n    }\n  }\n});\n\nlet commentsRef = post.hasMany('comments');\n\n// get the identifier of the reference\nif (commentsRef.remoteType() === "ids") {\n  let ids = commentsRef.ids();\n} else if (commentsRef.remoteType() === "link") {\n  let link = commentsRef.link();\n}
\n
\n
\n \n", + "name": "remoteType", + "access": "public", + "tagname": "", + "return": { + "description": "The name of the remote type. This should either be `link` or `id`", + "type": "String" + }, + "class": "BelongsToReference", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/references/belongs-to.ts", + "line": 347, + "itemtype": "method", + "description": "

push can be used to update the data in the relationship and Ember\nData will treat the new data as the canonical value of this\nrelationship on the backend.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/models/blog.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n
import Model, { belongsTo } from '@ember-data/model';\n\nexport default class BlogModel extends Model {\n  @belongsto('user', { async: true, inverse: null }) user;\n }\n\nlet blog = store.push({\n   data: {\n     type: 'blog',\n     id: 1,\n     relationships: {\n       user: {\n         data: { type: 'user', id: 1 }\n       }\n     }\n   }\n });\nlet userRef = blog.belongsTo('user');\n\n// provide data for reference\nuserRef.push({\n   data: {\n     type: 'user',\n     id: 1,\n     attributes: {\n       username: "@user"\n     }\n   }\n }).then(function(user) {\n   userRef.value() === user;\n });
\n
\n
\n \n", + "name": "push", + "access": "public", + "tagname": "", + "params": [ + { + "name": "object", + "description": "a JSONAPI document object describing the new value of this relationship.", + "type": "Object" + } + ], + "return": { + "description": "A promise that resolves with the new value in this belongs-to relationship.", + "type": "Promise" + }, + "class": "BelongsToReference", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/references/belongs-to.ts", + "line": 420, + "itemtype": "method", + "description": "

value() synchronously returns the current value of the belongs-to\nrelationship. Unlike record.relationshipName, calling\nvalue() on a reference does not trigger a fetch if the async\nrelationship is not yet loaded. If the relationship is not loaded\nit will always return null.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n
// models/blog.js\nimport Model, { belongsTo } from '@ember-data/model';\n\nexport default class BlogModel extends Model {\n  @belongsto('user', { async: true, inverse: null }) user;\n}\n\nlet blog = store.push({\n   data: {\n     type: 'blog',\n     id: 1,\n     relationships: {\n       user: {\n         data: { type: 'user', id: 1 }\n       }\n     }\n   }\n });\nlet userRef = blog.belongsTo('user');\n\nuserRef.value(); // null\n\n// provide data for reference\nuserRef.push({\n   data: {\n     type: 'user',\n     id: 1,\n     attributes: {\n       username: "@user"\n     }\n   }\n }).then(function(user) {\n   userRef.value(); // user\n });
\n
\n
\n \n", + "name": "value", + "access": "public", + "tagname": "", + "return": { + "description": "the record in this relationship", + "type": "Model" + }, + "class": "BelongsToReference", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/references/belongs-to.ts", + "line": 475, + "itemtype": "method", + "description": "

Loads a record in a belongs-to relationship if it is not already\nloaded. If the relationship is already loaded this method does not\ntrigger a new load.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n
// models/blog.js\nimport Model, { belongsTo } from '@ember-data/model';\n\nexport default class BlogModel extends Model {\n  @belongsto('user', { async: true, inverse: null }) user;\n}\n\nlet blog = store.push({\n   data: {\n     type: 'blog',\n     id: 1,\n     relationships: {\n       user: {\n         data: { type: 'user', id: 1 }\n       }\n     }\n   }\n });\nlet userRef = blog.belongsTo('user');\n\nuserRef.value(); // null\n\nuserRef.load().then(function(user) {\n   userRef.value() === user\n });
\n
\n
\n \n

You may also pass in an options object whose properties will be\nfed forward. This enables you to pass adapterOptions into the\nrequest given to the adapter via the reference.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
userRef.load({ adapterOptions: { isPrivate: true } }).then(function(user) {\n  userRef.value() === user;\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/user.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Adapter from '@ember-data/adapter';\n\nexport default class UserAdapter extends Adapter {\n  findRecord(store, type, id, snapshot) {\n    // In the adapter you will have access to adapterOptions.\n    let adapterOptions = snapshot.adapterOptions;\n  }\n});
\n
\n
\n \n", + "name": "load", + "access": "public", + "tagname": "", + "params": [ + { + "name": "options", + "description": "the options to pass in.", + "type": "Object" + } + ], + "return": { + "description": "a promise that resolves with the record in this belongs-to relationship.", + "type": "Promise" + }, + "class": "BelongsToReference", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/references/belongs-to.ts", + "line": 548, + "itemtype": "method", + "description": "

Triggers a reload of the value in this relationship. If the\nremoteType is "link" Ember Data will use the relationship link to\nreload the relationship. Otherwise it will reload the record by its\nid.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n
// models/blog.js\nimport Model, { belongsTo } from '@ember-data/model';\n\nexport default class BlogModel extends Model {\n  @belongsto('user', { async: true, inverse: null }) user;\n}\n\nlet blog = store.push({\n   data: {\n     type: 'blog',\n     id: 1,\n     relationships: {\n       user: {\n         data: { type: 'user', id: 1 }\n       }\n     }\n   }\n });\nlet userRef = blog.belongsTo('user');\n\nuserRef.reload().then(function(user) {\n   userRef.value() === user\n });
\n
\n
\n \n

You may also pass in an options object whose properties will be\nfed forward. This enables you to pass adapterOptions into the\nrequest given to the adapter via the reference. A full example\ncan be found in the load method.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
userRef.reload({ adapterOptions: { isPrivate: true } })
\n
\n
\n \n", + "name": "reload", + "access": "public", + "tagname": "", + "params": [ + { + "name": "options", + "description": "the options to pass in.", + "type": "Object" + } + ], + "return": { + "description": "a promise that resolves with the record in this belongs-to relationship after the reload has completed.", + "type": "Promise" + }, + "class": "BelongsToReference", + "module": "@ember-data/model" + } + ], + "events": [], + "properties": [ + { + "file": "../packages/model/src/-private/references/belongs-to.ts", + "line": 102, + "description": "

The identifier of the record that this reference refers to.\nnull if no related record is known.

\n", + "itemtype": "property", + "name": "identifier", + "type": "StableRecordIdentifier | null", + "access": "public", + "tagname": "", + "class": "BelongsToReference", + "module": "@ember-data/model" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/model", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-BooleanTransform.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-BooleanTransform.json new file mode 100644 index 000000000..a4606db82 --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-BooleanTransform.json @@ -0,0 +1,45 @@ +{ + "data": { + "id": "ember-data-5.3.0-BooleanTransform", + "type": "class", + "attributes": { + "name": "BooleanTransform", + "shortname": "BooleanTransform", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/serializer", + "namespace": "", + "file": "../serializer/src/-private/transforms/boolean.js", + "line": 5, + "access": "public", + "description": "

The BooleanTransform class is used to serialize and deserialize\nboolean attributes on Ember Data record objects. This transform is\nused when boolean is passed as the type parameter to the\nattr function.

\n

Usage

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/models/user.js
1\n2\n3\n4\n5\n
import Model, { attr } from '@ember-data/model';\n\nexport default class UserModel extends Model {\n  @attr('boolean', { allowNull: true }) wantsWeeklyEmail;\n}
\n
\n
\n \n", + "tagname": "", + "methods": [], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/serializer", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-BuildURLMixin.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-BuildURLMixin.json new file mode 100644 index 000000000..2cf342264 --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-BuildURLMixin.json @@ -0,0 +1,464 @@ +{ + "data": { + "id": "ember-data-5.3.0-BuildURLMixin", + "type": "class", + "attributes": { + "name": "BuildURLMixin", + "shortname": "BuildURLMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "RESTAdapter" + ], + "module": "@ember-data/adapter", + "namespace": "", + "file": "../adapter/src/-private/build-url-mixin.ts", + "line": 119, + "description": "

Using BuildURLMixin

\n

To use URL building, include the mixin when extending an adapter, and call buildURL where needed.\nThe default behaviour is designed for RESTAdapter.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import Adapter, { BuildURLMixin } from '@ember-data/adapter';\n\nexport default class ApplicationAdapter extends Adapter.extend(BuildURLMixin) {\n  findRecord(store, type, id, snapshot) {\n    var url = this.buildURL(type.modelName, id, snapshot, 'findRecord');\n    return this.ajax(url, 'GET');\n  }\n}
\n
\n
\n \n

Attributes

\n

The host and namespace attributes will be used if defined, and are optional.

\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "../packages/adapter/src/-private/build-url-mixin.ts", + "line": 145, + "description": "

Builds a URL for a given type and optional ID.

\n

By default, it pluralizes the type's name (for example, 'post'\nbecomes 'posts' and 'person' becomes 'people'). To override the\npluralization see pathForType.

\n

If an ID is specified, it adds the ID to the path generated\nfor the type, separated by a /.

\n

When called by RESTAdapter.findMany() the id and snapshot parameters\nwill be arrays of ids and snapshots.

\n", + "itemtype": "method", + "name": "buildURL", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelName", + "description": "", + "type": "String" + }, + { + "name": "id", + "description": "single id or array of ids or query", + "type": "(String|Array|Object)" + }, + { + "name": "snapshot", + "description": "single snapshot or array of snapshots", + "type": "(Snapshot|SnapshotRecordArray)" + }, + { + "name": "requestType", + "description": "", + "type": "String" + }, + { + "name": "query", + "description": "object of query parameters to send for query requests.", + "type": "Object" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "BuildURLMixin", + "module": "@ember-data/adapter" + }, + { + "file": "../packages/adapter/src/-private/build-url-mixin.ts", + "line": 294, + "itemtype": "method", + "name": "_buildURL", + "access": "private", + "tagname": "", + "params": [ + { + "name": "modelName", + "description": "", + "type": "String" + }, + { + "name": "id", + "description": "", + "type": "String" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "BuildURLMixin", + "module": "@ember-data/adapter" + }, + { + "file": "../packages/adapter/src/-private/build-url-mixin.ts", + "line": 329, + "description": "

Builds a URL for a store.findRecord(type, id) call.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/user.js
1\n2\n3\n4\n5\n6\n7\n8\n
import JSONAPIAdapter from '@ember-data/adapter/json-api';\n\nexport default class ApplicationAdapter extends JSONAPIAdapter {\n  urlForFindRecord(id, modelName, snapshot) {\n    let baseUrl = this.buildURL(modelName, id, snapshot);\n    return `${baseUrl}/users/${snapshot.adapterOptions.user_id}/playlists/${id}`;\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "urlForFindRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "id", + "description": "", + "type": "String" + }, + { + "name": "modelName", + "description": "", + "type": "String" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "BuildURLMixin", + "module": "@ember-data/adapter" + }, + { + "file": "../packages/adapter/src/-private/build-url-mixin.ts", + "line": 357, + "description": "

Builds a URL for a store.findAll(type) call.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/comment.js
1\n2\n3\n4\n5\n6\n7\n8\n
import JSONAPIAdapter from '@ember-data/adapter/json-api';\n\nexport default class ApplicationAdapter extends JSONAPIAdapter {\n  urlForFindAll(modelName, snapshot) {\n    let baseUrl = this.buildURL(modelName);\n    return `${baseUrl}/data/comments.json`;\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "urlForFindAll", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelName", + "description": "", + "type": "String" + }, + { + "name": "snapshot", + "description": "", + "type": "SnapshotRecordArray" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "BuildURLMixin", + "module": "@ember-data/adapter" + }, + { + "file": "../packages/adapter/src/-private/build-url-mixin.ts", + "line": 383, + "description": "

Builds a URL for a store.query(type, query) call.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import RESTAdapter from '@ember-data/adapter/rest';\n\nexport default class ApplicationAdapter extends RESTAdapter {\n  host = 'https://api.github.com';\n  urlForQuery (query, modelName) {\n    switch(modelName) {\n      case 'repo':\n        return `https://api.github.com/orgs/${query.orgId}/repos`;\n      default:\n        return super.urlForQuery(...arguments);\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "urlForQuery", + "access": "public", + "tagname": "", + "params": [ + { + "name": "query", + "description": "", + "type": "Object" + }, + { + "name": "modelName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "BuildURLMixin", + "module": "@ember-data/adapter" + }, + { + "file": "../packages/adapter/src/-private/build-url-mixin.ts", + "line": 414, + "description": "

Builds a URL for a store.queryRecord(type, query) call.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n
import RESTAdapter from '@ember-data/adapter/rest';\n\nexport default class ApplicationAdapter extends RESTAdapter {\n  urlForQueryRecord({ slug }, modelName) {\n    let baseUrl = this.buildURL();\n    return `${baseUrl}/${encodeURIComponent(slug)}`;\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "urlForQueryRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "query", + "description": "", + "type": "Object" + }, + { + "name": "modelName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "BuildURLMixin", + "module": "@ember-data/adapter" + }, + { + "file": "../packages/adapter/src/-private/build-url-mixin.ts", + "line": 440, + "description": "

Builds a URL for coalescing multiple store.findRecord(type, id)\nrecords into 1 request when the adapter's coalesceFindRequests\nproperty is true.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n
import RESTAdapter from '@ember-data/adapter/rest';\n\nexport default class ApplicationAdapter extends RESTAdapter {\n  urlForFindMany(ids, modelName) {\n    let baseUrl = this.buildURL();\n    return `${baseUrl}/coalesce`;\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "urlForFindMany", + "access": "public", + "tagname": "", + "params": [ + { + "name": "ids", + "description": "", + "type": "Array" + }, + { + "name": "modelName", + "description": "", + "type": "String" + }, + { + "name": "snapshots", + "description": "", + "type": "Array" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "BuildURLMixin", + "module": "@ember-data/adapter" + }, + { + "file": "../packages/adapter/src/-private/build-url-mixin.ts", + "line": 469, + "description": "

Builds a URL for fetching an async hasMany relationship when a URL\nis not provided by the server.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n
import JSONAPIAdapter from '@ember-data/adapter/json-api';\n\nexport default class ApplicationAdapter extends JSONAPIAdapter {\n  urlForFindHasMany(id, modelName, snapshot) {\n    let baseUrl = this.buildURL(modelName, id);\n    return `${baseUrl}/relationships`;\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "urlForFindHasMany", + "access": "public", + "tagname": "", + "params": [ + { + "name": "id", + "description": "", + "type": "String" + }, + { + "name": "modelName", + "description": "", + "type": "String" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "BuildURLMixin", + "module": "@ember-data/adapter" + }, + { + "file": "../packages/adapter/src/-private/build-url-mixin.ts", + "line": 497, + "description": "

Builds a URL for fetching an async belongsTo relationship when a url\nis not provided by the server.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n
import JSONAPIAdapter from '@ember-data/adapter/json-api';\n\nexport default class ApplicationAdapter extends JSONAPIAdapter {\n  urlForFindBelongsTo(id, modelName, snapshot) {\n    let baseUrl = this.buildURL(modelName, id);\n    return `${baseUrl}/relationships`;\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "urlForFindBelongsTo", + "access": "public", + "tagname": "", + "params": [ + { + "name": "id", + "description": "", + "type": "String" + }, + { + "name": "modelName", + "description": "", + "type": "String" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "BuildURLMixin", + "module": "@ember-data/adapter" + }, + { + "file": "../packages/adapter/src/-private/build-url-mixin.ts", + "line": 525, + "description": "

Builds a URL for a record.save() call when the record was created\nlocally using store.createRecord().

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n
import RESTAdapter from '@ember-data/adapter/rest';\n\nexport default class ApplicationAdapter extends RESTAdapter {\n  urlForCreateRecord(modelName, snapshot) {\n    return super.urlForCreateRecord(...arguments) + '/new';\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "urlForCreateRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelName", + "description": "", + "type": "String" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "BuildURLMixin", + "module": "@ember-data/adapter" + }, + { + "file": "../packages/adapter/src/-private/build-url-mixin.ts", + "line": 551, + "description": "

Builds a URL for a record.save() call when the record has been updated locally.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n
import RESTAdapter from '@ember-data/adapter/rest';\n\nexport default class ApplicationAdapter extends RESTAdapter {\n  urlForUpdateRecord(id, modelName, snapshot) {\n    return `/${id}/feed?access_token=${snapshot.adapterOptions.token}`;\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "urlForUpdateRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "id", + "description": "", + "type": "String" + }, + { + "name": "modelName", + "description": "", + "type": "String" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "BuildURLMixin", + "module": "@ember-data/adapter" + }, + { + "file": "../packages/adapter/src/-private/build-url-mixin.ts", + "line": 577, + "description": "

Builds a URL for a record.save() call when the record has been deleted locally.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n
import RESTAdapter from '@ember-data/adapter/rest';\n\nexport default class ApplicationAdapter extends RESTAdapter {\n  urlForDeleteRecord(id, modelName, snapshot) {\n    return super.urlForDeleteRecord(...arguments) + '/destroy';\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "urlForDeleteRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "id", + "description": "", + "type": "String" + }, + { + "name": "modelName", + "description": "", + "type": "String" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "BuildURLMixin", + "module": "@ember-data/adapter" + }, + { + "file": "../packages/adapter/src/-private/build-url-mixin.ts", + "line": 603, + "itemtype": "method", + "name": "urlPrefix", + "access": "private", + "tagname": "", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + }, + { + "name": "parentURL", + "description": "", + "type": "String" + } + ], + "return": { + "description": "urlPrefix", + "type": "String" + }, + "class": "BuildURLMixin", + "module": "@ember-data/adapter" + }, + { + "file": "../packages/adapter/src/-private/build-url-mixin.ts", + "line": 643, + "description": "

Determines the pathname for a given type.

\n

By default, it pluralizes the type's name (for example,\n'post' becomes 'posts' and 'person' becomes 'people').

\n

Pathname customization

\n

For example, if you have an object LineItem with an\nendpoint of /line_items/.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import RESTAdapter from '@ember-data/adapter/rest';\nimport { decamelize, pluralize } from '<app-name>/utils/string-utils';\n\nexport default class ApplicationAdapter extends RESTAdapter {\n  pathForType(modelName) {\n    var decamelized = decamelize(modelName);\n    return pluralize(decamelized);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "pathForType", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "path", + "type": "String" + }, + "class": "BuildURLMixin", + "module": "@ember-data/adapter" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/adapter", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-Cache.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-Cache.json new file mode 100644 index 000000000..af337f54d --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-Cache.json @@ -0,0 +1,694 @@ +{ + "data": { + "id": "ember-data-5.3.0-Cache", + "type": "class", + "attributes": { + "name": "Cache", + "shortname": "Cache", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/json-api", + "namespace": "", + "file": "../json-api/src/-private/cache.ts", + "line": 84, + "description": "

A JSON:API Cache implementation.

\n

What cache the store uses is configurable. Using a different\nimplementation can be achieved by implementing the store's\ncreateCache hook.

\n

This is the cache implementation used by ember-data.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import Cache from '@ember-data/json-api';\nimport Store from '@ember-data/store';\n\nexport default class extends Store {\n  createCache(wrapper) {\n    return new Cache(wrapper);\n  }\n}
\n
\n
\n \n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 135, + "description": "

Cache the response to a request

\n

Implements Cache.put.

\n

Expects a StructuredDocument whose content member is a JsonApiDocument.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
cache.put({\n  request: { url: 'https://api.example.com/v1/user/1' },\n  content: {\n    data: {\n      type: 'user',\n      id: '1',\n      attributes: {\n        name: 'Chris'\n      }\n    }\n  }\n})
\n
\n
\n \n
\n

Note: The nested content and data members are not a mistake. This is because\nthere are two separate concepts involved here, the StructuredDocument which contains\nthe context of a given Request that has been issued with the returned contents as its\ncontent property, and a JSON:API Document which is the json contents returned by\nthis endpoint and which uses its data property to signify which resources are the\nprimary resources associated with the request.

\n
\n

StructuredDocument's with urls will be cached as full documents with\nassociated resource membership order and contents preserved but linked\ninto the cache.

\n", + "itemtype": "method", + "name": "put", + "params": [ + { + "name": "doc", + "description": "", + "type": "StructuredDocument" + } + ], + "return": { + "description": "", + "type": "ResourceDocument" + }, + "access": "public", + "tagname": "", + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 319, + "description": "

Update the "remote" or "canonical" (persisted) state of the Cache\nby merging new information into the existing state.

\n

Note: currently the only valid resource operation is a MergeOperation\nwhich occurs when a collision of identifiers is detected.

\n", + "itemtype": "method", + "name": "patch", + "access": "public", + "tagname": "", + "params": [ + { + "name": "op", + "description": "the operation to perform", + "type": "Operation" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 352, + "description": "

Update the "local" or "current" (unpersisted) state of the Cache

\n", + "itemtype": "method", + "name": "mutate", + "params": [ + { + "name": "mutation", + "description": "", + "type": "Mutation" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "access": "public", + "tagname": "", + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 374, + "description": "

Peek resource data from the Cache.

\n

In development, if the return value\nis JSON the return value\nwill be deep-cloned and deep-frozen\nto prevent mutation thereby enforcing cache\nImmutability.

\n

This form of peek is useful for implementations\nthat want to feed raw-data from cache to the UI\nor which want to interact with a blob of data\ndirectly from the presentation cache.

\n

An implementation might want to do this because\nde-referencing records which read from their own\nblob is generally safer because the record does\nnot require retainining connections to the Store\nand Cache to present data on a per-field basis.

\n

This generally takes the place of getAttr as\nan API and may even take the place of getRelationship\ndepending on implementation specifics, though this\nlatter usage is less recommended due to the advantages\nof the Graph handling necessary entanglements and\nnotifications for relational data.

\n", + "itemtype": "method", + "name": "peek", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "", + "type": "StableRecordIdentifier | StableDocumentIdentifier" + } + ], + "return": { + "description": "the known resource data", + "type": "ResourceDocument | ResourceBlob | null" + }, + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 448, + "description": "

Peek the Cache for the existing request data associated with\na cacheable request

\n", + "itemtype": "method", + "name": "peekRequest", + "params": [ + { + "name": "UNKNOWN", + "description": "", + "type": "StableDocumentIdentifier" + } + ], + "return": { + "description": "", + "type": "StableDocumentIdentifier | null" + }, + "access": "public", + "tagname": "", + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 461, + "description": "

Push resource data from a remote source into the cache for this identifier

\n", + "itemtype": "method", + "name": "upsert", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "data", + "description": "" + }, + { + "name": "hasRecord", + "description": "" + } + ], + "return": { + "description": "if `hasRecord` is true then calculated key changes should be returned", + "type": "Void | string[]" + }, + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 549, + "description": "

Merge a fork back into a parent Cache.

\n

Applications should typically not call this method themselves,\npreferring instead to merge at the Store level, which will\nutilize this method to merge the caches.

\n", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "cache", + "description": "", + "type": "Cache" + } + ], + "access": "public", + "tagname": "", + "return": { + "description": "Promise" + }, + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 565, + "description": "

Generate the list of changes applied to all\nrecord in the store.

\n

Each individual resource or document that has\nbeen mutated should be described as an individual\nChange entry in the returned array.

\n

A Change is described by an object containing up to\nthree properties: (1) the identifier of the entity that\nchanged; (2) the op code of that change being one of\nupsert or remove, and if the op is upsert a patch\ncontaining the data to merge into the cache for the given\nentity.

\n

This patch is opaque to the Store but should be understood\nby the Cache and may expect to be utilized by an Adapter\nwhen generating data during a save operation.

\n

It is generally recommended that the patch contain only\nthe updated state, ignoring fields that are unchanged

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
interface Change {\n identifier: StableRecordIdentifier | StableDocumentIdentifier;\n op: 'upsert' | 'remove';\n patch?: unknown;\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "diff", + "access": "public", + "tagname": "", + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 605, + "description": "

Serialize the entire contents of the Cache into a Stream\nwhich may be fed back into a new instance of the same Cache\nvia cache.hydrate.

\n", + "itemtype": "method", + "name": "dump", + "return": { + "description": "", + "type": "Promise" + }, + "access": "public", + "tagname": "", + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 618, + "description": "

hydrate a Cache from a Stream with content previously serialized\nfrom another instance of the same Cache, resolving when hydration\nis complete.

\n

This method should expect to be called both in the context of restoring\nthe Cache during application rehydration after SSR AND at unknown\ntimes during the lifetime of an already booted application when it is\ndesired to bulk-load additional information into the cache. This latter\nbehavior supports optimizing pre/fetching of data for route transitions\nvia data-only SSR modes.

\n", + "itemtype": "method", + "name": "hydrate", + "params": [ + { + "name": "stream", + "description": "", + "type": "ReadableStream" + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "access": "public", + "tagname": "", + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 642, + "description": "

[LIFECYCLE] Signal to the cache that a new record has been instantiated on the client

\n

It returns properties from options that should be set on the record during the create\nprocess. This return value behavior is deprecated.

\n", + "itemtype": "method", + "name": "clientDidCreate", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "createArgs", + "description": "" + } + ], + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 729, + "description": "

[LIFECYCLE] Signals to the cache that a resource\nwill be part of a save transaction.

\n", + "itemtype": "method", + "name": "willCommit", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 761, + "description": "

[LIFECYCLE] Signals to the cache that a resource\nwas successfully updated as part of a save transaction.

\n", + "itemtype": "method", + "name": "didCommit", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "data", + "description": "" + } + ], + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 900, + "description": "

[LIFECYCLE] Signals to the cache that a resource\nwas update via a save transaction failed.

\n", + "itemtype": "method", + "name": "commitWasRejected", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "errors", + "description": "" + } + ], + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 929, + "description": "

[LIFECYCLE] Signals to the cache that all data for a resource\nshould be cleared.

\n

This method is a candidate to become a mutation

\n", + "itemtype": "method", + "name": "unloadRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 1012, + "description": "

Retrieve the data for an attribute from the cache

\n", + "itemtype": "method", + "name": "getAttr", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "field", + "description": "" + } + ], + "return": { + "description": "", + "type": "Unknown" + }, + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 1035, + "description": "

Mutate the data for an attribute in the cache

\n

This method is a candidate to become a mutation

\n", + "itemtype": "method", + "name": "setAttr", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "field", + "description": "" + }, + { + "name": "value", + "description": "" + } + ], + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 1067, + "description": "

Query the cache for the changed attributes of a resource.

\n", + "itemtype": "method", + "name": "changedAttrs", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "return": { + "description": "{ : [, ] }", + "type": "ChangedAttributesHash" + }, + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 1080, + "description": "

Query the cache for whether any mutated attributes exist

\n", + "itemtype": "method", + "name": "hasChangedAttrs", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 1097, + "description": "

Tell the cache to discard any uncommitted mutations to attributes

\n

This method is a candidate to become a mutation

\n", + "itemtype": "method", + "name": "rollbackAttrs", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "return": { + "description": "the names of fields that were restored", + "type": "String[]" + }, + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 1141, + "description": "

Query the cache for the changes to relationships of a resource.

\n

Returns a map of relationship names to RelationshipDiff objects.

\n

ts\ntype RelationshipDiff =\n | {\n kind: 'collection';\n remoteState: StableRecordIdentifier[];\n additions: Set<StableRecordIdentifier>;\n removals: Set<StableRecordIdentifier>;\n localState: StableRecordIdentifier[];\n reordered: boolean;\n }\n | {\n kind: 'resource';\n remoteState: StableRecordIdentifier | null;\n localState: StableRecordIdentifier | null;\n };

\n", + "itemtype": "method", + "name": "changedRelationships", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "", + "type": "StableRecordIdentifier" + } + ], + "return": { + "description": "", + "type": "Map" + }, + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 1172, + "description": "

Query the cache for whether any mutated attributes exist

\n", + "itemtype": "method", + "name": "hasChangedRelationships", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "", + "type": "StableRecordIdentifier" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 1184, + "description": "

Tell the cache to discard any uncommitted mutations to relationships.

\n

This will also discard the change on any appropriate inverses.

\n

This method is a candidate to become a mutation

\n", + "itemtype": "method", + "name": "rollbackRelationships", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "", + "type": "StableRecordIdentifier" + } + ], + "return": { + "description": "the names of relationships that were restored", + "type": "String[]" + }, + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 1205, + "description": "

Query the cache for the current state of a relationship property

\n", + "itemtype": "method", + "name": "getRelationship", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "field", + "description": "" + } + ], + "return": { + "description": "resource relationship object" + }, + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 1224, + "description": "

Update the cache state for the given resource to be marked\nas locally deleted, or remove such a mark.

\n

This method is a candidate to become a mutation

\n", + "itemtype": "method", + "name": "setIsDeleted", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "isDeleted", + "description": "", + "type": "Boolean" + } + ], + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 1242, + "description": "

Query the cache for any validation errors applicable to the given resource.

\n", + "itemtype": "method", + "name": "getErrors", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "return": { + "description": "", + "type": "JsonApiError[]" + }, + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 1254, + "description": "

Query the cache for whether a given resource has any available data

\n", + "itemtype": "method", + "name": "isEmpty", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 1267, + "description": "

Query the cache for whether a given resource was created locally and not\nyet persisted.

\n", + "itemtype": "method", + "name": "isNew", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 1281, + "description": "

Query the cache for whether a given resource is marked as deleted (but not\nnecessarily persisted yet).

\n", + "itemtype": "method", + "name": "isDeleted", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 1295, + "description": "

Query the cache for whether a given resource has been deleted and that deletion\nhas also been persisted.

\n", + "itemtype": "method", + "name": "isDeletionCommitted", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "Cache", + "module": "@ember-data/json-api" + } + ], + "events": [], + "properties": [ + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 109, + "description": "

The Cache Version that this implementation implements.

\n", + "type": "{'2'}", + "access": "public", + "tagname": "", + "itemtype": "property", + "name": "version", + "class": "Cache", + "module": "@ember-data/json-api" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/json-api", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-CacheCapabilitiesManager.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-CacheCapabilitiesManager.json new file mode 100644 index 000000000..3d252b5cf --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-CacheCapabilitiesManager.json @@ -0,0 +1,160 @@ +{ + "data": { + "id": "ember-data-5.3.0-CacheCapabilitiesManager", + "type": "class", + "attributes": { + "name": "CacheCapabilitiesManager", + "shortname": "CacheCapabilitiesManager", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/store", + "namespace": "", + "file": "../../ember-data-types/q/cache-store-wrapper.ts", + "line": 12, + "description": "

CacheCapabilitiesManager provides encapsulated API access to the minimal\nsubset of the Store's functionality that Cache implementations\nshould interact with. It is provided to the Store's createRecordDataFor\nand createCache hooks.

\n

Cache implementations should not need more than this API provides.

\n

This class cannot be directly instantiated.

\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "../ember-data-types/q/cache-store-wrapper.ts", + "line": 38, + "description": "

Provides access to the SchemaDefinitionService instance\nfor this Store instance.

\n

The SchemaDefinitionService can be used to query for\ninformation about the schema of a resource.

\n", + "itemtype": "method", + "name": "getSchemaDefinitionService", + "access": "public", + "tagname": "", + "class": "CacheCapabilitiesManager", + "module": "@ember-data/store" + }, + { + "file": "../ember-data-types/q/cache-store-wrapper.ts", + "line": 50, + "description": "

Update the id for the record corresponding to the identifier\nThis operation can only be done for records whose id is null.

\n", + "itemtype": "method", + "name": "setRecordId", + "params": [ + { + "name": "identifier;", + "description": "", + "type": "StableRecordIdentifier" + }, + { + "name": "id;", + "description": "", + "type": "String" + } + ], + "access": "public", + "tagname": "", + "class": "CacheCapabilitiesManager", + "module": "@ember-data/store" + }, + { + "file": "../ember-data-types/q/cache-store-wrapper.ts", + "line": 61, + "description": "

Signal to the store that the specified record may be considered fully\nremoved from the cache. Generally this means that not only does no\ndata exist for the identified resource, no known relationships still\npoint to it either.

\n", + "itemtype": "method", + "name": "disconnectRecord", + "params": [ + { + "name": "identifier", + "description": "", + "type": "StableRecordIdentifier" + } + ], + "access": "public", + "tagname": "", + "class": "CacheCapabilitiesManager", + "module": "@ember-data/store" + }, + { + "file": "../ember-data-types/q/cache-store-wrapper.ts", + "line": 73, + "description": "

Use this method to determine if the Store has an instantiated record associated\nwith an identifier.

\n", + "itemtype": "method", + "name": "hasRecord", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "CacheCapabilitiesManager", + "module": "@ember-data/store" + }, + { + "file": "../ember-data-types/q/cache-store-wrapper.ts", + "line": 84, + "description": "

Notify subscribers of the NotificationManager that cache state has changed.

\n

attributes and relationships do not require a key, but if one is specified it\nis assumed to be the name of the attribute or relationship that has been updated.

\n

No other namespaces currently expect the key argument.

\n", + "itemtype": "method", + "name": "notifyChange", + "params": [ + { + "name": "identifier", + "description": "", + "type": "StableRecordIdentifier" + }, + { + "name": "namespace", + "description": "", + "type": "'attributes' | 'relationships' | 'identity' | 'errors' | 'meta' | 'state'" + }, + { + "name": "key", + "description": "", + "type": "String|undefined" + } + ], + "access": "public", + "tagname": "", + "class": "CacheCapabilitiesManager", + "module": "@ember-data/store" + } + ], + "events": [], + "properties": [ + { + "file": "../ember-data-types/q/cache-store-wrapper.ts", + "line": 26, + "description": "

Provides access to the IdentifierCache instance\nfor this Store instance.

\n

The IdentifierCache can be used to peek, generate or\nretrieve a stable unique identifier for any resource.

\n", + "itemtype": "property", + "name": "identifierCache", + "type": "IdentifierCache", + "access": "public", + "tagname": "", + "class": "CacheCapabilitiesManager", + "module": "@ember-data/store" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/store", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-CacheManager.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-CacheManager.json new file mode 100644 index 000000000..9962b90fc --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-CacheManager.json @@ -0,0 +1,685 @@ +{ + "data": { + "id": "ember-data-5.3.0-CacheManager", + "type": "class", + "attributes": { + "name": "CacheManager", + "shortname": "CacheManager", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/store", + "namespace": "", + "file": "../store/src/-private/managers/cache-manager.ts", + "line": 21, + "description": "

The CacheManager wraps a Cache enforcing that only\nthe public API surface area is exposed.

\n

Hence, it is the value of Store.cache, wrapping\nthe cache instance returned by Store.createCache.

\n

It handles translating between cache versions when\nnecessary, for instance when a Store is configured\nto use both a v1 and a v2 cache depending on some\nheuristic.

\n

Starting with the v2 spec, the cache is designed such\nthat it must be implemented as a singleton.

\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 51, + "description": "

Cache the response to a request

\n

Unlike store.push which has UPSERT\nsemantics, put has replace semantics similar to\nthe http method PUT

\n

the individually cacheabl\ne resource data it may contain\nshould upsert, but the document data surrounding it should\nfully replace any existing information

\n

Note that in order to support inserting arbitrary data\nto the cache that did not originate from a request put\nshould expect to sometimes encounter a document with only\na content member and therefor must not assume the existence\nof request and response on the document.

\n", + "itemtype": "method", + "name": "put", + "params": [ + { + "name": "doc", + "description": "", + "type": "StructuredDocument" + } + ], + "return": { + "description": "", + "type": "ResourceDocument" + }, + "access": "public", + "tagname": "", + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 78, + "description": "

Perform an operation on the cache to update the remote state.

\n

Note: currently the only valid operation is a MergeOperation\nwhich occurs when a collision of identifiers is detected.

\n", + "itemtype": "method", + "name": "patch", + "access": "public", + "tagname": "", + "params": [ + { + "name": "op", + "description": "the operation to perform" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 93, + "description": "

Update resource data with a local mutation. Currently supports operations\non relationships only.

\n", + "itemtype": "method", + "name": "mutate", + "access": "public", + "tagname": "", + "params": [ + { + "name": "mutation", + "description": "" + } + ], + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 105, + "description": "

Peek resource data from the Cache.

\n

In development, if the return value\nis JSON the return value\nwill be deep-cloned and deep-frozen\nto prevent mutation thereby enforcing cache\nImmutability.

\n

This form of peek is useful for implementations\nthat want to feed raw-data from cache to the UI\nor which want to interact with a blob of data\ndirectly from the presentation cache.

\n

An implementation might want to do this because\nde-referencing records which read from their own\nblob is generally safer because the record does\nnot require retainining connections to the Store\nand Cache to present data on a per-field basis.

\n

This generally takes the place of getAttr as\nan API and may even take the place of getRelationship\ndepending on implementation specifics, though this\nlatter usage is less recommended due to the advantages\nof the Graph handling necessary entanglements and\nnotifications for relational data.

\n", + "itemtype": "method", + "name": "peek", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "", + "type": "StableRecordIdentifier | StableDocumentIdentifier" + } + ], + "return": { + "description": "the known resource data", + "type": "ResourceDocument | ResourceBlob | null" + }, + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 143, + "description": "

Peek the Cache for the existing request data associated with\na cacheable request

\n", + "itemtype": "method", + "name": "peekRequest", + "params": [ + { + "name": "UNKNOWN", + "description": "", + "type": "StableDocumentIdentifier" + } + ], + "return": { + "description": "", + "type": "StableDocumentIdentifier | null" + }, + "access": "public", + "tagname": "", + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 156, + "description": "

Push resource data from a remote source into the cache for this identifier

\n", + "itemtype": "method", + "name": "upsert", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "data", + "description": "" + }, + { + "name": "hasRecord", + "description": "" + } + ], + "return": { + "description": "if `hasRecord` is true then calculated key changes should be returned", + "type": "Void | string[]" + }, + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 173, + "description": "

Create a fork of the cache from the current state.

\n

Applications should typically not call this method themselves,\npreferring instead to fork at the Store level, which will\nutilize this method to fork the cache.

\n", + "itemtype": "method", + "name": "fork", + "access": "public", + "tagname": "", + "return": { + "description": "Promise" + }, + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 188, + "description": "

Merge a fork back into a parent Cache.

\n

Applications should typically not call this method themselves,\npreferring instead to merge at the Store level, which will\nutilize this method to merge the caches.

\n", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "cache", + "description": "", + "type": "Cache" + } + ], + "access": "public", + "tagname": "", + "return": { + "description": "Promise" + }, + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 204, + "description": "

Generate the list of changes applied to all\nrecord in the store.

\n

Each individual resource or document that has\nbeen mutated should be described as an individual\nChange entry in the returned array.

\n

A Change is described by an object containing up to\nthree properties: (1) the identifier of the entity that\nchanged; (2) the op code of that change being one of\nupsert or remove, and if the op is upsert a patch\ncontaining the data to merge into the cache for the given\nentity.

\n

This patch is opaque to the Store but should be understood\nby the Cache and may expect to be utilized by an Adapter\nwhen generating data during a save operation.

\n

It is generally recommended that the patch contain only\nthe updated state, ignoring fields that are unchanged

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
interface Change {\n identifier: StableRecordIdentifier | StableDocumentIdentifier;\n op: 'upsert' | 'remove';\n patch?: unknown;\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "diff", + "access": "public", + "tagname": "", + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 244, + "description": "

Serialize the entire contents of the Cache into a Stream\nwhich may be fed back into a new instance of the same Cache\nvia cache.hydrate.

\n", + "itemtype": "method", + "name": "dump", + "return": { + "description": "", + "type": "Promise" + }, + "access": "public", + "tagname": "", + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 257, + "description": "

hydrate a Cache from a Stream with content previously serialized\nfrom another instance of the same Cache, resolving when hydration\nis complete.

\n

This method should expect to be called both in the context of restoring\nthe Cache during application rehydration after SSR AND at unknown\ntimes during the lifetime of an already booted application when it is\ndesired to bulk-load additional information into the cache. This latter\nbehavior supports optimizing pre/fetching of data for route transitions\nvia data-only SSR modes.

\n", + "itemtype": "method", + "name": "hydrate", + "params": [ + { + "name": "stream", + "description": "", + "type": "ReadableStream" + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "access": "public", + "tagname": "", + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 284, + "description": "

[LIFECYLCE] Signal to the cache that a new record has been instantiated on the client

\n

It returns properties from options that should be set on the record during the create\nprocess. This return value behavior is deprecated.

\n", + "itemtype": "method", + "name": "clientDidCreate", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 299, + "description": "

[LIFECYCLE] Signals to the cache that a resource\nwill be part of a save transaction.

\n", + "itemtype": "method", + "name": "willCommit", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 311, + "description": "

[LIFECYCLE] Signals to the cache that a resource\nwas successfully updated as part of a save transaction.

\n", + "itemtype": "method", + "name": "didCommit", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "data", + "description": "" + } + ], + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 324, + "description": "

[LIFECYCLE] Signals to the cache that a resource\nwas update via a save transaction failed.

\n", + "itemtype": "method", + "name": "commitWasRejected", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "errors", + "description": "" + } + ], + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 337, + "description": "

[LIFECYCLE] Signals to the cache that all data for a resource\nshould be cleared.

\n", + "itemtype": "method", + "name": "unloadRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 352, + "description": "

Retrieve the data for an attribute from the cache

\n", + "itemtype": "method", + "name": "getAttr", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "propertyName", + "description": "" + } + ], + "return": { + "description": "", + "type": "Unknown" + }, + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 365, + "description": "

Mutate the data for an attribute in the cache

\n", + "itemtype": "method", + "name": "setAttr", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "propertyName", + "description": "" + }, + { + "name": "value", + "description": "" + } + ], + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 378, + "description": "

Query the cache for the changed attributes of a resource.

\n", + "itemtype": "method", + "name": "changedAttrs", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "return": { + "description": "" + }, + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 390, + "description": "

Query the cache for whether any mutated attributes exist

\n", + "itemtype": "method", + "name": "hasChangedAttrs", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 402, + "description": "

Tell the cache to discard any uncommitted mutations to attributes

\n", + "itemtype": "method", + "name": "rollbackAttrs", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "return": { + "description": "the names of attributes that were restored" + }, + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 417, + "description": "

Query the cache for the changes to relationships of a resource.

\n

Returns a map of relationship names to RelationshipDiff objects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
type RelationshipDiff =\n | {\n     kind: 'collection';\n     remoteState: StableRecordIdentifier[];\n     additions: Set<StableRecordIdentifier>;\n     removals: Set<StableRecordIdentifier>;\n     localState: StableRecordIdentifier[];\n     reordered: boolean;\n   }\n | {\n     kind: 'resource';\n     remoteState: StableRecordIdentifier | null;\n     localState: StableRecordIdentifier | null;\n   };
\n
\n
\n \n", + "itemtype": "method", + "name": "changedRelationships", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "", + "type": "StableRecordIdentifier" + } + ], + "return": { + "description": "", + "type": "Map" + }, + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 448, + "description": "

Query the cache for whether any mutated attributes exist

\n", + "itemtype": "method", + "name": "hasChangedRelationships", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "", + "type": "StableRecordIdentifier" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 460, + "description": "

Tell the cache to discard any uncommitted mutations to relationships.

\n

This will also discard the change on any appropriate inverses.

\n

This method is a candidate to become a mutation

\n", + "itemtype": "method", + "name": "rollbackRelationships", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "", + "type": "StableRecordIdentifier" + } + ], + "return": { + "description": "the names of relationships that were restored", + "type": "String[]" + }, + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 476, + "description": "

Query the cache for the current state of a relationship property

\n", + "itemtype": "method", + "name": "getRelationship", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "propertyName", + "description": "" + } + ], + "return": { + "description": "resource relationship object" + }, + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 495, + "description": "

Update the cache state for the given resource to be marked as locally deleted,\nor remove such a mark.

\n", + "itemtype": "method", + "name": "setIsDeleted", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "isDeleted", + "description": "" + } + ], + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 508, + "description": "

Query the cache for any validation errors applicable to the given resource.

\n", + "itemtype": "method", + "name": "getErrors", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "return": { + "description": "" + }, + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 520, + "description": "

Query the cache for whether a given resource has any available data

\n", + "itemtype": "method", + "name": "isEmpty", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 532, + "description": "

Query the cache for whether a given resource was created locally and not\nyet persisted.

\n", + "itemtype": "method", + "name": "isNew", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 545, + "description": "

Query the cache for whether a given resource is marked as deleted (but not\nnecessarily persisted yet).

\n", + "itemtype": "method", + "name": "isDeleted", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 558, + "description": "

Query the cache for whether a given resource has been deleted and that deletion\nhas also been persisted.

\n", + "itemtype": "method", + "name": "isDeletionCommitted", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "CacheManager", + "module": "@ember-data/store" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/store", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-CanaryFeatureFlags.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-CanaryFeatureFlags.json new file mode 100644 index 000000000..82ace0f81 --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-CanaryFeatureFlags.json @@ -0,0 +1,45 @@ +{ + "data": { + "id": "ember-data-5.3.0-CanaryFeatureFlags", + "type": "class", + "attributes": { + "name": "CanaryFeatureFlags", + "shortname": "CanaryFeatureFlags", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/canary-features", + "namespace": "", + "file": "../private-build-infra/virtual-packages/canary-features.js", + "line": 76, + "description": "

This is the current list of features used at build time for canary releases.\nIf empty there are no features currently gated by feature flags.

\n

The valid values are:

\n
    \n
  • true | The feature is enabled at all times, and cannot be disabled.
  • \n
  • false | The feature is disabled at all times, and cannot be enabled.
  • \n
  • null | The feature is disabled by default, but can be enabled via configuration.
  • \n
\n", + "access": "public", + "tagname": "", + "methods": [], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/canary-features", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-ConflictError.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-ConflictError.json new file mode 100644 index 000000000..df6a9dc87 --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-ConflictError.json @@ -0,0 +1,49 @@ +{ + "data": { + "id": "ember-data-5.3.0-ConflictError", + "type": "class", + "attributes": { + "name": "ConflictError", + "shortname": "ConflictError", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/adapter/error", + "namespace": "", + "file": "../adapter/src/error.js", + "line": 318, + "description": "

A ConflictError equates to a HTTP 409 Conflict response status.\nIt is used by an adapter to indicate that the request could not be processed\nbecause of a conflict in the request. An example scenario would be when\ncreating a record with a client-generated ID but that ID is already known\nto the external API.

\n", + "access": "public", + "tagname": "", + "extends": "AdapterError", + "methods": [], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-data-5.3.0-AdapterError", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/adapter/error", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-CurrentDeprecations.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-CurrentDeprecations.json new file mode 100644 index 000000000..8c2bd39d6 --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-CurrentDeprecations.json @@ -0,0 +1,124 @@ +{ + "data": { + "id": "ember-data-5.3.0-CurrentDeprecations", + "type": "class", + "attributes": { + "name": "CurrentDeprecations", + "shortname": "CurrentDeprecations", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/deprecations", + "namespace": "", + "file": "../private-build-infra/virtual-packages/deprecations.js", + "line": 79, + "description": "

The following list represents deprecations currently active.

\n

Some deprecation flags guard multiple deprecation IDs. All\nassociated IDs are listed.

\n", + "access": "public", + "tagname": "", + "methods": [], + "events": [], + "properties": [ + { + "file": "../packages/private-build-infra/virtual-packages/deprecations.js", + "line": 91, + "description": "

id: ember-data:deprecate-non-strict-types

\n

Currently, EmberData expects that the type property associated with\na resource follows several conventions.

\n
    \n
  • The type property must be a non-empty string
  • \n
  • The type property must be singular
  • \n
  • The type property must be dasherized
  • \n
\n

We are deprecating support for types that do not match this pattern\nin order to unlock future improvements in which we can support type\nbeing any string of your choosing.

\n

The goal is that in the future, you will be able to use any string\nso long as it matches what your configured cache, identifier generation,\nand schemas expect.

\n

E.G. It will matter not that your string is in a specific format like\nsingular, dasherized, etc. so long as everywhere you refer to the type\nyou use the same string.

\n

If using @ember-data/model, there will always be a restriction that the\ntype must match the path on disk where the model is defined.

\n

e.g. app/models/foo/bar-bem.js must have a type of foo/bar-bem

\n", + "itemtype": "property", + "name": "DEPRECATE_NON_STRICT_TYPES", + "since": "5.3", + "until": "6.0", + "access": "public", + "tagname": "", + "class": "CurrentDeprecations", + "module": "@ember-data/deprecations" + }, + { + "file": "../packages/private-build-infra/virtual-packages/deprecations.js", + "line": 125, + "description": "

id: ember-data:deprecate-non-strict-id

\n

Currently, EmberData expects that the id property associated with\na resource is a string.

\n

However, for legacy support in many locations we would accept a number\nwhich would then immediately be coerced into a string.

\n

We are deprecating this legacy support for numeric IDs.

\n

The goal is that in the future, you will be able to use any ID format\nso long as everywhere you refer to the ID you use the same format.

\n

However, for identifiers we will always use string IDs and so any\ncustom identifier configuration should provide a string ID.

\n", + "itemtype": "property", + "name": "DEPRECATE_NON_STRICT_ID", + "since": "5.3", + "until": "6.0", + "access": "public", + "tagname": "", + "class": "CurrentDeprecations", + "module": "@ember-data/deprecations" + }, + { + "file": "../packages/private-build-infra/virtual-packages/deprecations.js", + "line": 149, + "description": "

id:

\n

This is a planned deprecation which will trigger when observer or computed\nchains are used to watch for changes on any EmberData RecordArray, ManyArray\nor PromiseManyArray.

\n

Support for these chains is currently guarded by the deprecation flag\nlisted here, enabling removal of the behavior if desired.

\n", + "itemtype": "property", + "name": "DEPRECATE_COMPUTED_CHAINS", + "since": "5.0", + "until": "6.0", + "access": "public", + "tagname": "", + "class": "CurrentDeprecations", + "module": "@ember-data/deprecations" + }, + { + "file": "../packages/private-build-infra/virtual-packages/deprecations.js", + "line": 166, + "description": "

id: ember-data:deprecate-legacy-imports

\n

Deprecates when importing from ember-data/* instead of @ember-data/*\nin order to prepare for the eventual removal of the legacy ember-data/*

\n

All imports from ember-data/* should be updated to @ember-data/*\nexcept for ember-data/store. When you are using ember-data (as opposed to\ninstalling the indivudal packages) you should import from ember-data/store\ninstead of @ember-data/store in order to receive the appropriate configuration\nof defaults.

\n", + "itemtype": "property", + "name": "DEPRECATE_LEGACY_IMPORTS", + "since": "5.3", + "until": "6.0", + "access": "public", + "tagname": "", + "class": "CurrentDeprecations", + "module": "@ember-data/deprecations" + }, + { + "file": "../packages/private-build-infra/virtual-packages/deprecations.js", + "line": 185, + "description": "

id: ember-data:deprecate-non-unique-collection-payloads

\n

Deprecates when the data for a hasMany relationship contains\nduplicate identifiers.

\n

Previously, relationships would silently de-dupe the data\nwhen received, but this behavior is being removed in favor\nof erroring if the same related record is included multiple\ntimes.

\n

For instance, in JSON:API the below relationship data would\nbe considered invalid:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
{\n "data": {\n  "type": "article",\n   "id": "1",\n   "relationships": {\n     "comments": {\n       "data": [\n         { "type": "comment", "id": "1" },\n         { "type": "comment", "id": "2" },\n         { "type": "comment", "id": "1" } // duplicate\n       ]\n    }\n }\n}
\n
\n
\n \n

To resolve this deprecation, either update your server to\nnot include duplicate data, or implement normalization logic\nin either a request handler or serializer which removes\nduplicate data from relationship payloads.

\n", + "itemtype": "property", + "name": "DEPRECATE_NON_UNIQUE_PAYLOADS", + "since": "5.3", + "until": "6.0", + "access": "public", + "tagname": "", + "class": "CurrentDeprecations", + "module": "@ember-data/deprecations" + }, + { + "file": "../packages/private-build-infra/virtual-packages/deprecations.js", + "line": 228, + "itemtype": "property", + "description": "

id: ember-data:deprecate-relationship-remote-update-clearing-local-state

\n

Deprecates when a relationship is updated remotely and the local state\nis cleared of all changes except for "new" records.

\n

Instead, any records not present in the new payload will be considered\n"removed" while any records present in the new payload will be considered "added".

\n

This allows us to "commit" local additions and removals, preserving any additions\nor removals that are not yet reflected in the remote state.

\n

For instance, given the following initial state:

\n

remote: A, B, C\nlocal: add D, E\n remove B, C\n=> A, D, E

\n

If after an update, the remote state is now A, B, D, F then the new state will be

\n

remote: A, B, D, F\nlocal: add E\n remove B\n=> A, D, E, F

\n

Under the old behavior the updated local state would instead have been\n=> A, B, D, F

\n

Similarly, if a belongsTo remote State was A while its local state was B,\nthen under the old behavior if the remote state changed to C, the local state\nwould be updated to C. Under the new behavior, the local state would remain B.

\n

If the remote state was A while its local state was null, then under the old\nbehavior if the remote state changed to C, the local state would be updated to C.\nUnder the new behavior, the local state would remain null.

\n

Thus the new correct mental model is that the state of the relationship at any point\nin time is whatever the most recent remote state is, plus any local additions or removals\nyou have made that have not yet been reflected by the remote state.

\n
\n

Note: The old behavior extended to modifying the inverse of a relationship. So if\nyou had local state not reflected in the new remote state, inverses would be notified\nand their state reverted as well when "resetting" the relationship.\nUnder the new behavior, since the local state is preserved the inverses will also\nnot be reverted.

\n
\n

Resolving this deprecation

\n

Resolving this deprecation can be done individually for each relationship\nor globally for all relationships.

\n

To resolve it globally, set the DEPRECATE_RELATIONSHIP_REMOTE_UPDATE_CLEARING_LOCAL_STATE\nto false in ember-cli-build.js

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
let app = new EmberApp(defaults, {\n  emberData: {\n    deprecations: {\n       // set to false to strip the deprecated code (thereby opting into the new behavior)\n      DEPRECATE_RELATIONSHIP_REMOTE_UPDATE_CLEARING_LOCAL_STATE: false\n    }\n  }\n})
\n
\n
\n \n

To resolve this deprecation on an individual relationship, adjust the options passed to\nthe relationship. For relationships with inverses, both sides MUST be migrated to the new\nbehavior at the same time.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
class Person extends Model {\n  @hasmany('person', {\n   async: false,\n   inverse: null,\n   resetOnRemoteUpdate: false\n }) children;\n  @belongsto('person', {\n   async: false,\n   inverse: null,\n   resetOnRemoteUpdate: false\n }) parent;\n}
\n
\n
\n \n
\n

Note: false is the only valid value here, all other values (including missing)\nwill be treated as true, where true is the legacy behavior that is now deprecated.

\n
\n

Once you have migrated all relationships, you can remove the the resetOnRemoteUpdate\noption and set the deprecation flag to false in ember-cli-build.

\n

What if I don't want the new behavior?

\n

EmberData's philosophy is to not make assumptions about your application. Where possible\nwe seek out "100%" solutions – solutions that work for all use cases - and where that is\nnot possible we default to "90%" solutions – solutions that work for the vast majority of use\ncases. In the case of "90%" solutions we look for primitives that allow you to resolve the\n10% case in your application. If no such primitives exist, we provide an escape hatch that\nensures you can build the behavior you need without adopting the cost of the default solution.

\n

In this case, the old behavior was a "40%" solution. The inability for an application developer\nto determine what changes were made locally, and thus what changes should be preserved, made\nit impossible to build certain features easily, or in some cases at all. The proliferation of\nfeature requests, bug reports (from folks surprised by the prior behavior) and addon attempts\nin this space are all evidence of this.

\n

We believe the new behavior is a "90%" solution. It works for the vast majority of use cases,\noften without noticeable changes to existing application behavior, and provides primitives that\nallow you to build the behavior you need for the remaining 10%.

\n

The great news is that this behavior defaults to trusting your API similar to the old behavior.\nIf your API is correct, you will not need to make any changes to your application to adopt\nthe new behavior.

\n

This means the 10% cases are those where you can't trust your API to provide the correct\ninformation. In these cases, because you now have cheap access to a diff of the relationship\nstate, there are a few options that weren't available before:

\n
    \n
  • you can adjust returned API payloads to contain the expected changes that it doesn't include
  • \n
  • you can modify local state by adding or removing records on the HasMany record array to remove\nany local changes that were not returned by the API.
  • \n
  • you can use <Cache>.mutate(mutation) to directly modify the local cache state of the relationship\nto match the expected state.
  • \n
\n

What this version (5.3) does not yet provide is a way to directly modify the cache's remote state\nfor the relationship via public APIs other than via the broader action of upserting a response via\n<Cache>.put(document). However, such an API was sketched in the Cache 2.1 RFC\n<Cache>.patch(operation) and is likely to be added in a future 5.x release of EmberData.

\n

This version (5.3) also does not yet provide a way to directly modify the graph (a general purpose\nsubset of cache behaviors specific to relationships) via public APIs. However, during the\n5.x release series we will be working on finalizing the Graph API and making it public.

\n

If none of these options work for you, you can always opt-out more broadly by implementing\na custom Cache with the relationship behaviors you need.

\n", + "name": "DEPRECATE_RELATIONSHIP_REMOTE_UPDATE_CLEARING_LOCAL_STATE", + "since": "5.3", + "until": "6.0", + "access": "public", + "tagname": "", + "class": "CurrentDeprecations", + "module": "@ember-data/deprecations" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/deprecations", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-DateTransform.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-DateTransform.json new file mode 100644 index 000000000..e5bafe857 --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-DateTransform.json @@ -0,0 +1,45 @@ +{ + "data": { + "id": "ember-data-5.3.0-DateTransform", + "type": "class", + "attributes": { + "name": "DateTransform", + "shortname": "DateTransform", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/serializer", + "namespace": "", + "file": "../serializer/src/-private/transforms/date.js", + "line": 5, + "access": "public", + "description": "

The DateTransform class is used to serialize and deserialize\ndate attributes on Ember Data record objects. This transform is used\nwhen date is passed as the type parameter to the\nattr function. It uses the ISO 8601\nstandard.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/models/score.js
1\n2\n3\n4\n5\n
import Model, { attr, belongsTo } from '@ember-data/model';\n\nexport default class ScoreModel extends Model {\n  @attr('date') date;\n }
\n
\n
\n \n

@belongsto('player') player;

\n", + "tagname": "", + "methods": [], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/serializer", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-DebugLogging.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-DebugLogging.json new file mode 100644 index 000000000..f45c5f040 --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-DebugLogging.json @@ -0,0 +1,154 @@ +{ + "data": { + "id": "ember-data-5.3.0-DebugLogging", + "type": "class", + "attributes": { + "name": "DebugLogging", + "shortname": "DebugLogging", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/debug", + "namespace": "", + "file": "../private-build-infra/virtual-packages/debugging.js", + "line": 4, + "description": "

Many portions of the internals are helpfully instrumented with logging that can be activated\nat build time. This instrumentation is always removed from production builds or any builds\nthat has not explicitly activated it. To activate it set the appropriate flag to true.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
  let app = new EmberApp(defaults, {\n    emberData: {\n      debug: {\n          LOG_PAYLOADS: false, // data store received to update cache with\n          LOG_OPERATIONS: false, // updates to cache remote state\n          LOG_MUTATIONS: false, // updates to cache local state\n          LOG_NOTIFICATIONS: false,\n          LOG_REQUESTS: false,\n          LOG_REQUEST_STATUS: false,\n          LOG_IDENTIFIERS: false,\n          LOG_GRAPH: false,\n          LOG_INSTANCE_CACHE: false,\n      }\n    }\n  });
\n
\n
\n \n", + "access": "public", + "tagname": "", + "methods": [], + "events": [], + "properties": [ + { + "file": "../packages/private-build-infra/virtual-packages/debugging.js", + "line": 31, + "description": "

log payloads received by the store\nvia push or returned from a delete/update/create\noperation.

\n", + "itemtype": "property", + "name": "LOG_PAYLOADS", + "type": "Boolean", + "access": "public", + "tagname": "", + "class": "DebugLogging", + "module": "@ember-data/debug" + }, + { + "file": "../packages/private-build-infra/virtual-packages/debugging.js", + "line": 40, + "description": "

log remote-state updates to the cache

\n", + "itemtype": "property", + "name": "LOG_OPERATIONS", + "type": "Boolean", + "access": "public", + "tagname": "", + "class": "DebugLogging", + "module": "@ember-data/debug" + }, + { + "file": "../packages/private-build-infra/virtual-packages/debugging.js", + "line": 47, + "description": "

log local-state updates to the cache

\n", + "itemtype": "property", + "name": "LOG_MUTATIONS", + "type": "Boolean", + "access": "public", + "tagname": "", + "class": "DebugLogging", + "module": "@ember-data/debug" + }, + { + "file": "../packages/private-build-infra/virtual-packages/debugging.js", + "line": 54, + "description": "

log notifications received by the NotificationManager

\n", + "itemtype": "property", + "name": "LOG_NOTIFICATIONS", + "type": "Boolean", + "access": "public", + "tagname": "", + "class": "DebugLogging", + "module": "@ember-data/debug" + }, + { + "file": "../packages/private-build-infra/virtual-packages/debugging.js", + "line": 61, + "description": "

log requests issued by the RequestManager

\n", + "itemtype": "property", + "name": "LOG_REQUESTS", + "type": "Boolean", + "access": "public", + "tagname": "", + "class": "DebugLogging", + "module": "@ember-data/debug" + }, + { + "file": "../packages/private-build-infra/virtual-packages/debugging.js", + "line": 68, + "description": "

log updates to requests the store has issued to\nthe network (adapter) to fulfill.

\n", + "itemtype": "property", + "name": "LOG_REQUEST_STATUS", + "type": "Boolean", + "access": "public", + "tagname": "", + "class": "DebugLogging", + "module": "@ember-data/debug" + }, + { + "file": "../packages/private-build-infra/virtual-packages/debugging.js", + "line": 76, + "description": "

log peek, generation and updates to\nRecord Identifiers.

\n", + "itemtype": "property", + "name": "LOG_IDENTIFIERS", + "type": "Boolean", + "access": "public", + "tagname": "", + "class": "DebugLogging", + "module": "@ember-data/debug" + }, + { + "file": "../packages/private-build-infra/virtual-packages/debugging.js", + "line": 84, + "description": "

log updates received by the graph (relationship pointer storage)

\n", + "itemtype": "property", + "name": "LOG_GRAPH", + "type": "Boolean", + "access": "public", + "tagname": "", + "class": "DebugLogging", + "module": "@ember-data/debug" + }, + { + "file": "../packages/private-build-infra/virtual-packages/debugging.js", + "line": 91, + "description": "

log creation/removal of RecordData and Record\ninstances.

\n", + "itemtype": "property", + "name": "LOG_INSTANCE_CACHE", + "type": "Boolean", + "access": "public", + "tagname": "", + "class": "DebugLogging", + "module": "@ember-data/debug" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/debug", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-EmbeddedRecordsMixin.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-EmbeddedRecordsMixin.json new file mode 100644 index 000000000..b742dd709 --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-EmbeddedRecordsMixin.json @@ -0,0 +1,207 @@ +{ + "data": { + "id": "ember-data-5.3.0-EmbeddedRecordsMixin", + "type": "class", + "attributes": { + "name": "EmbeddedRecordsMixin", + "shortname": "EmbeddedRecordsMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/serializer/rest", + "namespace": "", + "file": "../serializer/src/-private/embedded-records-mixin.js", + "line": 10, + "description": "

Using Embedded Records

\n

EmbeddedRecordsMixin supports serializing embedded records.

\n

To set up embedded records, include the mixin when extending a serializer,\nthen define and configure embedded (model) relationships.

\n

Note that embedded records will serialize with the serializer for their model instead of the serializer in which they are defined.

\n

Note also that this mixin does not work with JSONAPISerializer because the JSON:API specification does not describe how to format embedded resources.

\n

Below is an example of a per-type serializer (post type).

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/post.js
1\n2\n3\n4\n5\n6\n7\n8\n
import RESTSerializer, { EmbeddedRecordsMixin } from '@ember-data/serializer/rest';\n\nexport default class PostSerializer extends RESTSerializer.extend(EmbeddedRecordsMixin) {\n  attrs = {\n    author: { embedded: 'always' },\n    comments: { serialize: 'ids' }\n  }\n}
\n
\n
\n \n

Note that this use of { embedded: 'always' } is unrelated to\nthe { embedded: 'always' } that is defined as an option on attr as part of\ndefining a model while working with the ActiveModelSerializer. Nevertheless,\nusing { embedded: 'always' } as an option to attr is not a valid way to set up\nembedded records.

\n

The attrs option for a resource { embedded: 'always' } is shorthand for:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
{\n  serialize: 'records',\n  deserialize: 'records'\n}
\n
\n
\n \n

Configuring Attrs

\n

A resource's attrs option may be set to use ids, records or false for the\nserialize and deserialize settings.

\n

The attrs property can be set on the ApplicationSerializer or a per-type\nserializer.

\n

In the case where embedded JSON is expected while extracting a payload (reading)\nthe setting is deserialize: 'records', there is no need to use ids when\nextracting as that is the default behaviour without this mixin if you are using\nthe vanilla EmbeddedRecordsMixin. Likewise, to embed JSON in the payload while\nserializing serialize: 'records' is the setting to use. There is an option of\nnot embedding JSON in the serialized payload by using serialize: 'ids'. If you\ndo not want the relationship sent at all, you can use serialize: false.

\n

EmbeddedRecordsMixin defaults

\n

If you do not overwrite attrs for a specific relationship, the EmbeddedRecordsMixin\nwill behave in the following way:

\n

BelongsTo: { serialize: 'id', deserialize: 'id' }\nHasMany: { serialize: false, deserialize: 'ids' }

\n

Model Relationships

\n

Embedded records must have a model defined to be extracted and serialized. Note that\nwhen defining any relationships on your model such as belongsTo and hasMany, you\nshould not both specify async: true and also indicate through the serializer's\nattrs attribute that the related model should be embedded for deserialization.\nIf a model is declared embedded for deserialization (embedded: 'always' or deserialize: 'records'),\nthen do not use async: true.

\n

To successfully extract and serialize embedded records the model relationships\nmust be set up correctly. See the\ndefining relationships\nsection of the Defining Models guide page.

\n

Records without an id property are not considered embedded records, model\ninstances must have an id property to be used with Ember Data.

\n

Example JSON payloads, Models and Serializers

\n

When customizing a serializer it is important to grok what the customizations\nare. Please read the docs for the methods this mixin provides, in case you need\nto modify it to fit your specific needs.

\n

For example, review the docs for each method of this mixin:

\n\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "../packages/serializer/src/-private/embedded-records-mixin.js", + "line": 105, + "description": "

Normalize the record and recursively normalize/extract all the embedded records\nwhile pushing them into the store as they are encountered

\n

A payload with an attr configured for embedded records needs to be extracted:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
{\n  "post": {\n    "id": "1"\n    "title": "Rails is omakase",\n    "comments": [{\n      "id": "1",\n      "body": "Rails is unagi"\n    }, {\n      "id": "2",\n      "body": "Omakase O_o"\n    }]\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "normalize", + "access": "public", + "tagname": "", + "params": [ + { + "name": "typeClass", + "description": "", + "type": "Model" + }, + { + "name": "hash", + "description": "to be normalized", + "type": "Object" + }, + { + "name": "prop", + "description": "the hash has been referenced by", + "type": "String" + } + ], + "return": { + "description": "the normalized hash", + "type": "Object" + }, + "class": "EmbeddedRecordsMixin", + "module": "@ember-data/serializer/rest" + }, + { + "file": "../packages/serializer/src/-private/embedded-records-mixin.js", + "line": 149, + "description": "

Serialize belongsTo relationship when it is configured as an embedded object.

\n

This example of an author model belongs to a post model:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Model, { attr, belongsTo } from '@ember-data/model';\n\nPost = Model.extend({\n  title:    attr('string'),\n  body:     attr('string'),\n  author:   belongsTo('author')\n});\n\nAuthor = Model.extend({\n  name:     attr('string'),\n  post:     belongsTo('post')\n});
\n
\n
\n \n

Use a custom (type) serializer for the post model to configure embedded author

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/post.js
1\n2\n3\n4\n5\n6\n7\n
import RESTSerializer, { EmbeddedRecordsMixin } from '@ember-data/serializer/rest';\n\nexport default class PostSerializer extends RESTSerializer.extend(EmbeddedRecordsMixin) {\n  attrs = {\n    author: { embedded: 'always' }\n  }\n}
\n
\n
\n \n

A payload with an attribute configured for embedded records can serialize\nthe records together under the root attribute's payload:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
{\n  "post": {\n    "id": "1"\n    "title": "Rails is omakase",\n    "author": {\n      "id": "2"\n      "name": "dhh"\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "serializeBelongsTo", + "access": "public", + "tagname": "", + "params": [ + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "json", + "description": "", + "type": "Object" + }, + { + "name": "relationship", + "description": "", + "type": "Object" + } + ], + "class": "EmbeddedRecordsMixin", + "module": "@ember-data/serializer/rest" + }, + { + "file": "../packages/serializer/src/-private/embedded-records-mixin.js", + "line": 253, + "description": "

Serializes hasMany relationships when it is configured as embedded objects.

\n

This example of a post model has many comments:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Model, { attr, belongsTo, hasMany } from '@ember-data/model';\n\nPost = Model.extend({\n  title:    attr('string'),\n  body:     attr('string'),\n  comments: hasMany('comment')\n});\n\nComment = Model.extend({\n  body:     attr('string'),\n  post:     belongsTo('post')\n});
\n
\n
\n \n

Use a custom (type) serializer for the post model to configure embedded comments

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/post.js
1\n2\n3\n4\n5\n6\n7\n
import RESTSerializer, { EmbeddedRecordsMixin } from '@ember-data/serializer/rest';\n\nexport default class PostSerializer extends RESTSerializer.extend(EmbeddedRecordsMixin) {\n  attrs = {\n    comments: { embedded: 'always' }\n  }\n}
\n
\n
\n \n

A payload with an attribute configured for embedded records can serialize\nthe records together under the root attribute's payload:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
{\n  "post": {\n    "id": "1"\n    "title": "Rails is omakase",\n    "body": "I want this for my ORM, I want that for my template language..."\n    "comments": [{\n      "id": "1",\n      "body": "Rails is unagi"\n    }, {\n      "id": "2",\n      "body": "Omakase O_o"\n    }]\n  }\n}
\n
\n
\n \n

The attrs options object can use more specific instruction for extracting and\nserializing. When serializing, an option to embed ids, ids-and-types or records can be set.\nWhen extracting the only option is records.

\n

So { embedded: 'always' } is shorthand for:\n{ serialize: 'records', deserialize: 'records' }

\n

To embed the ids for a related object (using a hasMany relationship):

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/post.js
1\n2\n3\n4\n5\n6\n7\n
import RESTSerializer, { EmbeddedRecordsMixin } from '@ember-data/serializer/rest';\n\nexport default class PostSerializer extends RESTSerializer.extend(EmbeddedRecordsMixin) {\n  attrs = {\n    comments: { serialize: 'ids', deserialize: 'records' }\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
{\n  "post": {\n    "id": "1"\n    "title": "Rails is omakase",\n    "body": "I want this for my ORM, I want that for my template language..."\n    "comments": ["1", "2"]\n  }\n}
\n
\n
\n \n

To embed the relationship as a collection of objects with id and type keys, set\nids-and-types for the related object.

\n

This is particularly useful for polymorphic relationships where records don't share\nthe same table and the id is not enough information.

\n

For example having a user that has many pets:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
User = Model.extend({\n  name: attr('string'),\n  pets: hasMany('pet', { polymorphic: true })\n});\n\nPet = Model.extend({\n  name: attr('string'),\n});\n\nCat = Pet.extend({\n  // ...\n});\n\nParrot = Pet.extend({\n  // ...\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/user.js
1\n2\n3\n4\n5\n6\n7\n
import RESTSerializer, { EmbeddedRecordsMixin } from '@ember-data/serializer/rest';\n\nexport default class UserSerializer extends RESTSerializer.extend(EmbeddedRecordsMixin) {\n  attrs = {\n    pets: { serialize: 'ids-and-types', deserialize: 'records' }\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
{\n  "user": {\n    "id": "1"\n    "name": "Bertin Osborne",\n    "pets": [\n      { "id": "1", "type": "Cat" },\n      { "id": "1", "type": "Parrot"}\n    ]\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "serializeHasMany", + "access": "public", + "tagname": "", + "params": [ + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "json", + "description": "", + "type": "Object" + }, + { + "name": "relationship", + "description": "", + "type": "Object" + } + ], + "class": "EmbeddedRecordsMixin", + "module": "@ember-data/serializer/rest" + }, + { + "file": "../packages/serializer/src/-private/embedded-records-mixin.js", + "line": 470, + "description": "

When serializing an embedded record, modify the property (in the JSON payload)\nthat refers to the parent record (foreign key for the relationship).

\n

Serializing a belongsTo relationship removes the property that refers to the\nparent record

\n

Serializing a hasMany relationship does not remove the property that refers to\nthe parent record.

\n", + "itemtype": "method", + "name": "removeEmbeddedForeignKey", + "access": "public", + "tagname": "", + "params": [ + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "embeddedSnapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "relationship", + "description": "", + "type": "Object" + }, + { + "name": "json", + "description": "", + "type": "Object" + } + ], + "class": "EmbeddedRecordsMixin", + "module": "@ember-data/serializer/rest" + }, + { + "file": "../packages/serializer/src/-private/embedded-records-mixin.js", + "line": 549, + "itemtype": "method", + "name": "_extractEmbeddedRecords", + "access": "private", + "tagname": "", + "class": "EmbeddedRecordsMixin", + "module": "@ember-data/serializer/rest" + }, + { + "file": "../packages/serializer/src/-private/embedded-records-mixin.js", + "line": 567, + "itemtype": "method", + "name": "_extractEmbeddedHasMany", + "access": "private", + "tagname": "", + "class": "EmbeddedRecordsMixin", + "module": "@ember-data/serializer/rest" + }, + { + "file": "../packages/serializer/src/-private/embedded-records-mixin.js", + "line": 596, + "itemtype": "method", + "name": "_extractEmbeddedBelongsTo", + "access": "private", + "tagname": "", + "class": "EmbeddedRecordsMixin", + "module": "@ember-data/serializer/rest" + }, + { + "file": "../packages/serializer/src/-private/embedded-records-mixin.js", + "line": 619, + "itemtype": "method", + "name": "_normalizeEmbeddedRelationship", + "access": "private", + "tagname": "", + "class": "EmbeddedRecordsMixin", + "module": "@ember-data/serializer/rest" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/serializer/rest", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-Errors.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-Errors.json new file mode 100644 index 000000000..6da95b6ba --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-Errors.json @@ -0,0 +1,227 @@ +{ + "data": { + "id": "ember-data-5.3.0-Errors", + "type": "class", + "attributes": { + "name": "Errors", + "shortname": "Errors", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/model", + "namespace": "", + "file": "../model/src/-private/errors.ts", + "line": 29, + "access": "public", + "description": "

Holds validation errors for a given record, organized by attribute names.

\n

This class is not directly instantiable.

\n

Every Model has an errors property that is an instance of\nErrors. This can be used to display validation error\nmessages returned from the server when a record.save() rejects.

\n

For Example, if you had a User model that looked like this:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/models/user.js
1\n2\n3\n4\n5\n
import Model, { attr } from '@ember-data/model';\n\nexport default class UserModel extends Model {\n  @attr('string') email;\n}
\n
\n
\n \n

And you attempted to save a record that did not validate on the backend:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let user = store.createRecord('user', {\n  username: 'tomster',\n  email: 'invalidEmail'\n});\nuser.save();
\n
\n
\n \n

Your backend would be expected to return an error response that described\nthe problem, so that error messages can be generated on the app.

\n

API responses will be translated into instances of Errors differently,\ndepending on the specific combination of adapter and serializer used. You\nmay want to check the documentation or the source code of the libraries\nthat you are using, to know how they expect errors to be communicated.

\n

Errors can be displayed to the user by accessing their property name\nto get an array of all the error objects for that property. Each\nerror object is a JavaScript object with two keys:

\n
    \n
  • message A string containing the error message from the backend
  • \n
  • attribute The name of the property associated with this error message
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
<label>Username: <Input @value={{@model.username}} /> </label>\n{{#each @model.errors.username as |error|}}\n  <div class="error">\n    {{error.message}}\n  </div>\n{{/each}}\n\n<label>Email: <Input @value={{@model.email}} /> </label>\n{{#each @model.errors.email as |error|}}\n  <div class="error">\n    {{error.message}}\n  </div>\n{{/each}}
\n
\n
\n \n

You can also access the special messages property on the error\nobject to get an array of all the error strings.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
{{#each @model.errors.messages as |message|}}\n  <div class="error">\n    {{message}}\n  </div>\n{{/each}}
\n
\n
\n \n", + "tagname": "", + "extends": "Ember.ArrayProxy", + "methods": [ + { + "file": "../packages/model/src/-private/errors.ts", + "line": 116, + "description": "

Returns errors for a given attribute

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
let user = store.createRecord('user', {\n  username: 'tomster',\n  email: 'invalidEmail'\n});\nuser.save().catch(function(){\n  user.errors.errorsFor('email'); // returns:\n  // [{attribute: "email", message: "Doesn't look like a valid email."}]\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "errorsFor", + "access": "public", + "tagname": "", + "params": [ + { + "name": "attribute", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Array" + }, + "class": "Errors", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/errors.ts", + "line": 183, + "itemtype": "method", + "name": "unknownProperty", + "access": "private", + "tagname": "", + "class": "Errors", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/errors.ts", + "line": 215, + "description": "

Manually adds errors to the record. This will trigger the becameInvalid event/ lifecycle method on\n the record and transition the record into an invalid state.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n
 let errors = user.errors;\n\n // add multiple errors\n errors.add('password', [\n   'Must be at least 12 characters',\n   'Must contain at least one symbol',\n   'Cannot contain your name'\n ]);\n\n errors.errorsFor('password');\n // =>\n // [\n //   { attribute: 'password', message: 'Must be at least 12 characters' },\n //   { attribute: 'password', message: 'Must contain at least one symbol' },\n //   { attribute: 'password', message: 'Cannot contain your name' },\n // ]\n\n // add a single error\n errors.add('username', 'This field is required');\n\n errors.errorsFor('username');\n // =>\n // [\n //   { attribute: 'username', message: 'This field is required' },\n // ]
\n
\n
\n \n", + "itemtype": "method", + "name": "add", + "access": "public", + "tagname": "", + "params": [ + { + "name": "attribute", + "description": "- the property name of an attribute or relationship", + "type": "String" + }, + { + "name": "messages", + "description": "- an error message or array of error messages for the attribute", + "type": "String[]|string" + } + ], + "class": "Errors", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/errors.ts", + "line": 262, + "itemtype": "method", + "name": "_findOrCreateMessages", + "access": "private", + "tagname": "", + "class": "Errors", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/errors.ts", + "line": 287, + "description": "

Manually removes all errors for a given member from the record.\n This will transition the record into a valid state, and\n triggers the becameValid event and lifecycle method.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
 let errors = user.errors;\n errors.add('phone', ['error-1', 'error-2']);\n\n errors.errorsFor('phone');\n // =>\n // [\n //   { attribute: 'phone', message: 'error-1' },\n //   { attribute: 'phone', message: 'error-2' },\n // ]\n\n errors.remove('phone');\n\n errors.errorsFor('phone');\n // => undefined
\n
\n
\n \n", + "itemtype": "method", + "name": "remove", + "access": "public", + "tagname": "", + "params": [ + { + "name": "member", + "description": "- the property name of an attribute or relationship", + "type": "String" + } + ], + "class": "Errors", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/errors.ts", + "line": 338, + "description": "

Manually clears all errors for the record.\n This will transition the record into a valid state, and\n will trigger the becameValid event and lifecycle method.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n
let errors = user.errors;\nerrors.add('username', ['error-a']);\nerrors.add('phone', ['error-1', 'error-2']);\n\nerrors.errorsFor('username');\n// =>\n// [\n//   { attribute: 'username', message: 'error-a' },\n// ]\n\nerrors.errorsFor('phone');\n// =>\n// [\n//   { attribute: 'phone', message: 'error-1' },\n//   { attribute: 'phone', message: 'error-2' },\n// ]\n\nerrors.clear();\n\nerrors.errorsFor('username');\n// => undefined\n\nerrors.errorsFor('phone');\n// => undefined\n\nerrors.messages\n// => []
\n
\n
\n \n", + "itemtype": "method", + "name": "clear", + "access": "public", + "tagname": "", + "class": "Errors", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/errors.ts", + "line": 398, + "itemtype": "method", + "description": "

Checks if there are error messages for the given attribute.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/controllers/user/edit.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Controller from '@ember/controller';\nimport { action } from '@ember/object';\n\nexport default class UserEditController extends Controller {\n  @action save(user) {\n    if (user.errors.has('email')) {\n      return alert('Please update your email before attempting to save.');\n    }\n    user.save();\n  }\n}
\n
\n
\n \n", + "name": "has", + "access": "public", + "tagname": "", + "params": [ + { + "name": "attribute", + "description": "", + "type": "String" + } + ], + "return": { + "description": "true if there some errors on given attribute", + "type": "Boolean" + }, + "class": "Errors", + "module": "@ember-data/model" + } + ], + "events": [], + "properties": [ + { + "file": "../packages/model/src/-private/errors.ts", + "line": 106, + "itemtype": "property", + "name": "errorsByAttributeName", + "type": "{MapWithDefault}", + "access": "private", + "tagname": "", + "class": "Errors", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/errors.ts", + "line": 154, + "description": "

An array containing all of the error messages for this\nrecord. This is useful for displaying all errors to the user.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
{{#each @model.errors.messages as |message|}}\n  <div class="error">\n    {{message}}\n  </div>\n{{/each}}
\n
\n
\n \n", + "itemtype": "property", + "name": "messages", + "access": "public", + "tagname": "", + "type": "{Array}", + "class": "Errors", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/errors.ts", + "line": 173, + "itemtype": "property", + "name": "content", + "type": "{Array}", + "access": "private", + "tagname": "", + "class": "Errors", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/errors.ts", + "line": 195, + "description": "

Total number of errors.

\n", + "itemtype": "property", + "name": "length", + "type": "{Number}", + "access": "public", + "tagname": "", + "readonly": "", + "class": "Errors", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/errors.ts", + "line": 204, + "description": "

true if we have no errors.

\n", + "itemtype": "property", + "name": "isEmpty", + "type": "{Boolean}", + "access": "public", + "tagname": "", + "readonly": "", + "class": "Errors", + "module": "@ember-data/model" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "Ember.ArrayProxy", + "type": "missing" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/model", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-Fetch.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-Fetch.json new file mode 100644 index 000000000..ebfe085dd --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-Fetch.json @@ -0,0 +1,45 @@ +{ + "data": { + "id": "ember-data-5.3.0-Fetch", + "type": "class", + "attributes": { + "name": "Fetch", + "shortname": "Fetch", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/request/fetch", + "namespace": "", + "file": "../request/src/fetch.ts", + "line": 35, + "description": "

A basic handler which converts a request into a\nfetch call presuming the response to be json.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import Fetch from '@ember-data/request/fetch';\n\nmanager.use([Fetch]);
\n
\n
\n \n", + "access": "public", + "tagname": "", + "methods": [], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/request/fetch", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-ForbiddenError.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-ForbiddenError.json new file mode 100644 index 000000000..9bf891177 --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-ForbiddenError.json @@ -0,0 +1,49 @@ +{ + "data": { + "id": "ember-data-5.3.0-ForbiddenError", + "type": "class", + "attributes": { + "name": "ForbiddenError", + "shortname": "ForbiddenError", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/adapter/error", + "namespace": "", + "file": "../adapter/src/error.js", + "line": 265, + "description": "

A ForbiddenError equates to a HTTP 403 Forbidden response status.\nIt is used by an adapter to signal that a request to the external API was\nvalid but the server is refusing to respond to it. If authorization was\nprovided and is valid, then the authenticated user does not have the\nnecessary permissions for the request.

\n", + "access": "public", + "tagname": "", + "extends": "AdapterError", + "methods": [], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-data-5.3.0-AdapterError", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/adapter/error", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-Future.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-Future.json new file mode 100644 index 000000000..6dd6c26ea --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-Future.json @@ -0,0 +1,108 @@ +{ + "data": { + "id": "ember-data-5.3.0-Future", + "type": "class", + "attributes": { + "name": "Future", + "shortname": "Future", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/request", + "namespace": "", + "file": "../request/src/-private/types.ts", + "line": 66, + "description": "

A Future is a Promise which resolves to a StructuredDocument\nwhile providing the ability to abort the underlying request,\ngetStream the response before the outer promise resolves;

\n", + "extends": "Promise", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "../packages/request/src/-private/types.ts", + "line": 76, + "description": "

Cancel this request by firing the AbortController's signal.

\n", + "itemtype": "method", + "name": "abort", + "params": [ + { + "name": "reason", + "description": "optional reason for aborting the request", + "type": "String", + "optional": true + } + ], + "access": "public", + "tagname": "", + "return": { + "description": "", + "type": "Void" + }, + "class": "Future", + "module": "@ember-data/request" + }, + { + "file": "../packages/request/src/-private/types.ts", + "line": 85, + "description": "

Get the response stream, if any, once made available.

\n", + "itemtype": "method", + "name": "getStream", + "access": "public", + "tagname": "", + "return": { + "description": "", + "type": "Promise" + }, + "class": "Future", + "module": "@ember-data/request" + }, + { + "file": "../packages/request/src/-private/types.ts", + "line": 94, + "description": "

Run a callback when this request completes. Use sparingly,\nmostly useful for instrumentation and infrastructure.

\n", + "itemtype": "method", + "name": "onFinalize", + "params": [ + { + "name": "cb", + "description": "the callback to run" + } + ], + "access": "public", + "tagname": "", + "return": { + "description": "void" + }, + "class": "Future", + "module": "@ember-data/request" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": { + "id": "Promise", + "type": "missing" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/request", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-HasManyReference.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-HasManyReference.json new file mode 100644 index 000000000..95c15ffaa --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-HasManyReference.json @@ -0,0 +1,218 @@ +{ + "data": { + "id": "ember-data-5.3.0-HasManyReference", + "type": "class", + "attributes": { + "name": "HasManyReference", + "shortname": "HasManyReference", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/model", + "namespace": "", + "file": "../model/src/-private/references/has-many.ts", + "line": 46, + "description": "

A HasManyReference is a low-level API that allows users and addon\nauthors to perform meta-operations on a has-many relationship.

\n", + "access": "public", + "tagname": "", + "extends": "Reference", + "methods": [ + { + "file": "../packages/model/src/-private/references/has-many.ts", + "line": 154, + "itemtype": "method", + "description": "

This returns a string that represents how the reference will be\nlooked up when it is loaded. If the relationship has a link it will\nuse the "link" otherwise it defaults to "id".

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/models/post.js
1\n2\n3\n4\n5\n
import Model, { hasMany } from '@ember-data/model';\n\nexport default class PostModel extends Model {\n  @hasmany('comment', { async: true, inverse: null }) comments;\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
let post = store.push({\n  data: {\n    type: 'post',\n    id: 1,\n    relationships: {\n      comments: {\n        data: [{ type: 'comment', id: 1 }]\n      }\n    }\n  }\n});\n\nlet commentsRef = post.hasMany('comments');\n\n// get the identifier of the reference\nif (commentsRef.remoteType() === "ids") {\n  let ids = commentsRef.ids();\n} else if (commentsRef.remoteType() === "link") {\n  let link = commentsRef.link();\n}
\n
\n
\n \n", + "name": "remoteType", + "access": "public", + "tagname": "", + "return": { + "description": "The name of the remote type. This should either be `link` or `ids`", + "type": "String" + }, + "class": "HasManyReference", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/references/has-many.ts", + "line": 205, + "itemtype": "method", + "description": "

ids() returns an array of the record IDs in this relationship.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/models/post.js
1\n2\n3\n4\n5\n
import Model, { hasMany } from '@ember-data/model';\n\nexport default class PostModel extends Model {\n  @hasmany('comment', { async: true, inverse: null }) comments;\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
let post = store.push({\n  data: {\n    type: 'post',\n    id: 1,\n    relationships: {\n      comments: {\n        data: [{ type: 'comment', id: 1 }]\n      }\n    }\n  }\n});\n\nlet commentsRef = post.hasMany('comments');\n\ncommentsRef.ids(); // ['1']
\n
\n
\n \n", + "name": "ids", + "access": "public", + "tagname": "", + "return": { + "description": "The ids in this has-many relationship", + "type": "Array" + }, + "class": "HasManyReference", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/references/has-many.ts", + "line": 244, + "description": "

The link Ember Data will use to fetch or reload this belongs-to\nrelationship. By default it uses only the "related" resource linkage.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n
// models/blog.js\nimport Model, { belongsTo } from '@ember-data/model';\nexport default Model.extend({\n   user: belongsTo('user', { async: true, inverse: null })\n });\n\nlet blog = store.push({\n   data: {\n     type: 'blog',\n     id: 1,\n     relationships: {\n       user: {\n         links: {\n           related: '/articles/1/author'\n         }\n       }\n     }\n   }\n });\nlet userRef = blog.belongsTo('user');\n\n// get the identifier of the reference\nif (userRef.remoteType() === "link") {\n   let link = userRef.link();\n }
\n
\n
\n \n", + "itemtype": "method", + "name": "link", + "access": "public", + "tagname": "", + "return": { + "description": "The link Ember Data will use to fetch or reload this belongs-to relationship.", + "type": "String" + }, + "class": "HasManyReference", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/references/has-many.ts", + "line": 294, + "description": "

any links that have been received for this relationship

\n", + "itemtype": "method", + "name": "links", + "access": "public", + "tagname": "", + "return": { + "description": "" + }, + "class": "HasManyReference", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/references/has-many.ts", + "line": 307, + "description": "

The meta data for the has-many relationship.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n
// models/blog.js\nimport Model, { hasMany } from '@ember-data/model';\nexport default Model.extend({\n   users: hasMany('user', { async: true, inverse: null })\n });\n\nlet blog = store.push({\n   data: {\n     type: 'blog',\n     id: 1,\n     relationships: {\n       users: {\n         links: {\n           related: {\n             href: '/articles/1/authors'\n           },\n         },\n         meta: {\n           lastUpdated: 1458014400000\n         }\n       }\n     }\n   }\n });\n\nlet usersRef = blog.hasMany('user');\n\nusersRef.meta() // { lastUpdated: 1458014400000 }
\n
\n
\n \n", + "itemtype": "method", + "name": "meta", + "access": "public", + "tagname": "", + "return": { + "description": "The meta information for the belongs-to relationship.", + "type": "Object" + }, + "class": "HasManyReference", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/references/has-many.ts", + "line": 356, + "itemtype": "method", + "description": "

push can be used to update the data in the relationship and Ember\nData will treat the new data as the canonical value of this\nrelationship on the backend.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/models/post.js
1\n2\n3\n4\n5\n
import Model, { hasMany } from '@ember-data/model';\n\nexport default class PostModel extends Model {\n  @hasmany('comment', { async: true, inverse: null }) comments;\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n
let post = store.push({\n  data: {\n    type: 'post',\n    id: 1,\n    relationships: {\n      comments: {\n        data: [{ type: 'comment', id: 1 }]\n      }\n    }\n  }\n});\n\nlet commentsRef = post.hasMany('comments');\n\ncommentsRef.ids(); // ['1']\n\ncommentsRef.push([\n[{ type: 'comment', id: 2 }],\n[{ type: 'comment', id: 3 }],\n])\n\ncommentsRef.ids(); // ['2', '3']
\n
\n
\n ", + "name": "push", + "access": "public", + "tagname": "", + "params": [ + { + "name": "objectOrPromise", + "description": "a promise that resolves to a JSONAPI document object describing the new value of this relationship.", + "type": "Array|Promise" + } + ], + "return": { + "description": "", + "type": "ManyArray" + }, + "class": "HasManyReference", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/references/has-many.ts", + "line": 460, + "itemtype": "method", + "description": "

value() synchronously returns the current value of the has-many\nrelationship. Unlike record.relationshipName, calling\nvalue() on a reference does not trigger a fetch if the async\nrelationship is not yet loaded. If the relationship is not loaded\nit will always return null.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/models/post.js
1\n2\n3\n4\n5\n
import Model, { hasMany } from '@ember-data/model';\n\nexport default class PostModel extends Model {\n  @hasmany('comment', { async: true, inverse: null }) comments;\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
let post = store.push({\n  data: {\n    type: 'post',\n    id: 1,\n    relationships: {\n      comments: {\n        data: [{ type: 'comment', id: 1 }]\n      }\n    }\n  }\n});\n\nlet commentsRef = post.hasMany('comments');\n\npost.comments.then(function(comments) {\n  commentsRef.value() === comments\n})
\n
\n
\n \n", + "name": "value", + "access": "public", + "tagname": "", + "return": { + "description": "", + "type": "ManyArray" + }, + "class": "HasManyReference", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/references/has-many.ts", + "line": 518, + "itemtype": "method", + "description": "

Loads the relationship if it is not already loaded. If the\nrelationship is already loaded this method does not trigger a new\nload. This causes a request to the specified\nrelationship link or reloads all items currently in the relationship.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/models/post.js
1\n2\n3\n4\n5\n
import Model, { hasMany } from '@ember-data/model';\n\nexport default class PostModel extends Model {\n  @hasmany('comment', { async: true, inverse: null }) comments;\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
let post = store.push({\n  data: {\n    type: 'post',\n    id: 1,\n    relationships: {\n      comments: {\n        data: [{ type: 'comment', id: 1 }]\n      }\n    }\n  }\n});\n\nlet commentsRef = post.hasMany('comments');\n\ncommentsRef.load().then(function(comments) {\n  //...\n});
\n
\n
\n \n

You may also pass in an options object whose properties will be\nfed forward. This enables you to pass adapterOptions into the\nrequest given to the adapter via the reference.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
commentsRef.load({ adapterOptions: { isPrivate: true } })\n  .then(function(comments) {\n    //...\n  });
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/comment.js
1\n2\n3\n4\n5\n6\n
export default ApplicationAdapter.extend({\n  findMany(store, type, id, snapshots) {\n    // In the adapter you will have access to adapterOptions.\n    let adapterOptions = snapshots[0].adapterOptions;\n  }\n});
\n
\n
\n \n", + "name": "load", + "access": "public", + "tagname": "", + "params": [ + { + "name": "options", + "description": "the options to pass in.", + "type": "Object" + } + ], + "return": { + "description": "a promise that resolves with the ManyArray in\nthis has-many relationship.", + "type": "Promise" + }, + "class": "HasManyReference", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/references/has-many.ts", + "line": 593, + "itemtype": "method", + "description": "

Reloads this has-many relationship. This causes a request to the specified\nrelationship link or reloads all items currently in the relationship.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/models/post.js
1\n2\n3\n4\n5\n
import Model, { hasMany } from '@ember-data/model';\n\nexport default class PostModel extends Model {\n  @hasmany('comment', { async: true, inverse: null }) comments;\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
let post = store.push({\n  data: {\n    type: 'post',\n    id: 1,\n    relationships: {\n      comments: {\n        data: [{ type: 'comment', id: 1 }]\n      }\n    }\n  }\n});\n\nlet commentsRef = post.hasMany('comments');\n\ncommentsRef.reload().then(function(comments) {\n  //...\n});
\n
\n
\n \n

You may also pass in an options object whose properties will be\nfed forward. This enables you to pass adapterOptions into the\nrequest given to the adapter via the reference. A full example\ncan be found in the load method.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
commentsRef.reload({ adapterOptions: { isPrivate: true } })
\n
\n
\n \n", + "name": "reload", + "access": "public", + "tagname": "", + "params": [ + { + "name": "options", + "description": "the options to pass in.", + "type": "Object" + } + ], + "return": { + "description": "a promise that resolves with the ManyArray in this has-many relationship.", + "type": "Promise" + }, + "class": "HasManyReference", + "module": "@ember-data/model" + } + ], + "events": [], + "properties": [ + { + "file": "../packages/model/src/-private/references/has-many.ts", + "line": 102, + "description": "

An array of identifiers for the records that this reference refers to.

\n", + "itemtype": "property", + "name": "identifiers", + "type": "StableRecordIdentifier[]", + "access": "public", + "tagname": "", + "class": "HasManyReference", + "module": "@ember-data/model" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "Reference", + "type": "missing" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/model", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-IdentifierCache.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-IdentifierCache.json new file mode 100644 index 000000000..5a12c6284 --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-IdentifierCache.json @@ -0,0 +1,203 @@ +{ + "data": { + "id": "ember-data-5.3.0-IdentifierCache", + "type": "class", + "attributes": { + "name": "IdentifierCache", + "shortname": "IdentifierCache", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/store", + "namespace": "", + "file": "../store/src/-private/caches/identifier-cache.ts", + "line": 214, + "description": "

Each instance of {Store} receives a unique instance of a IdentifierCache.

\n

This cache is responsible for assigning or retrieving the unique identify\nfor arbitrary resource data encountered by the store. Data representing\na unique resource or record should always be represented by the same\nidentifier.

\n

It can be configured by consuming applications.

\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "../packages/store/src/-private/caches/identifier-cache.ts", + "line": 257, + "description": "

Internal hook to allow management of merge conflicts with identifiers.

\n

we allow late binding of this private internal merge so that\nthe cache can insert itself here to handle elimination of duplicates

\n", + "itemtype": "method", + "name": "__configureMerge", + "access": "private", + "tagname": "", + "class": "IdentifierCache", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/caches/identifier-cache.ts", + "line": 274, + "itemtype": "method", + "name": "_getRecordIdentifier", + "access": "private", + "tagname": "", + "class": "IdentifierCache", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/caches/identifier-cache.ts", + "line": 353, + "description": "

allows us to peek without generating when needed\nuseful for the "create" case when we need to see if\nwe are accidentally overwritting something

\n", + "itemtype": "method", + "name": "peekRecordIdentifier", + "params": [ + { + "name": "resource", + "description": "" + } + ], + "return": { + "description": "", + "type": "StableRecordIdentifier | undefined" + }, + "access": "private", + "tagname": "", + "class": "IdentifierCache", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/caches/identifier-cache.ts", + "line": 367, + "description": "

Returns the DocumentIdentifier for the given Request, creates one if it does not yet exist.\nReturns null if the request does not have a cacheKey or url.

\n", + "itemtype": "method", + "name": "getOrCreateDocumentIdentifier", + "params": [ + { + "name": "request", + "description": "" + } + ], + "return": { + "description": "", + "type": "StableDocumentIdentifier | null" + }, + "access": "public", + "tagname": "", + "class": "IdentifierCache", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/caches/identifier-cache.ts", + "line": 401, + "description": "

Returns the Identifier for the given Resource, creates one if it does not yet exist.

\n

Specifically this means that we:

\n
    \n
  • validate the id type and lid combo against known identifiers
  • \n
  • return an object with an lid that is stable (repeated calls with the same\nid + type or lid will return the same lid value)
  • \n
  • this referential stability of the object itself is guaranteed
  • \n
\n", + "itemtype": "method", + "name": "getOrCreateRecordIdentifier", + "params": [ + { + "name": "resource", + "description": "" + } + ], + "return": { + "description": "", + "type": "StableRecordIdentifier" + }, + "access": "public", + "tagname": "", + "class": "IdentifierCache", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/caches/identifier-cache.ts", + "line": 420, + "description": "

Returns a new Identifier for the supplied data. Call this method to generate\nan identifier when a new resource is being created local to the client and\npotentially does not have an id.

\n

Delegates generation to the user supplied GenerateMethod if one has been provided\nwith the signature generateMethod({ type }, 'record').

\n", + "itemtype": "method", + "name": "createIdentifierForNewRecord", + "params": [ + { + "name": "data", + "description": "" + } + ], + "return": { + "description": "", + "type": "StableRecordIdentifier" + }, + "access": "public", + "tagname": "", + "class": "IdentifierCache", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/caches/identifier-cache.ts", + "line": 458, + "description": "

Provides the opportunity to update secondary lookup tables for existing identifiers\nCalled after an identifier created with createIdentifierForNewRecord has been\ncommitted.

\n

Assigned id to an Identifier if id has not previously existed; however,\nattempting to change the id or calling update without providing an id when\none is missing will throw an error.

\n
    \n
  • sets id (if id was previously null)

    \n
  • \n
  • lid and type MUST NOT be altered post creation

    \n

    If a merge occurs, it is possible the returned identifier does not match the originally\nprovided identifier. In this case the abandoned identifier will go through the usual\nforgetRecordIdentifier codepaths.

    \n
  • \n
\n", + "itemtype": "method", + "name": "updateRecordIdentifier", + "params": [ + { + "name": "identifierObject", + "description": "" + }, + { + "name": "data", + "description": "" + } + ], + "return": { + "description": "", + "type": "StableRecordIdentifier" + }, + "access": "public", + "tagname": "", + "class": "IdentifierCache", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/caches/identifier-cache.ts", + "line": 548, + "itemtype": "method", + "name": "_mergeRecordIdentifiers", + "access": "private", + "tagname": "", + "class": "IdentifierCache", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/caches/identifier-cache.ts", + "line": 576, + "description": "

Provides the opportunity to eliminate an identifier from secondary lookup tables\nas well as eliminates it from ember-data's own lookup tables and book keeping.

\n

Useful when a record has been deleted and the deletion has been persisted and\nwe do not care about the record anymore. Especially useful when an id of a\ndeleted record might be reused later for a new record.

\n", + "itemtype": "method", + "name": "forgetRecordIdentifier", + "params": [ + { + "name": "identifierObject", + "description": "" + } + ], + "access": "public", + "tagname": "", + "class": "IdentifierCache", + "module": "@ember-data/store" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/store", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-InspectorDataAdapter.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-InspectorDataAdapter.json new file mode 100644 index 000000000..ab6aeb6c4 --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-InspectorDataAdapter.json @@ -0,0 +1,321 @@ +{ + "data": { + "id": "ember-data-5.3.0-InspectorDataAdapter", + "type": "class", + "attributes": { + "name": "InspectorDataAdapter", + "shortname": "InspectorDataAdapter", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/debug", + "namespace": "", + "file": "../debug/addon/index.js", + "line": 46, + "description": "

Implements @ember/debug/data-adapter with for EmberData\nintegration with the ember-inspector.

\n", + "extends": "DataAdapter", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "../packages/debug/addon/index.js", + "line": 57, + "description": "

Specifies how records can be filtered based on the state of the record\nRecords returned will need to have a filterValues\nproperty with a key for every name in the returned array

\n", + "itemtype": "method", + "name": "getFilters", + "access": "private", + "tagname": "", + "return": { + "description": "List of objects defining filters\n The object should have a `name` and `desc` property", + "type": "Array" + }, + "class": "InspectorDataAdapter", + "module": "@ember-data/debug" + }, + { + "file": "../packages/debug/addon/index.js", + "line": 79, + "description": "

Fetch the model types and observe them for changes.\nMaintains the list of model types without needing the Model package for detection.

\n", + "itemtype": "method", + "name": "watchModelTypes", + "access": "private", + "tagname": "", + "params": [ + { + "name": "typesAdded", + "description": "Callback to call to add types.\nTakes an array of objects containing wrapped types (returned from `wrapModelType`).", + "type": "Function" + }, + { + "name": "typesUpdated", + "description": "Callback to call when a type has changed.\nTakes an array of objects containing wrapped types.", + "type": "Function" + } + ], + "return": { + "description": "Method to call to remove all observers", + "type": "Function" + }, + "class": "InspectorDataAdapter", + "module": "@ember-data/debug" + }, + { + "file": "../packages/debug/addon/index.js", + "line": 130, + "description": "

Loop over the discovered types and use the callbacks from watchModelTypes to notify\nthe consumer of this adapter about the mdoels.

\n", + "itemtype": "method", + "name": "watchTypeIfUnseen", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "discoveredTypes", + "description": "", + "type": "Map" + }, + { + "name": "type", + "description": "", + "type": "String" + }, + { + "name": "typesAdded", + "description": "", + "type": "Function" + }, + { + "name": "typesUpdated", + "description": "", + "type": "Function" + }, + { + "name": "releaseMethods", + "description": "", + "type": "Array" + } + ], + "access": "private", + "tagname": "", + "class": "InspectorDataAdapter", + "module": "@ember-data/debug" + }, + { + "file": "../packages/debug/addon/index.js", + "line": 153, + "description": "

Creates a human readable string used for column headers

\n", + "itemtype": "method", + "name": "columnNameToDesc", + "access": "private", + "tagname": "", + "params": [ + { + "name": "name", + "description": "The attribute name", + "type": "String" + } + ], + "return": { + "description": "Human readable string based on the attribute name", + "type": "String" + }, + "class": "InspectorDataAdapter", + "module": "@ember-data/debug" + }, + { + "file": "../packages/debug/addon/index.js", + "line": 165, + "description": "

Get the columns for a given model type

\n", + "itemtype": "method", + "name": "columnsForType", + "access": "private", + "tagname": "", + "params": [ + { + "name": "typeClass", + "description": "", + "type": "Model" + } + ], + "return": { + "description": "An array of columns of the following format:\n name: {String} The name of the column\n desc: {String} Humanized description (what would show in a table column name)", + "type": "Array" + }, + "class": "InspectorDataAdapter", + "module": "@ember-data/debug" + }, + { + "file": "../packages/debug/addon/index.js", + "line": 194, + "description": "

Fetches all loaded records for a given type

\n", + "itemtype": "method", + "name": "getRecords", + "access": "private", + "tagname": "", + "params": [ + { + "name": "modelClass", + "description": "of the record", + "type": "Model" + }, + { + "name": "modelName", + "description": "of the record", + "type": "String" + } + ], + "return": { + "description": "An array of Model records\n This array will be observed for changes,\n so it should update when new records are added/removed", + "type": "Array" + }, + "class": "InspectorDataAdapter", + "module": "@ember-data/debug" + }, + { + "file": "../packages/debug/addon/index.js", + "line": 220, + "description": "

Gets the values for each column\nThis is the attribute values for a given record

\n", + "itemtype": "method", + "name": "getRecordColumnValues", + "access": "private", + "tagname": "", + "params": [ + { + "name": "record", + "description": "to get values from", + "type": "Model" + } + ], + "return": { + "description": "Keys should match column names defined by the model type", + "type": "Object" + }, + "class": "InspectorDataAdapter", + "module": "@ember-data/debug" + }, + { + "file": "../packages/debug/addon/index.js", + "line": 242, + "description": "

Returns keywords to match when searching records

\n", + "itemtype": "method", + "name": "getRecordKeywords", + "access": "private", + "tagname": "", + "params": [ + { + "name": "record", + "description": "", + "type": "Model" + } + ], + "return": { + "description": "Relevant keywords for search based on the record's attribute values", + "type": "Array" + }, + "class": "InspectorDataAdapter", + "module": "@ember-data/debug" + }, + { + "file": "../packages/debug/addon/index.js", + "line": 258, + "description": "

Returns the values of filters defined by getFilters\nThese reflect the state of the record

\n", + "itemtype": "method", + "name": "getRecordFilterValues", + "access": "private", + "tagname": "", + "params": [ + { + "name": "record", + "description": "", + "type": "Model" + } + ], + "return": { + "description": "The record state filter values", + "type": "Object" + }, + "class": "InspectorDataAdapter", + "module": "@ember-data/debug" + }, + { + "file": "../packages/debug/addon/index.js", + "line": 275, + "description": "

Returns a color that represents the record's state\nPossible colors: black, blue, green

\n", + "itemtype": "method", + "name": "getRecordColor", + "access": "private", + "tagname": "", + "params": [ + { + "name": "record", + "description": "", + "type": "Model" + } + ], + "return": { + "description": "The record color", + "type": "String" + }, + "class": "InspectorDataAdapter", + "module": "@ember-data/debug" + }, + { + "file": "../packages/debug/addon/index.js", + "line": 294, + "description": "

Observes all relevant properties and re-sends the wrapped record\nwhen a change occurs

\n", + "itemtype": "method", + "name": "observeRecord", + "access": "private", + "tagname": "", + "params": [ + { + "name": "record", + "description": "", + "type": "Model" + }, + { + "name": "recordUpdated", + "description": "Callback used to notify changes", + "type": "Function" + } + ], + "return": { + "description": "The function to call to remove all observers", + "type": "Function" + }, + "class": "InspectorDataAdapter", + "module": "@ember-data/debug" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": { + "id": "DataAdapter", + "type": "missing" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/debug", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-InvalidError.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-InvalidError.json new file mode 100644 index 000000000..2f255c0db --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-InvalidError.json @@ -0,0 +1,49 @@ +{ + "data": { + "id": "ember-data-5.3.0-InvalidError", + "type": "class", + "attributes": { + "name": "InvalidError", + "shortname": "InvalidError", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/adapter/error", + "namespace": "", + "file": "../adapter/src/error.js", + "line": 119, + "access": "public", + "description": "

A InvalidError is used by an adapter to signal the external API\nwas unable to process a request because the content was not\nsemantically correct or meaningful per the API. Usually, this means a\nrecord failed some form of server-side validation. When a promise\nfrom an adapter is rejected with a InvalidError the record will\ntransition to the invalid state and the errors will be set to the\nerrors property on the record.

\n

For Ember Data to correctly map errors to their corresponding\nproperties on the model, Ember Data expects each error to be\na valid JSON-API error object with a source/pointer that matches\nthe property name. For example, if you had a Post model that\nlooked like this.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/models/post.js
1\n2\n3\n4\n5\n
import Model, { attr } from '@ember-data/model';\n\nexport default class PostModel extends Model {\n  @attr('string') content;\n}
\n
\n
\n \n

To show an error from the server related to the title and\ncontent properties your adapter could return a promise that\nrejects with a InvalidError object that looks like this:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import RSVP from 'RSVP';\nimport RESTAdapter from '@ember-data/adapter/rest';\nimport { InvalidError } from '@ember-data/adapter/error';\n\nexport default class ApplicationAdapter extends RESTAdapter {\n  updateRecord() {\n    // Fictional adapter that always rejects\n    return RSVP.reject(new InvalidError([\n      {\n        detail: 'Must be unique',\n        source: { pointer: '/data/attributes/title' }\n      },\n      {\n        detail: 'Must not be blank',\n        source: { pointer: '/data/attributes/content'}\n      }\n    ]));\n  }\n}
\n
\n
\n \n

Your backend may use different property names for your records the\nstore will attempt to extract and normalize the errors using the\nserializer's extractErrors method before the errors get added to\nthe model. As a result, it is safe for the InvalidError to\nwrap the error payload unaltered.

\n", + "tagname": "", + "extends": "AdapterError", + "methods": [], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-data-5.3.0-AdapterError", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/adapter/error", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-JSONAPIAdapter.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-JSONAPIAdapter.json new file mode 100644 index 000000000..a0c3a71b7 --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-JSONAPIAdapter.json @@ -0,0 +1,1893 @@ +{ + "data": { + "id": "ember-data-5.3.0-JSONAPIAdapter", + "type": "class", + "attributes": { + "name": "JSONAPIAdapter", + "shortname": "JSONAPIAdapter", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/adapter/json-api", + "namespace": "", + "file": "../adapter/src/json-api.ts", + "line": 19, + "description": "

Overview

\n
\n

\n ⚠️ This is LEGACY documentation for a feature that is no longer encouraged to be used.\n If starting a new app or thinking of implementing a new adapter, consider writing a\n Handler instead to be used with the RequestManager\n

\n
\n\n

The JSONAPIAdapter is an adapter whichtransforms the store's\nrequests into HTTP requests that follow the JSON API format.

\n

JSON API Conventions

\n

The JSONAPIAdapter uses JSON API conventions for building the URL\nfor a record and selecting the HTTP verb to use with a request. The\nactions you can take on a record map onto the following URLs in the\nJSON API adapter:

\n\n\n \n \n \n\n\n \n \n \n\n\n \n \n \n\n\n \n \n \n\n\n \n \n \n\n\n \n \n \n\n
\n Action\n \n HTTP Verb\n \n URL\n
\n `store.findRecord('post', 123)`\n \n GET\n \n /posts/123\n
\n `store.findAll('post')`\n \n GET\n \n /posts\n
\n Update `postRecord.save()`\n \n PATCH\n \n /posts/123\n
\n Create `store.createRecord('post').save()`\n \n POST\n \n /posts\n
\n Delete `postRecord.destroyRecord()`\n \n DELETE\n \n /posts/123\n
\n\n

Success and failure

\n

The JSONAPIAdapter will consider a success any response with a\nstatus code of the 2xx family ("Success"), as well as 304 ("Not\nModified"). Any other status code will be considered a failure.

\n

On success, the request promise will be resolved with the full\nresponse payload.

\n

Failed responses with status code 422 ("Unprocessable Entity") will\nbe considered "invalid". The response will be discarded, except for\nthe errors key. The request promise will be rejected with a\nInvalidError. This error object will encapsulate the saved\nerrors value.

\n

Any other status codes will be treated as an adapter error. The\nrequest promise will be rejected, similarly to the invalid case,\nbut with an instance of AdapterError instead.

\n

Endpoint path customization

\n

Endpoint paths can be prefixed with a namespace by setting the\nnamespace property on the adapter:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n
import JSONAPIAdapter from '@ember-data/adapter/json-api';\n\nexport default class ApplicationAdapter extends JSONAPIAdapter {\n  namespace = 'api/1';\n}
\n
\n
\n \n

Requests for the person model would now target /api/1/people/1.

\n

Host customization

\n

An adapter can target other hosts by setting the host property.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n
import JSONAPIAdapter from '@ember-data/adapter/json-api';\n\nexport default class ApplicationAdapter extends JSONAPIAdapter {\n  host = 'https://api.example.com';\n}
\n
\n
\n \n

Requests for the person model would now target\nhttps://api.example.com/people/1.

\n", + "since": "1.13.0", + "mainName": "@ember-data/adapter/json-api", + "tag": "main", + "_main": true, + "access": "public", + "tagname": "", + "is_constructor": 1, + "extends": "RESTAdapter", + "methods": [ + { + "file": "../packages/adapter/src/json-api.ts", + "line": 167, + "itemtype": "method", + "name": "ajaxOptions", + "access": "private", + "tagname": "", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + }, + { + "name": "type", + "description": "The request type GET, POST, PUT, DELETE etc.", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter/json-api" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 370, + "description": "

By default, the RESTAdapter will send the query params sorted alphabetically to the\nserver.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
store.query('posts', { sort: 'price', category: 'pets' });
\n
\n
\n \n

will generate a requests like this /posts?category=pets&sort=price, even if the\nparameters were specified in a different order.

\n

That way the generated URL will be deterministic and that simplifies caching mechanisms\nin the backend.

\n

Setting sortQueryParams to a falsey value will respect the original order.

\n

In case you want to sort the query parameters with a different criteria, set\nsortQueryParams to your custom sort function.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import RESTAdapter from '@ember-data/adapter/rest';\n\nexport default class ApplicationAdapter extends RESTAdapter {\n  sortQueryParams(params) {\n    let sortedKeys = Object.keys(params).sort().reverse();\n    let len = sortedKeys.length, newParams = {};\n\n    for (let i = 0; i < len; i++) {\n      newParams[sortedKeys[i]] = params[sortedKeys[i]];\n    }\n\n    return newParams;\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "sortQueryParams", + "params": [ + { + "name": "obj", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter/rest", + "inherited": true, + "inheritedFrom": "RESTAdapter" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 552, + "description": "

Called by the store in order to fetch the JSON for a given\ntype and ID.

\n

The findRecord method makes an Ajax request to a URL computed by\nbuildURL, and returns a promise for the resulting payload.

\n

This method performs an HTTP GET request with the id provided as part of the query string.

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "findRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "", + "type": "Model" + }, + { + "name": "id", + "description": "", + "type": "String" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter/rest", + "inherited": true, + "inheritedFrom": "RESTAdapter" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 577, + "description": "

Called by the store in order to fetch a JSON array for all\nof the records for a given type.

\n

The findAll method makes an Ajax (HTTP GET) request to a URL computed by buildURL, and returns a\npromise for the resulting payload.

\n", + "itemtype": "method", + "name": "findAll", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "", + "type": "Model" + }, + { + "name": "neverSet", + "description": "a value is never provided to this argument", + "type": "Undefined" + }, + { + "name": "snapshotRecordArray", + "description": "", + "type": "SnapshotRecordArray" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter/rest", + "inherited": true, + "inheritedFrom": "RESTAdapter" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 608, + "description": "

Called by the store in order to fetch a JSON array for\nthe records that match a particular query.

\n

The query method makes an Ajax (HTTP GET) request to a URL\ncomputed by buildURL, and returns a promise for the resulting\npayload.

\n

The query argument is a simple JavaScript object that will be passed directly\nto the server as parameters.

\n", + "itemtype": "method", + "name": "query", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "", + "type": "Model" + }, + { + "name": "query", + "description": "", + "type": "Object" + }, + { + "name": "recordArray", + "description": "", + "type": "Collection" + }, + { + "name": "adapterOptions", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter/rest", + "inherited": true, + "inheritedFrom": "RESTAdapter" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 638, + "description": "

Called by the store in order to fetch a JSON object for\nthe record that matches a particular query.

\n

The queryRecord method makes an Ajax (HTTP GET) request to a URL\ncomputed by buildURL, and returns a promise for the resulting\npayload.

\n

The query argument is a simple JavaScript object that will be passed directly\nto the server as parameters.

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "queryRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "", + "type": "Model" + }, + { + "name": "query", + "description": "", + "type": "Object" + }, + { + "name": "adapterOptions", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter/rest", + "inherited": true, + "inheritedFrom": "RESTAdapter" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 673, + "description": "

Called by the store in order to fetch several records together if coalesceFindRequests is true

\n

For example, if the original payload looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
{\n  "id": 1,\n  "title": "Rails is omakase",\n  "comments": [ 1, 2, 3 ]\n}
\n
\n
\n \n

The IDs will be passed as a URL-encoded Array of IDs, in this form:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
ids[]=1&ids[]=2&ids[]=3
\n
\n
\n

Many servers, such as Rails and PHP, will automatically convert this URL-encoded array\ninto an Array for you on the server-side. If you want to encode the\nIDs, differently, just override this (one-line) method.

\n

The findMany method makes an Ajax (HTTP GET) request to a URL computed by buildURL, and returns a\npromise for the resulting payload.

\n", + "itemtype": "method", + "name": "findMany", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "", + "type": "Model" + }, + { + "name": "ids", + "description": "", + "type": "Array" + }, + { + "name": "snapshots", + "description": "", + "type": "Array" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter/rest", + "inherited": true, + "inheritedFrom": "RESTAdapter" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 712, + "description": "

Called by the store in order to fetch a JSON array for\nthe unloaded records in a has-many relationship that were originally\nspecified as a URL (inside of links).

\n

For example, if your original payload looks like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
{\n  "post": {\n    "id": 1,\n    "title": "Rails is omakase",\n    "links": { "comments": "/posts/1/comments" }\n  }\n}
\n
\n
\n \n

This method will be called with the parent record and /posts/1/comments.

\n

The findHasMany method will make an Ajax (HTTP GET) request to the originally specified URL.

\n

The format of your links value will influence the final request URL via the urlPrefix method:

\n
    \n
  • Links beginning with //, http://, https://, will be used as is, with no further manipulation.

    \n
  • \n
  • Links beginning with a single / will have the current adapter's host value prepended to it.

    \n
  • \n
  • Links with no beginning / will have a parentURL prepended to it, via the current adapter's buildURL.

    \n
  • \n
\n", + "itemtype": "method", + "name": "findHasMany", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "url", + "description": "", + "type": "String" + }, + { + "name": "relationship", + "description": "meta object describing the relationship", + "type": "Object" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter/rest", + "inherited": true, + "inheritedFrom": "RESTAdapter" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 767, + "description": "

Called by the store in order to fetch the JSON for the unloaded record in a\nbelongs-to relationship that was originally specified as a URL (inside of\nlinks).

\n

For example, if your original payload looks like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
{\n  "person": {\n    "id": 1,\n    "name": "Tom Dale",\n    "links": { "group": "/people/1/group" }\n  }\n}
\n
\n
\n \n

This method will be called with the parent record and /people/1/group.

\n

The findBelongsTo method will make an Ajax (HTTP GET) request to the originally specified URL.

\n

The format of your links value will influence the final request URL via the urlPrefix method:

\n
    \n
  • Links beginning with //, http://, https://, will be used as is, with no further manipulation.

    \n
  • \n
  • Links beginning with a single / will have the current adapter's host value prepended to it.

    \n
  • \n
  • Links with no beginning / will have a parentURL prepended to it, via the current adapter's buildURL.

    \n
  • \n
\n", + "itemtype": "method", + "name": "findBelongsTo", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "url", + "description": "", + "type": "String" + }, + { + "name": "relationship", + "description": "meta object describing the relationship", + "type": "Object" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter/rest", + "inherited": true, + "inheritedFrom": "RESTAdapter" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 816, + "description": "

Called by the store when a newly created record is\nsaved via the save method on a model record instance.

\n

The createRecord method serializes the record and makes an Ajax (HTTP POST) request\nto a URL computed by buildURL.

\n

See serialize for information on how to customize the serialized form\nof a record.

\n", + "itemtype": "method", + "name": "createRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "", + "type": "Model" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter/rest", + "inherited": true, + "inheritedFrom": "RESTAdapter" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 841, + "description": "

Called by the store when an existing record is saved\nvia the save method on a model record instance.

\n

The updateRecord method serializes the record and makes an Ajax (HTTP PUT) request\nto a URL computed by buildURL.

\n

See serialize for information on how to customize the serialized form\nof a record.

\n", + "itemtype": "method", + "name": "updateRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "schema", + "description": "", + "type": "Model" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter/rest", + "inherited": true, + "inheritedFrom": "RESTAdapter" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 868, + "description": "

Called by the store when a record is deleted.

\n

The deleteRecord method makes an Ajax (HTTP DELETE) request to a URL computed by buildURL.

\n", + "itemtype": "method", + "name": "deleteRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "", + "type": "Model" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter/rest", + "inherited": true, + "inheritedFrom": "RESTAdapter" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 918, + "description": "

Organize records into groups, each of which is to be passed to separate\ncalls to findMany.

\n

This implementation groups together records that have the same base URL but\ndiffering ids. For example /comments/1 and /comments/2 will be grouped together\nbecause we know findMany can coalesce them together as /comments?ids[]=1&ids[]=2

\n

It also supports urls where ids are passed as a query param, such as /comments?id=1\nbut not those where there is more than 1 query param such as /comments?id=2&name=David\nCurrently only the query param of id is supported. If you need to support others, please\noverride this or the _stripIDFromURL method.

\n

It does not group records that have differing base urls, such as for example: /posts/1/comments/2\nand /posts/2/comments/3

\n", + "itemtype": "method", + "name": "groupRecordsForFindMany", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "snapshots", + "description": "", + "type": "Array" + } + ], + "return": { + "description": "an array of arrays of records, each of which is to be\n loaded separately by `findMany`.", + "type": "Array" + }, + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter/rest", + "inherited": true, + "inheritedFrom": "RESTAdapter" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 965, + "description": "

Takes an ajax response, and returns the json payload or an error.

\n

By default this hook just returns the json payload passed to it.\nYou might want to override it in two cases:

\n
    \n
  1. Your API might return useful results in the response headers.\nResponse headers are passed in as the second argument.

    \n
  2. \n
  3. Your API might return errors as successful responses with status code\n200 and an Errors text or object. You can return a InvalidError or a\nAdapterError (or a sub class) from this hook and it will automatically\nreject the promise and put your record into the invalid or error state.

    \n
  4. \n
\n

Returning a InvalidError from this method will cause the\nrecord to transition into the invalid state and make the\nerrors object available on the record. When returning an\nInvalidError the store will attempt to normalize the error data\nreturned from the server using the serializer's extractErrors\nmethod.

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "handleResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "status", + "description": "", + "type": "Number" + }, + { + "name": "headers", + "description": "", + "type": "Object" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "requestData", + "description": "- the original request information", + "type": "Object" + } + ], + "return": { + "description": "response", + "type": "Object | AdapterError" + }, + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter/rest", + "inherited": true, + "inheritedFrom": "RESTAdapter" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 1028, + "description": "

Default handleResponse implementation uses this hook to decide if the\nresponse is a success.

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "isSuccess", + "access": "public", + "tagname": "", + "params": [ + { + "name": "status", + "description": "", + "type": "Number" + }, + { + "name": "headers", + "description": "", + "type": "Object" + }, + { + "name": "payload", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter/rest", + "inherited": true, + "inheritedFrom": "RESTAdapter" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 1044, + "description": "

Default handleResponse implementation uses this hook to decide if the\nresponse is an invalid error.

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "isInvalid", + "access": "public", + "tagname": "", + "params": [ + { + "name": "status", + "description": "", + "type": "Number" + }, + { + "name": "headers", + "description": "", + "type": "Object" + }, + { + "name": "payload", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter/rest", + "inherited": true, + "inheritedFrom": "RESTAdapter" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 1060, + "description": "

Takes a URL, an HTTP method and a hash of data, and makes an\nHTTP request.

\n

When the server responds with a payload, Ember Data will call into extractSingle\nor extractArray (depending on whether the original query was for one record or\nmany records).

\n

By default, ajax method has the following behavior:

\n
    \n
  • It sets the response dataType to "json"
  • \n
  • If the HTTP method is not "GET", it sets the Content-Type to be\napplication/json; charset=utf-8
  • \n
  • If the HTTP method is not "GET", it stringifies the data passed in. The\ndata is the serialized record in the case of a save.
  • \n
  • Registers success and failure handlers.
  • \n
\n", + "itemtype": "method", + "name": "ajax", + "access": "private", + "tagname": "", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + }, + { + "name": "type", + "description": "The request type GET, POST, PUT, DELETE etc.", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter/rest", + "inherited": true, + "inheritedFrom": "RESTAdapter" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 1105, + "itemtype": "method", + "name": "_ajaxRequest", + "access": "private", + "tagname": "", + "params": [ + { + "name": "options", + "description": "jQuery ajax options to be used for the ajax request", + "type": "Object" + } + ], + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter/rest", + "inherited": true, + "inheritedFrom": "RESTAdapter" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 1129, + "itemtype": "method", + "name": "ajaxOptions", + "access": "private", + "tagname": "", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + }, + { + "name": "type", + "description": "The request type GET, POST, PUT, DELETE etc.", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter/rest", + "inherited": true, + "inheritedFrom": "RESTAdapter" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 1204, + "itemtype": "method", + "name": "parseErrorResponse", + "access": "private", + "tagname": "", + "params": [ + { + "name": "responseText", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter/rest", + "inherited": true, + "inheritedFrom": "RESTAdapter" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 1222, + "itemtype": "method", + "name": "normalizeErrorResponse", + "access": "private", + "tagname": "", + "params": [ + { + "name": "status", + "description": "", + "type": "Number" + }, + { + "name": "headers", + "description": "", + "type": "Object" + }, + { + "name": "payload", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "errors payload", + "type": "Array" + }, + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter/rest", + "inherited": true, + "inheritedFrom": "RESTAdapter" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 1252, + "description": "

Generates a detailed ("friendly") error message, with plenty\nof information for debugging (good luck!)

\n", + "itemtype": "method", + "name": "generatedDetailedMessage", + "access": "private", + "tagname": "", + "params": [ + { + "name": "status", + "description": "", + "type": "Number" + }, + { + "name": "headers", + "description": "", + "type": "Object" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "requestData", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "detailed error message", + "type": "String" + }, + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter/rest", + "inherited": true, + "inheritedFrom": "RESTAdapter" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 1286, + "description": "

Used by findAll and findRecord to build the query's data hash\nsupplied to the ajax method.

\n", + "itemtype": "method", + "name": "buildQuery", + "since": "2.5.0", + "access": "public", + "tagname": "", + "params": [ + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter/rest", + "inherited": true, + "inheritedFrom": "RESTAdapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 260, + "description": "

The findRecord() method is invoked when the store is asked for a record that\nhas not previously been loaded. In response to findRecord() being called, you\nshould query your persistence layer for a record with the given ID. The findRecord\nmethod should return a promise that will resolve to a JavaScript object that will be\nnormalized by the serializer.

\n

Here is an example of the findRecord implementation:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Adapter from '@ember-data/adapter';\nimport RSVP from 'RSVP';\nimport $ from 'jquery';\n\nexport default class ApplicationAdapter extends Adapter {\n  findRecord(store, type, id, snapshot) {\n    return new RSVP.Promise(function(resolve, reject) {\n      $.getJSON(`/${type.modelName}/${id}`).then(function(data) {\n        resolve(data);\n      }, function(jqXHR) {\n        reject(jqXHR);\n      });\n    });\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "findRecord", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "", + "type": "Model" + }, + { + "name": "id", + "description": "", + "type": "String" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "access": "public", + "tagname": "", + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "Adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 302, + "description": "

The findAll() method is used to retrieve all records for a given type.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Adapter from '@ember-data/adapter';\nimport RSVP from 'RSVP';\nimport $ from 'jquery';\n\nexport default class ApplicationAdapter extends Adapter {\n  findAll(store, type) {\n    return new RSVP.Promise(function(resolve, reject) {\n      $.getJSON(`/${type.modelName}`).then(function(data) {\n        resolve(data);\n      }, function(jqXHR) {\n        reject(jqXHR);\n      });\n    });\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "findAll", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "", + "type": "Model" + }, + { + "name": "neverSet", + "description": "a value is never provided to this argument", + "type": "Undefined" + }, + { + "name": "snapshotRecordArray", + "description": "", + "type": "SnapshotRecordArray" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "access": "public", + "tagname": "", + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "Adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 345, + "description": "

This method is called when you call query on the store.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Adapter from '@ember-data/adapter';\nimport RSVP from 'RSVP';\nimport $ from 'jquery';\n\nexport default class ApplicationAdapter extends Adapter {\n  query(store, type, query) {\n    return new RSVP.Promise(function(resolve, reject) {\n      $.getJSON(`/${type.modelName}`, query).then(function(data) {\n        resolve(data);\n      }, function(jqXHR) {\n        reject(jqXHR);\n      });\n    });\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "query", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "", + "type": "Model" + }, + { + "name": "query", + "description": "", + "type": "Object" + }, + { + "name": "recordArray", + "description": "", + "type": "Collection" + }, + { + "name": "adapterOptions", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "access": "public", + "tagname": "", + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "Adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 384, + "description": "

The queryRecord() method is invoked when the store is asked for a single\nrecord through a query object.

\n

In response to queryRecord() being called, you should always fetch fresh\ndata. Once found, you can asynchronously call the store's push() method\nto push the record into the store.

\n

Here is an example queryRecord implementation:

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Adapter, { BuildURLMixin } from '@ember-data/adapter';\nimport RSVP from 'RSVP';\nimport $ from 'jquery';\n\nexport default class ApplicationAdapter extends Adapter.extend(BuildURLMixin) {\n  queryRecord(store, type, query) {\n    return new RSVP.Promise(function(resolve, reject) {\n      $.getJSON(`/${type.modelName}`, query).then(function(data) {\n        resolve(data);\n      }, function(jqXHR) {\n        reject(jqXHR);\n      });\n    });\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "queryRecord", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "", + "type": "Subclass of Model" + }, + { + "name": "query", + "description": "", + "type": "Object" + }, + { + "name": "adapterOptions", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "access": "public", + "tagname": "", + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "Adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 429, + "description": "

If the globally unique IDs for your records should be generated on the client,\nimplement the generateIdForRecord() method. This method will be invoked\neach time you create a new record, and the value returned from it will be\nassigned to the record's primaryKey.

\n

Most traditional REST-like HTTP APIs will not use this method. Instead, the ID\nof the record will be set by the server, and your adapter will update the store\nwith the new ID when it calls didCreateRecord(). Only implement this method if\nyou intend to generate record IDs on the client-side.

\n

The generateIdForRecord() method will be invoked with the requesting store as\nthe first parameter and the newly created record as the second parameter:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import Adapter from '@ember-data/adapter';\nimport { v4 } from 'uuid';\n\nexport default class ApplicationAdapter extends Adapter {\n  generateIdForRecord(store, type, inputProperties) {\n    return v4();\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "generateIdForRecord", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "the Model class of the record", + "type": "Model" + }, + { + "name": "inputProperties", + "description": "a hash of properties to set on the\n newly created record.", + "type": "Object" + } + ], + "return": { + "description": "id", + "type": "(String|Number)" + }, + "access": "public", + "tagname": "", + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "Adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 463, + "description": "

Proxies to the serializer's serialize method.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Adapter from '@ember-data/adapter';\n\nexport default class ApplicationAdapter extends Adapter {\n  createRecord(store, type, snapshot) {\n    let data = this.serialize(snapshot, { includeId: true });\n    let url = `/${type.modelName}`;\n\n    // ...\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "serialize", + "params": [ + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "serialized snapshot", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "Adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 491, + "description": "

Implement this method in a subclass to handle the creation of\nnew records.

\n

Serializes the record and sends it to the server.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n
import Adapter from '@ember-data/adapter';\nimport RSVP from 'RSVP';\nimport $ from 'jquery';\n\nexport default class ApplicationAdapter extends Adapter {\n  createRecord(store, type, snapshot) {\n    let data = this.serialize(snapshot, { includeId: true });\n\n    return new RSVP.Promise(function (resolve, reject) {\n      $.ajax({\n        type: 'POST',\n        url: `/${type.modelName}`,\n        dataType: 'json',\n        data: data\n      }).then(function (data) {\n        resolve(data);\n      }, function (jqXHR) {\n        jqXHR.then = null; // tame jQuery's ill mannered promises\n        reject(jqXHR);\n      });\n    });\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "createRecord", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "the Model class of the record", + "type": "Model" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "access": "public", + "tagname": "", + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "Adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 539, + "description": "

Implement this method in a subclass to handle the updating of\na record.

\n

Serializes the record update and sends it to the server.

\n

The updateRecord method is expected to return a promise that will\nresolve with the serialized record. This allows the backend to\ninform the Ember Data store the current state of this record after\nthe update. If it is not possible to return a serialized record\nthe updateRecord promise can also resolve with undefined and the\nEmber Data store will assume all of the updates were successfully\napplied on the backend.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n
import Adapter from '@ember-data/adapter';\nimport RSVP from 'RSVP';\nimport $ from 'jquery';\n\nexport default class ApplicationAdapter extends Adapter {\n  updateRecord(store, type, snapshot) {\n    let data = this.serialize(snapshot, { includeId: true });\n    let id = snapshot.id;\n\n    return new RSVP.Promise(function(resolve, reject) {\n      $.ajax({\n        type: 'PUT',\n        url: `/${type.modelName}/${id}`,\n        dataType: 'json',\n        data: data\n      }).then(function(data) {\n        resolve(data);\n      }, function(jqXHR) {\n        jqXHR.then = null; // tame jQuery's ill mannered promises\n        reject(jqXHR);\n      });\n    });\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "updateRecord", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "the Model class of the record", + "type": "Model" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "access": "public", + "tagname": "", + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "Adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 596, + "description": "

Implement this method in a subclass to handle the deletion of\na record.

\n

Sends a delete request for the record to the server.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n
import Adapter from '@ember-data/adapter';\nimport RSVP from 'RSVP';\nimport $ from 'jquery';\n\nexport default class ApplicationAdapter extends Adapter {\n  deleteRecord(store, type, snapshot) {\n    let data = this.serialize(snapshot, { includeId: true });\n    let id = snapshot.id;\n\n    return new RSVP.Promise(function(resolve, reject) {\n      $.ajax({\n        type: 'DELETE',\n        url: `/${type.modelName}/${id}`,\n        dataType: 'json',\n        data: data\n      }).then(function(data) {\n        resolve(data)\n      }, function(jqXHR) {\n        jqXHR.then = null; // tame jQuery's ill mannered promises\n        reject(jqXHR);\n      });\n    });\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "deleteRecord", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "the Model class of the record", + "type": "Model" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "access": "public", + "tagname": "", + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "Adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 667, + "description": "

The store will call findMany instead of multiple findRecord\nrequests to find multiple records at once if coalesceFindRequests\nis true.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Adapter from '@ember-data/adapter';\nimport RSVP from 'RSVP';\nimport $ from 'jquery';\n\nexport default class ApplicationAdapter extends Adapter {\n  findMany(store, type, ids, snapshots) {\n    return new RSVP.Promise(function(resolve, reject) {\n      $.ajax({\n        type: 'GET',\n        url: `/${type.modelName}/`,\n        dataType: 'json',\n        data: { filter: { id: ids.join(',') } }\n      }).then(function(data) {\n        resolve(data);\n      }, function(jqXHR) {\n        jqXHR.then = null; // tame jQuery's ill mannered promises\n        reject(jqXHR);\n      });\n    });\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "findMany", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "the Model class of the records", + "type": "Model" + }, + { + "name": "ids", + "description": "", + "type": "Array" + }, + { + "name": "snapshots", + "description": "", + "type": "Array" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "access": "public", + "tagname": "", + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "Adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 705, + "description": "

Organize records into groups, each of which is to be passed to separate\ncalls to findMany.

\n

For example, if your API has nested URLs that depend on the parent, you will\nwant to group records by their parent.

\n

The default implementation returns the records as a single group.

\n", + "itemtype": "method", + "name": "groupRecordsForFindMany", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "snapshots", + "description": "", + "type": "Array" + } + ], + "return": { + "description": "an array of arrays of records, each of which is to be\n loaded separately by `findMany`.", + "type": "Array" + }, + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "Adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 725, + "description": "

This method is used by the store to determine if the store should\nreload a record from the adapter when a record is requested by\nstore.findRecord.

\n

If this method returns true, the store will re-fetch a record from\nthe adapter. If this method returns false, the store will resolve\nimmediately using the cached record.

\n

For example, if you are building an events ticketing system, in which users\ncan only reserve tickets for 20 minutes at a time, and want to ensure that\nin each route you have data that is no more than 20 minutes old you could\nwrite:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
shouldReloadRecord(store, ticketSnapshot) {\n  let lastAccessedAt = ticketSnapshot.attr('lastAccessedAt');\n  let timeDiff = moment().diff(lastAccessedAt, 'minutes');\n\n  if (timeDiff > 20) {\n    return true;\n  } else {\n    return false;\n  }\n}
\n
\n
\n \n

This method would ensure that whenever you do store.findRecord('ticket',\nid) you will always get a ticket that is no more than 20 minutes old. In\ncase the cached version is more than 20 minutes old, findRecord will not\nresolve until you fetched the latest version.

\n

By default this hook returns false, as most UIs should not block user\ninteractions while waiting on data update.

\n

Note that, with default settings, shouldBackgroundReloadRecord will always\nre-fetch the records in the background even if shouldReloadRecord returns\nfalse. You can override shouldBackgroundReloadRecord if this does not\nsuit your use case.

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "shouldReloadRecord", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "Adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 776, + "description": "

This method is used by the store to determine if the store should\nreload all records from the adapter when records are requested by\nstore.findAll.

\n

If this method returns true, the store will re-fetch all records from\nthe adapter. If this method returns false, the store will resolve\nimmediately using the cached records.

\n

For example, if you are building an events ticketing system, in which users\ncan only reserve tickets for 20 minutes at a time, and want to ensure that\nin each route you have data that is no more than 20 minutes old you could\nwrite:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
shouldReloadAll(store, snapshotArray) {\n  let snapshots = snapshotArray.snapshots();\n\n  return snapshots.any((ticketSnapshot) => {\n    let lastAccessedAt = ticketSnapshot.attr('lastAccessedAt');\n    let timeDiff = moment().diff(lastAccessedAt, 'minutes');\n\n    if (timeDiff > 20) {\n      return true;\n    } else {\n      return false;\n    }\n  });\n}
\n
\n
\n \n

This method would ensure that whenever you do store.findAll('ticket') you\nwill always get a list of tickets that are no more than 20 minutes old. In\ncase a cached version is more than 20 minutes old, findAll will not\nresolve until you fetched the latest versions.

\n

By default, this method returns true if the passed snapshotRecordArray\nis empty (meaning that there are no records locally available yet),\notherwise, it returns false.

\n

Note that, with default settings, shouldBackgroundReloadAll will always\nre-fetch all the records in the background even if shouldReloadAll returns\nfalse. You can override shouldBackgroundReloadAll if this does not suit\nyour use case.

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "shouldReloadAll", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "snapshotRecordArray", + "description": "", + "type": "SnapshotRecordArray" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "Adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 832, + "description": "

This method is used by the store to determine if the store should\nreload a record after the store.findRecord method resolves a\ncached record.

\n

This method is only checked by the store when the store is\nreturning a cached record.

\n

If this method returns true the store will re-fetch a record from\nthe adapter.

\n

For example, if you do not want to fetch complex data over a mobile\nconnection, or if the network is down, you can implement\nshouldBackgroundReloadRecord as follows:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
shouldBackgroundReloadRecord(store, snapshot) {\n  let { downlink, effectiveType } = navigator.connection;\n\n  return downlink > 0 && effectiveType === '4g';\n}
\n
\n
\n \n

By default, this hook returns true so the data for the record is updated\nin the background.

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "shouldBackgroundReloadRecord", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "Adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 869, + "description": "

This method is used by the store to determine if the store should\nreload a record array after the store.findAll method resolves\nwith a cached record array.

\n

This method is only checked by the store when the store is\nreturning a cached record array.

\n

If this method returns true the store will re-fetch all records\nfrom the adapter.

\n

For example, if you do not want to fetch complex data over a mobile\nconnection, or if the network is down, you can implement\nshouldBackgroundReloadAll as follows:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
shouldBackgroundReloadAll(store, snapshotArray) {\n  let { downlink, effectiveType } = navigator.connection;\n\n  return downlink > 0 && effectiveType === '4g';\n}
\n
\n
\n \n

By default this method returns true, indicating that a background reload\nshould always be triggered.

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "shouldBackgroundReloadAll", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "snapshotRecordArray", + "description": "", + "type": "SnapshotRecordArray" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "Adapter" + }, + { + "file": "../packages/adapter/src/-private/build-url-mixin.ts", + "line": 145, + "description": "

Builds a URL for a given type and optional ID.

\n

By default, it pluralizes the type's name (for example, 'post'\nbecomes 'posts' and 'person' becomes 'people'). To override the\npluralization see pathForType.

\n

If an ID is specified, it adds the ID to the path generated\nfor the type, separated by a /.

\n

When called by RESTAdapter.findMany() the id and snapshot parameters\nwill be arrays of ids and snapshots.

\n", + "itemtype": "method", + "name": "buildURL", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelName", + "description": "", + "type": "String" + }, + { + "name": "id", + "description": "single id or array of ids or query", + "type": "(String|Array|Object)" + }, + { + "name": "snapshot", + "description": "single snapshot or array of snapshots", + "type": "(Snapshot|SnapshotRecordArray)" + }, + { + "name": "requestType", + "description": "", + "type": "String" + }, + { + "name": "query", + "description": "object of query parameters to send for query requests.", + "type": "Object" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "BuildURLMixin" + }, + { + "file": "../packages/adapter/src/-private/build-url-mixin.ts", + "line": 294, + "itemtype": "method", + "name": "_buildURL", + "access": "private", + "tagname": "", + "params": [ + { + "name": "modelName", + "description": "", + "type": "String" + }, + { + "name": "id", + "description": "", + "type": "String" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "BuildURLMixin" + }, + { + "file": "../packages/adapter/src/-private/build-url-mixin.ts", + "line": 329, + "description": "

Builds a URL for a store.findRecord(type, id) call.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/user.js
1\n2\n3\n4\n5\n6\n7\n8\n
import JSONAPIAdapter from '@ember-data/adapter/json-api';\n\nexport default class ApplicationAdapter extends JSONAPIAdapter {\n  urlForFindRecord(id, modelName, snapshot) {\n    let baseUrl = this.buildURL(modelName, id, snapshot);\n    return `${baseUrl}/users/${snapshot.adapterOptions.user_id}/playlists/${id}`;\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "urlForFindRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "id", + "description": "", + "type": "String" + }, + { + "name": "modelName", + "description": "", + "type": "String" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "BuildURLMixin" + }, + { + "file": "../packages/adapter/src/-private/build-url-mixin.ts", + "line": 357, + "description": "

Builds a URL for a store.findAll(type) call.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/comment.js
1\n2\n3\n4\n5\n6\n7\n8\n
import JSONAPIAdapter from '@ember-data/adapter/json-api';\n\nexport default class ApplicationAdapter extends JSONAPIAdapter {\n  urlForFindAll(modelName, snapshot) {\n    let baseUrl = this.buildURL(modelName);\n    return `${baseUrl}/data/comments.json`;\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "urlForFindAll", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelName", + "description": "", + "type": "String" + }, + { + "name": "snapshot", + "description": "", + "type": "SnapshotRecordArray" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "BuildURLMixin" + }, + { + "file": "../packages/adapter/src/-private/build-url-mixin.ts", + "line": 383, + "description": "

Builds a URL for a store.query(type, query) call.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import RESTAdapter from '@ember-data/adapter/rest';\n\nexport default class ApplicationAdapter extends RESTAdapter {\n  host = 'https://api.github.com';\n  urlForQuery (query, modelName) {\n    switch(modelName) {\n      case 'repo':\n        return `https://api.github.com/orgs/${query.orgId}/repos`;\n      default:\n        return super.urlForQuery(...arguments);\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "urlForQuery", + "access": "public", + "tagname": "", + "params": [ + { + "name": "query", + "description": "", + "type": "Object" + }, + { + "name": "modelName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "BuildURLMixin" + }, + { + "file": "../packages/adapter/src/-private/build-url-mixin.ts", + "line": 414, + "description": "

Builds a URL for a store.queryRecord(type, query) call.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n
import RESTAdapter from '@ember-data/adapter/rest';\n\nexport default class ApplicationAdapter extends RESTAdapter {\n  urlForQueryRecord({ slug }, modelName) {\n    let baseUrl = this.buildURL();\n    return `${baseUrl}/${encodeURIComponent(slug)}`;\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "urlForQueryRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "query", + "description": "", + "type": "Object" + }, + { + "name": "modelName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "BuildURLMixin" + }, + { + "file": "../packages/adapter/src/-private/build-url-mixin.ts", + "line": 440, + "description": "

Builds a URL for coalescing multiple store.findRecord(type, id)\nrecords into 1 request when the adapter's coalesceFindRequests\nproperty is true.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n
import RESTAdapter from '@ember-data/adapter/rest';\n\nexport default class ApplicationAdapter extends RESTAdapter {\n  urlForFindMany(ids, modelName) {\n    let baseUrl = this.buildURL();\n    return `${baseUrl}/coalesce`;\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "urlForFindMany", + "access": "public", + "tagname": "", + "params": [ + { + "name": "ids", + "description": "", + "type": "Array" + }, + { + "name": "modelName", + "description": "", + "type": "String" + }, + { + "name": "snapshots", + "description": "", + "type": "Array" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "BuildURLMixin" + }, + { + "file": "../packages/adapter/src/-private/build-url-mixin.ts", + "line": 469, + "description": "

Builds a URL for fetching an async hasMany relationship when a URL\nis not provided by the server.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n
import JSONAPIAdapter from '@ember-data/adapter/json-api';\n\nexport default class ApplicationAdapter extends JSONAPIAdapter {\n  urlForFindHasMany(id, modelName, snapshot) {\n    let baseUrl = this.buildURL(modelName, id);\n    return `${baseUrl}/relationships`;\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "urlForFindHasMany", + "access": "public", + "tagname": "", + "params": [ + { + "name": "id", + "description": "", + "type": "String" + }, + { + "name": "modelName", + "description": "", + "type": "String" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "BuildURLMixin" + }, + { + "file": "../packages/adapter/src/-private/build-url-mixin.ts", + "line": 497, + "description": "

Builds a URL for fetching an async belongsTo relationship when a url\nis not provided by the server.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n
import JSONAPIAdapter from '@ember-data/adapter/json-api';\n\nexport default class ApplicationAdapter extends JSONAPIAdapter {\n  urlForFindBelongsTo(id, modelName, snapshot) {\n    let baseUrl = this.buildURL(modelName, id);\n    return `${baseUrl}/relationships`;\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "urlForFindBelongsTo", + "access": "public", + "tagname": "", + "params": [ + { + "name": "id", + "description": "", + "type": "String" + }, + { + "name": "modelName", + "description": "", + "type": "String" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "BuildURLMixin" + }, + { + "file": "../packages/adapter/src/-private/build-url-mixin.ts", + "line": 525, + "description": "

Builds a URL for a record.save() call when the record was created\nlocally using store.createRecord().

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n
import RESTAdapter from '@ember-data/adapter/rest';\n\nexport default class ApplicationAdapter extends RESTAdapter {\n  urlForCreateRecord(modelName, snapshot) {\n    return super.urlForCreateRecord(...arguments) + '/new';\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "urlForCreateRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelName", + "description": "", + "type": "String" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "BuildURLMixin" + }, + { + "file": "../packages/adapter/src/-private/build-url-mixin.ts", + "line": 551, + "description": "

Builds a URL for a record.save() call when the record has been updated locally.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n
import RESTAdapter from '@ember-data/adapter/rest';\n\nexport default class ApplicationAdapter extends RESTAdapter {\n  urlForUpdateRecord(id, modelName, snapshot) {\n    return `/${id}/feed?access_token=${snapshot.adapterOptions.token}`;\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "urlForUpdateRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "id", + "description": "", + "type": "String" + }, + { + "name": "modelName", + "description": "", + "type": "String" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "BuildURLMixin" + }, + { + "file": "../packages/adapter/src/-private/build-url-mixin.ts", + "line": 577, + "description": "

Builds a URL for a record.save() call when the record has been deleted locally.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n
import RESTAdapter from '@ember-data/adapter/rest';\n\nexport default class ApplicationAdapter extends RESTAdapter {\n  urlForDeleteRecord(id, modelName, snapshot) {\n    return super.urlForDeleteRecord(...arguments) + '/destroy';\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "urlForDeleteRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "id", + "description": "", + "type": "String" + }, + { + "name": "modelName", + "description": "", + "type": "String" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "BuildURLMixin" + }, + { + "file": "../packages/adapter/src/-private/build-url-mixin.ts", + "line": 603, + "itemtype": "method", + "name": "urlPrefix", + "access": "private", + "tagname": "", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + }, + { + "name": "parentURL", + "description": "", + "type": "String" + } + ], + "return": { + "description": "urlPrefix", + "type": "String" + }, + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "BuildURLMixin" + }, + { + "file": "../packages/adapter/src/-private/build-url-mixin.ts", + "line": 643, + "description": "

Determines the pathname for a given type.

\n

By default, it pluralizes the type's name (for example,\n'post' becomes 'posts' and 'person' becomes 'people').

\n

Pathname customization

\n

For example, if you have an object LineItem with an\nendpoint of /line_items/.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import RESTAdapter from '@ember-data/adapter/rest';\nimport { decamelize, pluralize } from '<app-name>/utils/string-utils';\n\nexport default class ApplicationAdapter extends RESTAdapter {\n  pathForType(modelName) {\n    var decamelized = decamelize(modelName);\n    return pluralize(decamelized);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "pathForType", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "path", + "type": "String" + }, + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "BuildURLMixin" + } + ], + "events": [], + "properties": [ + { + "file": "../packages/adapter/src/json-api.ts", + "line": 187, + "description": "

By default the JSONAPIAdapter will send each find request coming from a store.find\nor from accessing a relationship separately to the server. If your server supports passing\nids as a query string, you can set coalesceFindRequests to true to coalesce all find requests\nwithin a single runloop.

\n

For example, if you have an initial payload of:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
{\n  data: {\n    id: 1,\n    type: 'post',\n    relationship: {\n      comments: {\n        data: [\n          { id: 1, type: 'comment' },\n          { id: 2, type: 'comment' }\n        ]\n      }\n    }\n  }\n}
\n
\n
\n \n

By default calling post.comments will trigger the following requests(assuming the\ncomments haven't been loaded before):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
GET /comments/1\nGET /comments/2
\n
\n
\n

If you set coalesceFindRequests to true it will instead trigger the following request:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
GET /comments?filter[id]=1,2
\n
\n
\n

Setting coalesceFindRequests to true also works for store.find requests and belongsTo\nrelationships accessed within the same runloop. If you set coalesceFindRequests: true

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
store.findRecord('comment', 1);\nstore.findRecord('comment', 2);
\n
\n
\n \n

will also send a request to: GET /comments?filter[id]=1,2

\n

Note: Requests coalescing rely on URL building strategy. So if you override buildURL in your app\ngroupRecordsForFindMany more likely should be overridden as well in order for coalescing to work.

\n", + "itemtype": "property", + "name": "coalesceFindRequests", + "access": "public", + "tagname": "", + "type": "{boolean}", + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter/json-api" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 343, + "description": "

This property allows ajax to still be used instead when false.

\n", + "itemtype": "property", + "name": "useFetch", + "type": "{Boolean}", + "default": "true", + "access": "public", + "tagname": "", + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter/rest", + "inherited": true, + "inheritedFrom": "RESTAdapter" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 428, + "description": "

By default the RESTAdapter will send each find request coming from a store.find\nor from accessing a relationship separately to the server. If your server supports passing\nids as a query string, you can set coalesceFindRequests to true to coalesce all find requests\nwithin a single runloop.

\n

For example, if you have an initial payload of:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
{\n  post: {\n    id: 1,\n    comments: [1, 2]\n  }\n}
\n
\n
\n \n

By default calling post.comments will trigger the following requests(assuming the\ncomments haven't been loaded before):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
GET /comments/1\nGET /comments/2
\n
\n
\n

If you set coalesceFindRequests to true it will instead trigger the following request:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
GET /comments?ids[]=1&ids[]=2
\n
\n
\n

Setting coalesceFindRequests to true also works for store.find requests and belongsTo\nrelationships accessed within the same runloop. If you set coalesceFindRequests: true

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
store.findRecord('comment', 1);\nstore.findRecord('comment', 2);
\n
\n
\n \n

will also send a request to: GET /comments?ids[]=1&ids[]=2

\n

Note: Requests coalescing rely on URL building strategy. So if you override buildURL in your app\ngroupRecordsForFindMany more likely should be overridden as well in order for coalescing to work.

\n", + "itemtype": "property", + "name": "coalesceFindRequests", + "access": "public", + "tagname": "", + "type": "{boolean}", + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter/rest", + "inherited": true, + "inheritedFrom": "RESTAdapter" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 488, + "description": "

Endpoint paths can be prefixed with a namespace by setting the namespace\nproperty on the adapter:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n
import RESTAdapter from '@ember-data/adapter/rest';\n\nexport default class ApplicationAdapter extends RESTAdapter {\n  namespace = 'api/1';\n}
\n
\n
\n \n

Requests for the Post model would now target /api/1/post/.

\n", + "itemtype": "property", + "name": "namespace", + "access": "public", + "tagname": "", + "type": "{String}", + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter/rest", + "inherited": true, + "inheritedFrom": "RESTAdapter" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 507, + "description": "

An adapter can target other hosts by setting the host property.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n
import RESTAdapter from '@ember-data/adapter/rest';\n\nexport default class ApplicationAdapter extends RESTAdapter {\n  host = 'https://api.example.com';\n}
\n
\n
\n \n

Requests for the Post model would now target https://api.example.com/post/.

\n", + "itemtype": "property", + "name": "host", + "access": "public", + "tagname": "", + "type": "{String}", + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter/rest", + "inherited": true, + "inheritedFrom": "RESTAdapter" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 525, + "description": "

Some APIs require HTTP headers, e.g. to provide an API\nkey. Arbitrary headers can be set as key/value pairs on the\nRESTAdapter's headers object and Ember Data will send them\nalong with each ajax request. For dynamic headers see headers\ncustomization.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import RESTAdapter from '@ember-data/adapter/rest';\nimport { computed } from '@ember/object';\n\nexport default class ApplicationAdapter extends RESTAdapter {\n  headers: computed(function() {\n    return {\n      'API_KEY': 'secret key',\n      'ANOTHER_HEADER': 'Some header value'\n    };\n  })\n}
\n
\n
\n \n", + "itemtype": "property", + "name": "headers", + "access": "public", + "tagname": "", + "type": "{Object}", + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter/rest", + "inherited": true, + "inheritedFrom": "RESTAdapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 645, + "description": "

By default the store will try to coalesce all findRecord calls within the same runloop\ninto as few requests as possible by calling groupRecordsForFindMany and passing it into a findMany call.\nYou can opt out of this behaviour by either not implementing the findMany hook or by setting\ncoalesceFindRequests to false.

\n", + "itemtype": "property", + "name": "coalesceFindRequests", + "access": "public", + "tagname": "", + "type": "{boolean}", + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "Adapter" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-data-5.3.0-RESTAdapter", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/adapter/json-api", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-JSONAPISerializer.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-JSONAPISerializer.json new file mode 100644 index 000000000..c2bba2912 --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-JSONAPISerializer.json @@ -0,0 +1,1955 @@ +{ + "data": { + "id": "ember-data-5.3.0-JSONAPISerializer", + "type": "class", + "attributes": { + "name": "JSONAPISerializer", + "shortname": "JSONAPISerializer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/serializer/json-api", + "namespace": "", + "file": "../serializer/src/json-api.js", + "line": 13, + "description": "
\n

\n ⚠️ This is LEGACY documentation for a feature that is no longer encouraged to be used.\n If starting a new app or thinking of implementing a new adapter, consider writing a\n Handler instead to be used with the RequestManager\n

\n
\n\n

In EmberData a Serializer is used to serialize and deserialize\n records when they are transferred in and out of an external source.\n This process involves normalizing property names, transforming\n attribute values and serializing relationships.

\n

JSONAPISerializer supports the http://jsonapi.org/ spec and is the\n serializer recommended by Ember Data.

\n

This serializer normalizes a JSON API payload that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/models/player.js
1\n2\n3\n4\n5\n6\n
 import Model, { attr, belongsTo } from '@ember-data/model';\n\n export default class Player extends Model {\n  @attr('string') location;\n  @belongsto('club') club;\n }
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/models/club.js
1\n2\n3\n4\n5\n
 import Model, { attr, hasMany } from '@ember-data/model';\n\n export default class Club extends Model {\n  @hasmany('player') players;\n }
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
   {\n     "data": [\n       {\n         "attributes": {\n           "name": "Benfica",\n           "location": "Portugal"\n         },\n         "id": "1",\n         "relationships": {\n           "players": {\n             "data": [\n               {\n                 "id": "3",\n                 "type": "players"\n               }\n             ]\n           }\n         },\n         "type": "clubs"\n       }\n     ],\n     "included": [\n       {\n         "attributes": {\n           "name": "Eusebio Silva Ferreira",\n           "skill": "Rocket shot",\n           "games-played": 431\n         },\n         "id": "3",\n         "relationships": {\n           "club": {\n             "data": {\n               "id": "1",\n               "type": "clubs"\n             }\n           }\n         },\n         "type": "players"\n       }\n     ]\n   }
\n
\n
\n \n

to the format that the Ember Data store expects.

\n

Customizing meta

\n

Since a JSON API Document can have meta defined in multiple locations you can\n use the specific serializer hooks if you need to customize the meta.

\n

One scenario would be to camelCase the meta keys of your payload. The example\n below shows how this could be done using normalizeArrayResponse and\n extractRelationship.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
 import JSONAPISerializer from '@ember-data/serializer/json-api';\n\n export default class ApplicationSerializer extends JSONAPISerializer {\n   normalizeArrayResponse(store, primaryModelClass, payload, id, requestType) {\n     let normalizedDocument = super.normalizeArrayResponse(...arguments);\n\n     // Customize document meta\n     normalizedDocument.meta = camelCaseKeys(normalizedDocument.meta);\n\n     return normalizedDocument;\n   }\n\n   extractRelationship(relationshipHash) {\n     let normalizedRelationship = super.extractRelationship(...arguments);\n\n     // Customize relationship meta\n     normalizedRelationship.meta = camelCaseKeys(normalizedRelationship.meta);\n\n     return normalizedRelationship;\n   }\n }
\n
\n
\n \n

@mainName @ember-data/serializer/json-api\n @tag main

\n", + "_main": true, + "since": "1.13.0", + "access": "public", + "tagname": "", + "extends": "JSONSerializer", + "methods": [ + { + "file": "../packages/serializer/src/json-api.js", + "line": 139, + "itemtype": "method", + "name": "_normalizeDocumentHelper", + "params": [ + { + "name": "documentHash", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "private", + "tagname": "", + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json-api" + }, + { + "file": "../packages/serializer/src/json-api.js", + "line": 176, + "itemtype": "method", + "name": "_normalizeRelationshipDataHelper", + "params": [ + { + "name": "relationshipDataHash", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "private", + "tagname": "", + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json-api" + }, + { + "file": "../packages/serializer/src/json-api.js", + "line": 188, + "itemtype": "method", + "name": "_normalizeResourceHelper", + "params": [ + { + "name": "resourceHash", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "private", + "tagname": "", + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json-api" + }, + { + "file": "../packages/serializer/src/json-api.js", + "line": 215, + "description": "

Normalize some data and push it into the store.

\n", + "itemtype": "method", + "name": "pushPayload", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "payload", + "description": "", + "type": "Object" + } + ], + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json-api" + }, + { + "file": "../packages/serializer/src/json-api.js", + "line": 228, + "itemtype": "method", + "name": "_normalizeResponse", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + }, + { + "name": "isSingle", + "description": "", + "type": "Boolean" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "access": "private", + "tagname": "", + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json-api" + }, + { + "file": "../packages/serializer/src/json-api.js", + "line": 278, + "description": "

Returns a relationship formatted as a JSON-API "relationship object".

\n

http://jsonapi.org/format/#document-resource-object-relationships

\n", + "itemtype": "method", + "name": "extractRelationship", + "access": "public", + "tagname": "", + "params": [ + { + "name": "relationshipHash", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json-api" + }, + { + "file": "../packages/serializer/src/json-api.js", + "line": 305, + "description": "

Returns the resource's relationships formatted as a JSON-API "relationships object".

\n

http://jsonapi.org/format/#document-resource-object-relationships

\n", + "itemtype": "method", + "name": "extractRelationships", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelClass", + "description": "", + "type": "Object" + }, + { + "name": "resourceHash", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json-api" + }, + { + "file": "../packages/serializer/src/json-api.js", + "line": 343, + "itemtype": "method", + "name": "_extractType", + "params": [ + { + "name": "modelClass", + "description": "", + "type": "Model" + }, + { + "name": "resourceHash", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "String" + }, + "access": "private", + "tagname": "", + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json-api" + }, + { + "file": "../packages/serializer/src/json-api.js", + "line": 354, + "description": "

Dasherizes and singularizes the model name in the payload to match\nthe format Ember Data uses internally for the model name.

\n

For example the key posts would be converted to post and the\nkey studentAssesments would be converted to student-assesment.

\n", + "itemtype": "method", + "name": "modelNameFromPayloadKey", + "access": "public", + "tagname": "", + "params": [ + { + "name": "key", + "description": "", + "type": "String" + } + ], + "return": { + "description": "the model's modelName", + "type": "String" + }, + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json-api" + }, + { + "file": "../packages/serializer/src/json-api.js", + "line": 370, + "description": "

Converts the model name to a pluralized version of the model name.

\n

For example post would be converted to posts and\nstudent-assesment would be converted to student-assesments.

\n", + "itemtype": "method", + "name": "payloadKeyFromModelName", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "String" + }, + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json-api" + }, + { + "file": "../packages/serializer/src/json-api.js", + "line": 406, + "description": "

keyForAttribute can be used to define rules for how to convert an\nattribute name in your model to a key in your JSON.\nBy default JSONAPISerializer follows the format used on the examples of\nhttp://jsonapi.org/format and uses dashes as the word separator in the JSON\nattribute keys.

\n

This behaviour can be easily customized by extending this method.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/application.js
1\n2\n3\n4\n5\n6\n7\n8\n
import JSONAPISerializer from '@ember-data/serializer/json-api';\nimport { dasherize } from '<app-name>/utils/string-utils';\n\nexport default class ApplicationSerializer extends JSONAPISerializer {\n  keyForAttribute(attr, method) {\n    return dasherize(attr).toUpperCase();\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "keyForAttribute", + "access": "public", + "tagname": "", + "params": [ + { + "name": "key", + "description": "", + "type": "String" + }, + { + "name": "method", + "description": "", + "type": "String" + } + ], + "return": { + "description": "normalized key", + "type": "String" + }, + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json-api" + }, + { + "file": "../packages/serializer/src/json-api.js", + "line": 438, + "description": "

keyForRelationship can be used to define a custom key when\nserializing and deserializing relationship properties.\nBy default JSONAPISerializer follows the format used on the examples of\nhttp://jsonapi.org/format and uses dashes as word separators in\nrelationship properties.

\n

This behaviour can be easily customized by extending this method.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/post.js
1\n2\n3\n4\n5\n6\n7\n8\n
 import JSONAPISerializer from '@ember-data/serializer/json-api';\n import { underscore } from '<app-name>/utils/string-utils';\n\n export default class ApplicationSerializer extends JSONAPISerializer {\n   keyForRelationship(key, relationship, method) {\n     return underscore(key);\n   }\n }
\n
\n
\n \n", + "itemtype": "method", + "name": "keyForRelationship", + "access": "public", + "tagname": "", + "params": [ + { + "name": "key", + "description": "", + "type": "String" + }, + { + "name": "typeClass", + "description": "", + "type": "String" + }, + { + "name": "method", + "description": "", + "type": "String" + } + ], + "return": { + "description": "normalized key", + "type": "String" + }, + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json-api" + }, + { + "file": "../packages/serializer/src/json-api.js", + "line": 470, + "itemtype": "method", + "description": "

Called when a record is saved in order to convert the\nrecord into JSON.

\n

For example, consider this model:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/models/comment.js
1\n2\n3\n4\n5\n6\n7\n
import Model, { attr, belongsTo } from '@ember-data/model';\n\nexport default class CommentModel extends Model {\n  @attr body;\n  @belongsto('user', { async: false, inverse: null })\n  author;\n}
\n
\n
\n \n

The default serialization would create a JSON-API resource object like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
{\n  "data": {\n    "type": "comments",\n    "attributes": {\n      "title": "Rails is unagi",\n      "body": "Rails? Omakase? O_O",\n    },\n    "relationships": {\n      "author": {\n        "data": {\n          "id": "12",\n          "type": "users"\n        }\n      }\n    }\n  }\n}
\n
\n
\n \n

By default, attributes are passed through as-is, unless\nyou specified an attribute type (attr('date')). If\nyou specify a transform, the JavaScript value will be\nserialized when inserted into the attributes hash.

\n

Belongs-to relationships are converted into JSON-API\nresource identifier objects.

\n

IDs

\n

serialize takes an options hash with a single option:\nincludeId. If this option is true, serialize will,\nby default include the ID in the JSON object it builds.

\n

The JSONAPIAdapter passes in includeId: true when serializing a record\nfor createRecord or updateRecord.

\n

Customization

\n

Your server may expect data in a different format than the\nbuilt-in serialization format.

\n

In that case, you can implement serialize yourself and\nreturn data formatted to match your API's expectations, or override\nthe invoked adapter method and do the serialization in the adapter directly\nby using the provided snapshot.

\n

If your API's format differs greatly from the JSON:API spec, you should\nconsider authoring your own adapter and serializer instead of extending\nthis class.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import JSONAPISerializer from '@ember-data/serializer/json-api';\n\nexport default class PostSerializer extends JSONAPISerializer {\n  serialize(snapshot, options) {\n    let json = {\n      POST_TTL: snapshot.attr('title'),\n      POST_BDY: snapshot.attr('body'),\n      POST_CMS: snapshot.hasMany('comments', { ids: true })\n    };\n\n    if (options.includeId) {\n      json.POST_ID_ = snapshot.id;\n    }\n\n    return json;\n  }\n}
\n
\n
\n \n

Customizing an App-Wide Serializer

\n

If you want to define a serializer for your entire\napplication, you'll probably want to use eachAttribute\nand eachRelationship on the record.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n
import JSONAPISerializer from '@ember-data/serializer/json-api';\nimport { underscore, singularize } from '<app-name>/utils/string-utils';\n\nexport default class ApplicationSerializer extends JSONAPISerializer {\n  serialize(snapshot, options) {\n    let json = {};\n\n    snapshot.eachAttribute((name) => {\n      json[serverAttributeName(name)] = snapshot.attr(name);\n    });\n\n    snapshot.eachRelationship((name, relationship) => {\n      if (relationship.kind === 'hasMany') {\n        json[serverHasManyName(name)] = snapshot.hasMany(name, { ids: true });\n      }\n    });\n\n    if (options.includeId) {\n      json.ID_ = snapshot.id;\n    }\n\n    return json;\n  }\n}\n\nfunction serverAttributeName(attribute) {\n  return underscore(attribute).toUpperCase();\n}\n\nfunction serverHasManyName(name) {\n  return serverAttributeName(singularize(name)) + '_IDS';\n}
\n
\n
\n \n

This serializer will generate JSON that looks like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
{\n  "TITLE": "Rails is omakase",\n  "BODY": "Yep. Omakase.",\n  "COMMENT_IDS": [ "1", "2", "3" ]\n}
\n
\n
\n \n

Tweaking the Default Formatting

\n

If you just want to do some small tweaks on the default JSON:API formatted response,\nyou can call super.serialize first and make the tweaks\non the returned object.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import JSONAPISerializer from '@ember-data/serializer/json-api';\n\nexport default class PostSerializer extends JSONAPISerializer {\n  serialize(snapshot, options) {\n    let json = super.serialize(...arguments);\n\n    json.data.attributes.subject = json.data.attributes.title;\n    delete json.data.attributes.title;\n\n    return json;\n  }\n}
\n
\n
\n \n", + "name": "serialize", + "access": "public", + "tagname": "", + "params": [ + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "json", + "type": "Object" + }, + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json-api" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 189, + "description": "

Given a subclass of Model and a JSON object this method will\niterate through each attribute of the Model and invoke the\nTransform#deserialize method on the matching property of the\nJSON object. This method is typically called after the\nserializer's normalize method.

\n", + "itemtype": "method", + "name": "applyTransforms", + "access": "private", + "tagname": "", + "params": [ + { + "name": "typeClass", + "description": "", + "type": "Model" + }, + { + "name": "data", + "description": "The data to transform", + "type": "Object" + } + ], + "return": { + "description": "data The transformed data object", + "type": "Object" + }, + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 218, + "description": "

The normalizeResponse method is used to normalize a payload from the\nserver to a JSON-API Document.

\n

http://jsonapi.org/format/#document-structure

\n

This method delegates to a more specific normalize method based on\nthe requestType.

\n

To override this method with a custom one, make sure to call\nreturn super.normalizeResponse(store, primaryModelClass, payload, id, requestType) with your\npre-processed data.

\n

Here's an example of using normalizeResponse manually:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
socket.on('message', function(message) {\n  let data = message.data;\n  let modelClass = store.modelFor(data.modelName);\n  let serializer = store.serializerFor(data.modelName);\n  let normalized = serializer.normalizeSingleResponse(store, modelClass, data, data.id);\n\n  store.push(normalized);\n});
\n
\n
\n \n", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 279, + "description": "

Called by the default normalizeResponse implementation when the\ntype of request is findRecord

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeFindRecordResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 297, + "description": "

Called by the default normalizeResponse implementation when the\ntype of request is queryRecord

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeQueryRecordResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 315, + "description": "

Called by the default normalizeResponse implementation when the\ntype of request is findAll

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeFindAllResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 333, + "description": "

Called by the default normalizeResponse implementation when the\ntype of request is findBelongsTo

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeFindBelongsToResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 351, + "description": "

Called by the default normalizeResponse implementation when the\ntype of request is findHasMany

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeFindHasManyResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 369, + "description": "

Called by the default normalizeResponse implementation when the\ntype of request is findMany

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeFindManyResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 387, + "description": "

Called by the default normalizeResponse implementation when the\ntype of request is query

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeQueryResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 405, + "description": "

Called by the default normalizeResponse implementation when the\ntype of request is createRecord

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeCreateRecordResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 423, + "description": "

Called by the default normalizeResponse implementation when the\ntype of request is deleteRecord

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeDeleteRecordResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 441, + "description": "

Called by the default normalizeResponse implementation when the\ntype of request is updateRecord

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeUpdateRecordResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 459, + "description": "

normalizeUpdateRecordResponse, normalizeCreateRecordResponse and\nnormalizeDeleteRecordResponse delegate to this method by default.

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeSaveResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 477, + "description": "

normalizeQueryResponse and normalizeFindRecordResponse delegate to this\nmethod by default.

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeSingleResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 495, + "description": "

normalizeQueryResponse, normalizeFindManyResponse, and normalizeFindHasManyResponse delegate\nto this method by default.

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeArrayResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 513, + "itemtype": "method", + "name": "_normalizeResponse", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + }, + { + "name": "isSingle", + "description": "", + "type": "Boolean" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "access": "private", + "tagname": "", + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 562, + "description": "

Normalizes a part of the JSON payload returned by\nthe server. You should override this method, munge the hash\nand call super if you have generic normalization to do.

\n

It takes the type of the record that is being normalized\n(as a Model class), the property where the hash was\noriginally found, and the hash to normalize.

\n

You can use this method, for example, to normalize underscored keys to camelized\nor other general-purpose normalizations.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import JSONSerializer from '@ember-data/serializer/json';\nimport { underscore } from '<app-name>/utils/string-utils';\nimport { get } from '@ember/object';\n\nexport default class ApplicationSerializer extends JSONSerializer {\n  normalize(typeClass, hash) {\n    let fields = typeClass.fields;\n\n    fields.forEach(function(type, field) {\n      let payloadField = underscore(field);\n      if (field === payloadField) { return; }\n\n      hash[field] = hash[payloadField];\n      delete hash[payloadField];\n    });\n\n    return super.normalize(...arguments);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "normalize", + "access": "public", + "tagname": "", + "params": [ + { + "name": "typeClass", + "description": "", + "type": "Model" + }, + { + "name": "hash", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 626, + "description": "

Returns the resource's ID.

\n", + "itemtype": "method", + "name": "extractId", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelClass", + "description": "", + "type": "Object" + }, + { + "name": "resourceHash", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "String" + }, + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 641, + "description": "

Returns the resource's attributes formatted as a JSON-API "attributes object".

\n

http://jsonapi.org/format/#document-resource-object-attributes

\n", + "itemtype": "method", + "name": "extractAttributes", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelClass", + "description": "", + "type": "Object" + }, + { + "name": "resourceHash", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 666, + "description": "

Returns a relationship formatted as a JSON-API "relationship object".

\n

http://jsonapi.org/format/#document-resource-object-relationships

\n", + "itemtype": "method", + "name": "extractRelationship", + "access": "public", + "tagname": "", + "params": [ + { + "name": "relationshipModelName", + "description": "", + "type": "Object" + }, + { + "name": "relationshipHash", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 701, + "description": "

Returns a polymorphic relationship formatted as a JSON-API "relationship object".

\n

http://jsonapi.org/format/#document-resource-object-relationships

\n

relationshipOptions is a hash which contains more information about the\npolymorphic relationship which should be extracted:

\n
    \n
  • resourceHash complete hash of the resource the relationship should be\nextracted from
  • \n
  • relationshipKey key under which the value for the relationship is\nextracted from the resourceHash
  • \n
  • relationshipMeta meta information about the relationship
  • \n
\n", + "itemtype": "method", + "name": "extractPolymorphicRelationship", + "access": "public", + "tagname": "", + "params": [ + { + "name": "relationshipModelName", + "description": "", + "type": "Object" + }, + { + "name": "relationshipHash", + "description": "", + "type": "Object" + }, + { + "name": "relationshipOptions", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 725, + "description": "

Returns the resource's relationships formatted as a JSON-API "relationships object".

\n

http://jsonapi.org/format/#document-resource-object-relationships

\n", + "itemtype": "method", + "name": "extractRelationships", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelClass", + "description": "", + "type": "Object" + }, + { + "name": "resourceHash", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 797, + "description": "

Dasherizes the model name in the payload

\n", + "itemtype": "method", + "name": "modelNameFromPayloadKey", + "access": "public", + "tagname": "", + "params": [ + { + "name": "key", + "description": "", + "type": "String" + } + ], + "return": { + "description": "the model's modelName", + "type": "String" + }, + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 809, + "itemtype": "method", + "name": "normalizeRelationships", + "access": "private", + "tagname": "", + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 832, + "itemtype": "method", + "name": "normalizeUsingDeclaredMapping", + "access": "private", + "tagname": "", + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 865, + "description": "

Looks up the property key that was set by the custom attr mapping\npassed to the serializer.

\n", + "itemtype": "method", + "name": "_getMappedKey", + "access": "private", + "tagname": "", + "params": [ + { + "name": "key", + "description": "", + "type": "String" + } + ], + "return": { + "description": "key", + "type": "String" + }, + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 904, + "description": "

Check attrs.key.serialize property to inform if the key\ncan be serialized

\n", + "itemtype": "method", + "name": "_canSerialize", + "access": "private", + "tagname": "", + "params": [ + { + "name": "key", + "description": "", + "type": "String" + } + ], + "return": { + "description": "true if the key can be serialized", + "type": "Boolean" + }, + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 919, + "description": "

When attrs.key.serialize is set to true then\nit takes priority over the other checks and the related\nattribute/relationship will be serialized

\n", + "itemtype": "method", + "name": "_mustSerialize", + "access": "private", + "tagname": "", + "params": [ + { + "name": "key", + "description": "", + "type": "String" + } + ], + "return": { + "description": "true if the key must be serialized", + "type": "Boolean" + }, + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 935, + "description": "

Check if the given hasMany relationship should be serialized

\n

By default only many-to-many and many-to-none relationships are serialized.\nThis could be configured per relationship by Serializer's attrs object.

\n", + "itemtype": "method", + "name": "shouldSerializeHasMany", + "access": "public", + "tagname": "", + "params": [ + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "key", + "description": "", + "type": "String" + }, + { + "name": "relationship", + "description": "", + "type": "RelationshipSchema" + } + ], + "return": { + "description": "true if the hasMany relationship should be serialized", + "type": "Boolean" + }, + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 958, + "itemtype": "method", + "description": "

Called when a record is saved in order to convert the\nrecord into JSON.

\n

By default, it creates a JSON object with a key for\neach attribute and belongsTo relationship.

\n

For example, consider this model:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/models/comment.js
1\n2\n3\n4\n5\n6\n
import Model, { attr, belongsTo } from '@ember-data/model';\n\nexport default class CommentModel extends Model {\n  @attr body;\n  @belongsto('user') author;\n}
\n
\n
\n \n

The default serialization would create a JSON object like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
{\n  "title": "Rails is unagi",\n  "body": "Rails? Omakase? O_O",\n  "author": 12\n}
\n
\n
\n \n

By default, attributes are passed through as-is, unless\nyou specified an attribute type (attr('date')). If\nyou specify a transform, the JavaScript value will be\nserialized when inserted into the JSON hash.

\n

By default, belongs-to relationships are converted into\nIDs when inserted into the JSON hash.

\n

IDs

\n

serialize takes an options hash with a single option:\nincludeId. If this option is true, serialize will,\nby default include the ID in the JSON object it builds.

\n

The adapter passes in includeId: true when serializing\na record for createRecord, but not for updateRecord.

\n

Customization

\n

Your server may expect a different JSON format than the\nbuilt-in serialization format.

\n

In that case, you can implement serialize yourself and\nreturn a JSON hash of your choosing.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import JSONSerializer from '@ember-data/serializer/json';\n\nexport default class PostSerializer extends JSONSerializer {\n  serialize(snapshot, options) {\n    let json = {\n      POST_TTL: snapshot.attr('title'),\n      POST_BDY: snapshot.attr('body'),\n      POST_CMS: snapshot.hasMany('comments', { ids: true })\n    };\n\n    if (options.includeId) {\n      json.POST_ID_ = snapshot.id;\n    }\n\n    return json;\n  }\n}
\n
\n
\n \n

Customizing an App-Wide Serializer

\n

If you want to define a serializer for your entire\napplication, you'll probably want to use eachAttribute\nand eachRelationship on the record.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n
import JSONSerializer from '@ember-data/serializer/json';\nimport { singularize } from '<app-name>/utils/string-utils';\n\nexport default class ApplicationSerializer extends JSONSerializer {\n  serialize(snapshot, options) {\n    let json = {};\n\n    snapshot.eachAttribute((name) => {\n      json[serverAttributeName(name)] = snapshot.attr(name);\n    });\n\n    snapshot.eachRelationship((name, relationship) => {\n      if (relationship.kind === 'hasMany') {\n        json[serverHasManyName(name)] = snapshot.hasMany(name, { ids: true });\n      }\n    });\n\n    if (options.includeId) {\n      json.ID_ = snapshot.id;\n    }\n\n    return json;\n  }\n}\n\nfunction serverAttributeName(attribute) {\n  return attribute.underscore().toUpperCase();\n}\n\nfunction serverHasManyName(name) {\n  return serverAttributeName(singularize(name)) + "_IDS";\n}
\n
\n
\n \n

This serializer will generate JSON that looks like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
{\n  "TITLE": "Rails is omakase",\n  "BODY": "Yep. Omakase.",\n  "COMMENT_IDS": [ "1", "2", "3" ]\n}
\n
\n
\n \n

Tweaking the Default JSON

\n

If you just want to do some small tweaks on the default JSON,\nyou can call super.serialize first and make the tweaks on\nthe returned JSON.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import JSONSerializer from '@ember-data/serializer/json';\n\nexport default class PostSerializer extends JSONSerializer {\n  serialize(snapshot, options) {\n    let json = super.serialize(...arguments);\n\n    json.subject = json.title;\n    delete json.title;\n\n    return json;\n  }\n}
\n
\n
\n \n", + "name": "serialize", + "access": "public", + "tagname": "", + "params": [ + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "json", + "type": "Object" + }, + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 1136, + "description": "

You can use this method to customize how a serialized record is added to the complete\nJSON hash to be sent to the server. By default the JSON Serializer does not namespace\nthe payload and just sends the raw serialized JSON object.\nIf your server expects namespaced keys, you should consider using the RESTSerializer.\nOtherwise you can override this method to customize how the record is added to the hash.\nThe hash property should be modified by reference.

\n

For example, your server may expect underscored root objects.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import RESTSerializer from '@ember-data/serializer/rest';\nimport { decamelize } from '<app-name>/utils/string-utils';\n\nexport default class ApplicationSerializer extends RESTSerializer {\n  serializeIntoHash(data, type, snapshot, options) {\n    let root = decamelize(type.modelName);\n    data[root] = this.serialize(snapshot, options);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "serializeIntoHash", + "access": "public", + "tagname": "", + "params": [ + { + "name": "hash", + "description": "", + "type": "Object" + }, + { + "name": "typeClass", + "description": "", + "type": "Model" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 1169, + "description": "

serializeAttribute can be used to customize how attr\nproperties are serialized

\n

For example if you wanted to ensure all your attributes were always\nserialized as properties on an attributes object you could\nwrite:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/application.js
1\n2\n3\n4\n5\n6\n7\n8\n
import JSONSerializer from '@ember-data/serializer/json';\n\nexport default class ApplicationSerializer extends JSONSerializer {\n  serializeAttribute(snapshot, json, key, attributes) {\n    json.attributes = json.attributes || {};\n    super.serializeAttribute(snapshot, json.attributes, key, attributes);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "serializeAttribute", + "access": "public", + "tagname": "", + "params": [ + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "json", + "description": "", + "type": "Object" + }, + { + "name": "key", + "description": "", + "type": "String" + }, + { + "name": "attribute", + "description": "", + "type": "Object" + } + ], + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 1217, + "description": "

serializeBelongsTo can be used to customize how belongsTo\nproperties are serialized.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import JSONSerializer from '@ember-data/serializer/json';\n\nexport default class PostSerializer extends JSONSerializer {\n  serializeBelongsTo(snapshot, json, relationship) {\n    let key = relationship.key;\n    let belongsTo = snapshot.belongsTo(key);\n\n    key = this.keyForRelationship ? this.keyForRelationship(key, "belongsTo", "serialize") : key;\n\n    json[key] = !belongsTo ? null : belongsTo.record.toJSON();\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "serializeBelongsTo", + "access": "public", + "tagname": "", + "params": [ + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "json", + "description": "", + "type": "Object" + }, + { + "name": "relationship", + "description": "", + "type": "Object" + } + ], + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 1271, + "description": "

serializeHasMany can be used to customize how hasMany\nproperties are serialized.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import JSONSerializer from '@ember-data/serializer/json';\n\nexport default class PostSerializer extends JSONSerializer {\n  serializeHasMany(snapshot, json, relationship) {\n    let key = relationship.key;\n    if (key === 'comments') {\n      return;\n    } else {\n      super.serializeHasMany(...arguments);\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "serializeHasMany", + "access": "public", + "tagname": "", + "params": [ + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "json", + "description": "", + "type": "Object" + }, + { + "name": "relationship", + "description": "", + "type": "Object" + } + ], + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 1318, + "description": "

You can use this method to customize how polymorphic objects are\nserialized. Objects are considered to be polymorphic if\n{ polymorphic: true } is pass as the second argument to the\nbelongsTo function.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/comment.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import JSONSerializer from '@ember-data/serializer/json';\n\nexport default class CommentSerializer extends JSONSerializer {\n  serializePolymorphicType(snapshot, json, relationship) {\n    let key = relationship.key;\n    let belongsTo = snapshot.belongsTo(key);\n\n    key = this.keyForAttribute ? this.keyForAttribute(key, 'serialize') : key;\n\n    if (!belongsTo) {\n      json[key + '_type'] = null;\n    } else {\n      json[key + '_type'] = belongsTo.modelName;\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "serializePolymorphicType", + "access": "public", + "tagname": "", + "params": [ + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "json", + "description": "", + "type": "Object" + }, + { + "name": "relationship", + "description": "", + "type": "Object" + } + ], + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 1353, + "description": "

extractMeta is used to deserialize any meta information in the\nadapter payload. By default Ember Data expects meta information to\nbe located on the meta property of the payload object.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import JSONSerializer from '@ember-data/serializer/json';\n\nexport default class PostSerializer extends JSONSerializer {\n  extractMeta(store, typeClass, payload) {\n    if (payload && payload.hasOwnProperty('_pagination')) {\n      let meta = payload._pagination;\n      delete payload._pagination;\n      return meta;\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "extractMeta", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "modelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + } + ], + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 1388, + "description": "

extractErrors is used to extract model errors when a call\nto Model#save fails with an InvalidError. By default\nEmber Data expects error information to be located on the errors\nproperty of the payload object.

\n

This serializer expects this errors object to be an Array similar\nto the following, compliant with the https://jsonapi.org/format/#errors specification:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
{\n  "errors": [\n    {\n      "detail": "This username is already taken!",\n      "source": {\n        "pointer": "data/attributes/username"\n      }\n    }, {\n      "detail": "Doesn't look like a valid email.",\n      "source": {\n        "pointer": "data/attributes/email"\n      }\n    }\n  ]\n}
\n
\n
\n \n

The key detail provides a textual description of the problem.\nAlternatively, the key title can be used for the same purpose.

\n

The nested keys source.pointer detail which specific element\nof the request data was invalid.

\n

Note that JSON-API also allows for object-level errors to be placed\nin an object with pointer data, signifying that the problem\ncannot be traced to a specific attribute:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
{\n  "errors": [\n    {\n      "detail": "Some generic non property error message",\n      "source": {\n        "pointer": "data"\n      }\n    }\n  ]\n}
\n
\n
\n \n

When turn into a Errors object, you can read these errors\nthrough the property base:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
{{#each @model.errors.base as |error|}}\n  <div class="error">\n    {{error.message}}\n  </div>\n{{/each}}
\n
\n
\n \n

Example of alternative implementation, overriding the default\nbehavior to deal with a different format of errors:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import JSONSerializer from '@ember-data/serializer/json';\n\nexport default class PostSerializer extends JSONSerializer {\n  extractErrors(store, typeClass, payload, id) {\n    if (payload && typeof payload === 'object' && payload._problems) {\n      payload = payload._problems;\n      this.normalizeErrors(typeClass, payload);\n    }\n    return payload;\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "extractErrors", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "typeClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "(String|Number)" + } + ], + "return": { + "description": "json The deserialized errors", + "type": "Object" + }, + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 1523, + "description": "

keyForAttribute can be used to define rules for how to convert an\nattribute name in your model to a key in your JSON.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/application.js
1\n2\n3\n4\n5\n6\n7\n8\n
import JSONSerializer from '@ember-data/serializer/json';\nimport { underscore } from '<app-name>/utils/string-utils';\n\nexport default class ApplicationSerializer extends JSONSerializer {\n  keyForAttribute(attr, method) {\n    return underscore(attr).toUpperCase();\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "keyForAttribute", + "access": "public", + "tagname": "", + "params": [ + { + "name": "key", + "description": "", + "type": "String" + }, + { + "name": "method", + "description": "", + "type": "String" + } + ], + "return": { + "description": "normalized key", + "type": "String" + }, + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 1550, + "description": "

keyForRelationship can be used to define a custom key when\nserializing and deserializing relationship properties. By default\nJSONSerializer does not provide an implementation of this method.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/post.js
1\n2\n3\n4\n5\n6\n7\n8\n
  import JSONSerializer from '@ember-data/serializer/json';\n  import { underscore } from '<app-name>/utils/string-utils';\n\n  export default class PostSerializer extends JSONSerializer {\n    keyForRelationship(key, relationship, method) {\n      return `rel_${underscore(key)}`;\n    }\n  }
\n
\n
\n \n", + "itemtype": "method", + "name": "keyForRelationship", + "access": "public", + "tagname": "", + "params": [ + { + "name": "key", + "description": "", + "type": "String" + }, + { + "name": "typeClass", + "description": "", + "type": "String" + }, + { + "name": "method", + "description": "", + "type": "String" + } + ], + "return": { + "description": "normalized key", + "type": "String" + }, + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 1579, + "description": "

keyForLink can be used to define a custom key when deserializing link\nproperties.

\n", + "itemtype": "method", + "name": "keyForLink", + "access": "public", + "tagname": "", + "params": [ + { + "name": "key", + "description": "", + "type": "String" + }, + { + "name": "kind", + "description": "`belongsTo` or `hasMany`", + "type": "String" + } + ], + "return": { + "description": "normalized key", + "type": "String" + }, + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 1595, + "itemtype": "method", + "name": "transformFor", + "access": "private", + "tagname": "", + "params": [ + { + "name": "attributeType", + "description": "", + "type": "String" + }, + { + "name": "skipAssertion", + "description": "", + "type": "Boolean" + } + ], + "return": { + "description": "transform", + "type": "Transform" + }, + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/index.ts", + "line": 163, + "description": "

The normalizeResponse method is used to normalize a payload from the\nserver to a JSON-API Document.

\n

http://jsonapi.org/format/#document-structure

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
Serializer.extend({\n  normalizeResponse(store, primaryModelClass, payload, id, requestType) {\n    if (requestType === 'findRecord') {\n      return this.normalize(primaryModelClass, payload);\n    } else {\n      return payload.reduce(function(documentHash, item) {\n        let { data, included } = this.normalize(primaryModelClass, item);\n        documentHash.included.push(...included);\n        documentHash.data.push(data);\n        return documentHash;\n      }, { data: [], included: [] })\n    }\n  }\n});
\n
\n
\n \n", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "JSONAPISerializer", + "module": "@ember-data/serializer", + "inherited": true, + "inheritedFrom": "Serializer" + }, + { + "file": "../packages/serializer/src/index.ts", + "line": 199, + "description": "

The serialize method is used when a record is saved in order to convert\nthe record into the form that your external data source expects.

\n

serialize takes an optional options hash with a single option:

\n
    \n
  • includeId: If this is true, serialize should include the ID\nin the serialized object it builds.
  • \n
\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
Serializer.extend({\n  serialize(snapshot, options) {\n    let json = {\n      id: snapshot.id\n    };\n\n    snapshot.eachAttribute((key, attribute) => {\n      json[key] = snapshot.attr(key);\n    });\n\n    snapshot.eachRelationship((key, relationship) => {\n      if (relationship.kind === 'belongsTo') {\n        json[key] = snapshot.belongsTo(key, { id: true });\n      } else if (relationship.kind === 'hasMany') {\n        json[key] = snapshot.hasMany(key, { ids: true });\n      }\n    });\n\n    return json;\n  },\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "serialize", + "access": "public", + "tagname": "", + "params": [ + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "options", + "description": "", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "JSONAPISerializer", + "module": "@ember-data/serializer", + "inherited": true, + "inheritedFrom": "Serializer" + }, + { + "file": "../packages/serializer/src/index.ts", + "line": 241, + "description": "

The normalize method is used to convert a payload received from your\nexternal data source into the normalized form store.push() expects. You\nshould override this method, munge the hash and return the normalized\npayload.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
Serializer.extend({\n  normalize(modelClass, resourceHash) {\n    let data = {\n      id:            resourceHash.id,\n      type:          modelClass.modelName,\n      attributes:    resourceHash\n    };\n    return { data: data };\n  }\n})
\n
\n
\n \n", + "itemtype": "method", + "name": "normalize", + "access": "public", + "tagname": "", + "params": [ + { + "name": "typeClass", + "description": "", + "type": "Model" + }, + { + "name": "hash", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "JSONAPISerializer", + "module": "@ember-data/serializer", + "inherited": true, + "inheritedFrom": "Serializer" + } + ], + "events": [], + "properties": [ + { + "file": "../packages/serializer/src/json.js", + "line": 95, + "description": "

The primaryKey is used when serializing and deserializing\ndata. Ember Data always uses the id property to store the id of\nthe record. The external source may not always follow this\nconvention. In these cases it is useful to override the\nprimaryKey property to match the primaryKey of your external\nstore.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/application.js
1\n2\n3\n4\n5\n
import JSONSerializer from '@ember-data/serializer/json';\n\nexport default class ApplicationSerializer extends JSONSerializer {\n  primaryKey = '_id'\n}
\n
\n
\n \n", + "itemtype": "property", + "name": "primaryKey", + "type": "{String}", + "access": "public", + "tagname": "", + "default": "'id'", + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 120, + "itemtype": "property", + "description": "

The attrs object can be used to declare a simple mapping between\nproperty names on Model records and payload keys in the\nserialized JSON object representing the record. An object with the\nproperty key can also be used to designate the attribute's key on\nthe response payload.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/models/person.js
1\n2\n3\n4\n5\n
import Model, { attr } from '@ember-data/model';\n\nexport default class PersonModel extends Model {\n  @attr('boolean') admin;\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/person.js
1\n2\n3\n4\n5\n6\n7\n8\n
import JSONSerializer from '@ember-data/serializer/json';\n\nexport default class PersonSerializer extends JSONSerializer {\n  attrs = {\n    admin: 'is_admin',\n    occupation: { key: 'career' }\n  }\n}
\n
\n
\n \n

You can also remove attributes and relationships by setting the serialize\nkey to false in your mapping object.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/person.js
1\n2\n3\n4\n5\n6\n7\n8\n
import JSONSerializer from '@ember-data/serializer/json';\n\nexport default class PostSerializer extends JSONSerializer {\n  attrs = {\n    admin: { serialize: false },\n    occupation: { key: 'career' }\n  }\n}
\n
\n
\n \n

When serialized:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
{\n  "firstName": "Harry",\n  "lastName": "Houdini",\n  "career": "magician"\n}
\n
\n
\n \n

Note that the admin is now not included in the payload.

\n

Setting serialize to true enforces serialization for hasMany\nrelationships even if it's neither a many-to-many nor many-to-none\nrelationship.

\n", + "name": "attrs", + "access": "public", + "tagname": "", + "type": "{Object}", + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/index.ts", + "line": 141, + "description": "

The store property is the application's store that contains\nall records. It can be used to look up serializers for other model\ntypes that may be nested inside the payload response.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
Serializer.extend({\n  extractRelationship(relationshipModelName, relationshipHash) {\n    let modelClass = this.store.modelFor(relationshipModelName);\n    let relationshipSerializer = this.store.serializerFor(relationshipModelName);\n    return relationshipSerializer.normalize(modelClass, relationshipHash);\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "store", + "type": "{Store}", + "access": "public", + "tagname": "", + "class": "JSONAPISerializer", + "module": "@ember-data/serializer", + "inherited": true, + "inheritedFrom": "Serializer" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-data-5.3.0-JSONSerializer", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/serializer/json-api", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-JSONSerializer.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-JSONSerializer.json new file mode 100644 index 000000000..cadd3d9c1 --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-JSONSerializer.json @@ -0,0 +1,1540 @@ +{ + "data": { + "id": "ember-data-5.3.0-JSONSerializer", + "type": "class", + "attributes": { + "name": "JSONSerializer", + "shortname": "JSONSerializer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/serializer/json", + "namespace": "", + "file": "../serializer/src/json.js", + "line": 17, + "description": "
\n

\n ⚠️ This is LEGACY documentation for a feature that is no longer encouraged to be used.\n If starting a new app or thinking of implementing a new adapter, consider writing a\n Handler instead to be used with the RequestManager\n

\n
\n\n

In EmberData a Serializer is used to serialize and deserialize\n records when they are transferred in and out of an external source.\n This process involves normalizing property names, transforming\n attribute values and serializing relationships.

\n

By default, EmberData uses and recommends the JSONAPISerializer.

\n

JSONSerializer is useful for simpler or legacy backends that may\n not support the http://jsonapi.org/ spec.

\n

For example, given the following User model and JSON payload:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/models/user.js
1\n2\n3\n4\n5\n6\n7\n
 import Model, { attr, belongsTo, hasMany } from '@ember-data/model';\n\n export default class UserModel extends Model {\n  @hasmany('user') friends;\n  @belongsto('location') house;\n  @attr('string') name;\n }
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
 {\n   id: 1,\n   name: 'Sebastian',\n   friends: [3, 4],\n   links: {\n     house: '/houses/lefkada'\n   }\n }
\n
\n
\n \n

JSONSerializer will normalize the JSON payload to the JSON API format that the\n Ember Data store expects.

\n

You can customize how JSONSerializer processes its payload by passing options in\n the attrs hash or by subclassing the JSONSerializer and overriding hooks:

\n
    \n
  • To customize how a single record is normalized, use the normalize hook.

    \n
  • \n
  • To customize how JSONSerializer normalizes the whole server response, use the\nnormalizeResponse hook.

    \n
  • \n
  • To customize how JSONSerializer normalizes a specific response from the server,\nuse one of the many specific normalizeResponse hooks.

    \n
  • \n
  • To customize how JSONSerializer normalizes your id, attributes or relationships,\nuse the extractId, extractAttributes and extractRelationships hooks.

    \n

    The JSONSerializer normalization process follows these steps:

    \n
  • \n
\n
    \n
  1. normalizeResponse
      \n
    • entry method to the serializer.
    • \n
    \n
  2. \n
  3. normalizeCreateRecordResponse
      \n
    • a normalizeResponse for a specific operation is called.
    • \n
    \n
  4. \n
  5. normalizeSingleResponse|normalizeArrayResponse
      \n
    • for methods like createRecord we expect a single record back, while for methods like findAll we expect multiple records back.
    • \n
    \n
  6. \n
  7. normalize
      \n
    • normalizeArrayResponse iterates and calls normalize for each of its records while normalizeSingle\ncalls it once. This is the method you most likely want to subclass.
    • \n
    \n
  8. \n
  9. extractId | extractAttributes | extractRelationships
      \n
    • normalize delegates to these methods to\nturn the record payload into the JSON API format.\n@mainName @ember-data/serializer/json\n@tag main
    • \n
    \n
  10. \n
\n", + "_main": true, + "access": "public", + "tagname": "", + "extends": "Serializer", + "methods": [ + { + "file": "../packages/serializer/src/json.js", + "line": 189, + "description": "

Given a subclass of Model and a JSON object this method will\niterate through each attribute of the Model and invoke the\nTransform#deserialize method on the matching property of the\nJSON object. This method is typically called after the\nserializer's normalize method.

\n", + "itemtype": "method", + "name": "applyTransforms", + "access": "private", + "tagname": "", + "params": [ + { + "name": "typeClass", + "description": "", + "type": "Model" + }, + { + "name": "data", + "description": "The data to transform", + "type": "Object" + } + ], + "return": { + "description": "data The transformed data object", + "type": "Object" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 218, + "description": "

The normalizeResponse method is used to normalize a payload from the\nserver to a JSON-API Document.

\n

http://jsonapi.org/format/#document-structure

\n

This method delegates to a more specific normalize method based on\nthe requestType.

\n

To override this method with a custom one, make sure to call\nreturn super.normalizeResponse(store, primaryModelClass, payload, id, requestType) with your\npre-processed data.

\n

Here's an example of using normalizeResponse manually:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
socket.on('message', function(message) {\n  let data = message.data;\n  let modelClass = store.modelFor(data.modelName);\n  let serializer = store.serializerFor(data.modelName);\n  let normalized = serializer.normalizeSingleResponse(store, modelClass, data, data.id);\n\n  store.push(normalized);\n});
\n
\n
\n \n", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 279, + "description": "

Called by the default normalizeResponse implementation when the\ntype of request is findRecord

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeFindRecordResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 297, + "description": "

Called by the default normalizeResponse implementation when the\ntype of request is queryRecord

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeQueryRecordResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 315, + "description": "

Called by the default normalizeResponse implementation when the\ntype of request is findAll

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeFindAllResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 333, + "description": "

Called by the default normalizeResponse implementation when the\ntype of request is findBelongsTo

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeFindBelongsToResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 351, + "description": "

Called by the default normalizeResponse implementation when the\ntype of request is findHasMany

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeFindHasManyResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 369, + "description": "

Called by the default normalizeResponse implementation when the\ntype of request is findMany

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeFindManyResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 387, + "description": "

Called by the default normalizeResponse implementation when the\ntype of request is query

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeQueryResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 405, + "description": "

Called by the default normalizeResponse implementation when the\ntype of request is createRecord

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeCreateRecordResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 423, + "description": "

Called by the default normalizeResponse implementation when the\ntype of request is deleteRecord

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeDeleteRecordResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 441, + "description": "

Called by the default normalizeResponse implementation when the\ntype of request is updateRecord

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeUpdateRecordResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 459, + "description": "

normalizeUpdateRecordResponse, normalizeCreateRecordResponse and\nnormalizeDeleteRecordResponse delegate to this method by default.

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeSaveResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 477, + "description": "

normalizeQueryResponse and normalizeFindRecordResponse delegate to this\nmethod by default.

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeSingleResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 495, + "description": "

normalizeQueryResponse, normalizeFindManyResponse, and normalizeFindHasManyResponse delegate\nto this method by default.

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeArrayResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 513, + "itemtype": "method", + "name": "_normalizeResponse", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + }, + { + "name": "isSingle", + "description": "", + "type": "Boolean" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "access": "private", + "tagname": "", + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 562, + "description": "

Normalizes a part of the JSON payload returned by\nthe server. You should override this method, munge the hash\nand call super if you have generic normalization to do.

\n

It takes the type of the record that is being normalized\n(as a Model class), the property where the hash was\noriginally found, and the hash to normalize.

\n

You can use this method, for example, to normalize underscored keys to camelized\nor other general-purpose normalizations.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import JSONSerializer from '@ember-data/serializer/json';\nimport { underscore } from '<app-name>/utils/string-utils';\nimport { get } from '@ember/object';\n\nexport default class ApplicationSerializer extends JSONSerializer {\n  normalize(typeClass, hash) {\n    let fields = typeClass.fields;\n\n    fields.forEach(function(type, field) {\n      let payloadField = underscore(field);\n      if (field === payloadField) { return; }\n\n      hash[field] = hash[payloadField];\n      delete hash[payloadField];\n    });\n\n    return super.normalize(...arguments);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "normalize", + "access": "public", + "tagname": "", + "params": [ + { + "name": "typeClass", + "description": "", + "type": "Model" + }, + { + "name": "hash", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 626, + "description": "

Returns the resource's ID.

\n", + "itemtype": "method", + "name": "extractId", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelClass", + "description": "", + "type": "Object" + }, + { + "name": "resourceHash", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "String" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 641, + "description": "

Returns the resource's attributes formatted as a JSON-API "attributes object".

\n

http://jsonapi.org/format/#document-resource-object-attributes

\n", + "itemtype": "method", + "name": "extractAttributes", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelClass", + "description": "", + "type": "Object" + }, + { + "name": "resourceHash", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 666, + "description": "

Returns a relationship formatted as a JSON-API "relationship object".

\n

http://jsonapi.org/format/#document-resource-object-relationships

\n", + "itemtype": "method", + "name": "extractRelationship", + "access": "public", + "tagname": "", + "params": [ + { + "name": "relationshipModelName", + "description": "", + "type": "Object" + }, + { + "name": "relationshipHash", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 701, + "description": "

Returns a polymorphic relationship formatted as a JSON-API "relationship object".

\n

http://jsonapi.org/format/#document-resource-object-relationships

\n

relationshipOptions is a hash which contains more information about the\npolymorphic relationship which should be extracted:

\n
    \n
  • resourceHash complete hash of the resource the relationship should be\nextracted from
  • \n
  • relationshipKey key under which the value for the relationship is\nextracted from the resourceHash
  • \n
  • relationshipMeta meta information about the relationship
  • \n
\n", + "itemtype": "method", + "name": "extractPolymorphicRelationship", + "access": "public", + "tagname": "", + "params": [ + { + "name": "relationshipModelName", + "description": "", + "type": "Object" + }, + { + "name": "relationshipHash", + "description": "", + "type": "Object" + }, + { + "name": "relationshipOptions", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 725, + "description": "

Returns the resource's relationships formatted as a JSON-API "relationships object".

\n

http://jsonapi.org/format/#document-resource-object-relationships

\n", + "itemtype": "method", + "name": "extractRelationships", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelClass", + "description": "", + "type": "Object" + }, + { + "name": "resourceHash", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 797, + "description": "

Dasherizes the model name in the payload

\n", + "itemtype": "method", + "name": "modelNameFromPayloadKey", + "access": "public", + "tagname": "", + "params": [ + { + "name": "key", + "description": "", + "type": "String" + } + ], + "return": { + "description": "the model's modelName", + "type": "String" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 809, + "itemtype": "method", + "name": "normalizeRelationships", + "access": "private", + "tagname": "", + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 832, + "itemtype": "method", + "name": "normalizeUsingDeclaredMapping", + "access": "private", + "tagname": "", + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 865, + "description": "

Looks up the property key that was set by the custom attr mapping\npassed to the serializer.

\n", + "itemtype": "method", + "name": "_getMappedKey", + "access": "private", + "tagname": "", + "params": [ + { + "name": "key", + "description": "", + "type": "String" + } + ], + "return": { + "description": "key", + "type": "String" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 904, + "description": "

Check attrs.key.serialize property to inform if the key\ncan be serialized

\n", + "itemtype": "method", + "name": "_canSerialize", + "access": "private", + "tagname": "", + "params": [ + { + "name": "key", + "description": "", + "type": "String" + } + ], + "return": { + "description": "true if the key can be serialized", + "type": "Boolean" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 919, + "description": "

When attrs.key.serialize is set to true then\nit takes priority over the other checks and the related\nattribute/relationship will be serialized

\n", + "itemtype": "method", + "name": "_mustSerialize", + "access": "private", + "tagname": "", + "params": [ + { + "name": "key", + "description": "", + "type": "String" + } + ], + "return": { + "description": "true if the key must be serialized", + "type": "Boolean" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 935, + "description": "

Check if the given hasMany relationship should be serialized

\n

By default only many-to-many and many-to-none relationships are serialized.\nThis could be configured per relationship by Serializer's attrs object.

\n", + "itemtype": "method", + "name": "shouldSerializeHasMany", + "access": "public", + "tagname": "", + "params": [ + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "key", + "description": "", + "type": "String" + }, + { + "name": "relationship", + "description": "", + "type": "RelationshipSchema" + } + ], + "return": { + "description": "true if the hasMany relationship should be serialized", + "type": "Boolean" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 958, + "itemtype": "method", + "description": "

Called when a record is saved in order to convert the\nrecord into JSON.

\n

By default, it creates a JSON object with a key for\neach attribute and belongsTo relationship.

\n

For example, consider this model:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/models/comment.js
1\n2\n3\n4\n5\n6\n
import Model, { attr, belongsTo } from '@ember-data/model';\n\nexport default class CommentModel extends Model {\n  @attr body;\n  @belongsto('user') author;\n}
\n
\n
\n \n

The default serialization would create a JSON object like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
{\n  "title": "Rails is unagi",\n  "body": "Rails? Omakase? O_O",\n  "author": 12\n}
\n
\n
\n \n

By default, attributes are passed through as-is, unless\nyou specified an attribute type (attr('date')). If\nyou specify a transform, the JavaScript value will be\nserialized when inserted into the JSON hash.

\n

By default, belongs-to relationships are converted into\nIDs when inserted into the JSON hash.

\n

IDs

\n

serialize takes an options hash with a single option:\nincludeId. If this option is true, serialize will,\nby default include the ID in the JSON object it builds.

\n

The adapter passes in includeId: true when serializing\na record for createRecord, but not for updateRecord.

\n

Customization

\n

Your server may expect a different JSON format than the\nbuilt-in serialization format.

\n

In that case, you can implement serialize yourself and\nreturn a JSON hash of your choosing.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import JSONSerializer from '@ember-data/serializer/json';\n\nexport default class PostSerializer extends JSONSerializer {\n  serialize(snapshot, options) {\n    let json = {\n      POST_TTL: snapshot.attr('title'),\n      POST_BDY: snapshot.attr('body'),\n      POST_CMS: snapshot.hasMany('comments', { ids: true })\n    };\n\n    if (options.includeId) {\n      json.POST_ID_ = snapshot.id;\n    }\n\n    return json;\n  }\n}
\n
\n
\n \n

Customizing an App-Wide Serializer

\n

If you want to define a serializer for your entire\napplication, you'll probably want to use eachAttribute\nand eachRelationship on the record.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n
import JSONSerializer from '@ember-data/serializer/json';\nimport { singularize } from '<app-name>/utils/string-utils';\n\nexport default class ApplicationSerializer extends JSONSerializer {\n  serialize(snapshot, options) {\n    let json = {};\n\n    snapshot.eachAttribute((name) => {\n      json[serverAttributeName(name)] = snapshot.attr(name);\n    });\n\n    snapshot.eachRelationship((name, relationship) => {\n      if (relationship.kind === 'hasMany') {\n        json[serverHasManyName(name)] = snapshot.hasMany(name, { ids: true });\n      }\n    });\n\n    if (options.includeId) {\n      json.ID_ = snapshot.id;\n    }\n\n    return json;\n  }\n}\n\nfunction serverAttributeName(attribute) {\n  return attribute.underscore().toUpperCase();\n}\n\nfunction serverHasManyName(name) {\n  return serverAttributeName(singularize(name)) + "_IDS";\n}
\n
\n
\n \n

This serializer will generate JSON that looks like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
{\n  "TITLE": "Rails is omakase",\n  "BODY": "Yep. Omakase.",\n  "COMMENT_IDS": [ "1", "2", "3" ]\n}
\n
\n
\n \n

Tweaking the Default JSON

\n

If you just want to do some small tweaks on the default JSON,\nyou can call super.serialize first and make the tweaks on\nthe returned JSON.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import JSONSerializer from '@ember-data/serializer/json';\n\nexport default class PostSerializer extends JSONSerializer {\n  serialize(snapshot, options) {\n    let json = super.serialize(...arguments);\n\n    json.subject = json.title;\n    delete json.title;\n\n    return json;\n  }\n}
\n
\n
\n \n", + "name": "serialize", + "access": "public", + "tagname": "", + "params": [ + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "json", + "type": "Object" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 1136, + "description": "

You can use this method to customize how a serialized record is added to the complete\nJSON hash to be sent to the server. By default the JSON Serializer does not namespace\nthe payload and just sends the raw serialized JSON object.\nIf your server expects namespaced keys, you should consider using the RESTSerializer.\nOtherwise you can override this method to customize how the record is added to the hash.\nThe hash property should be modified by reference.

\n

For example, your server may expect underscored root objects.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import RESTSerializer from '@ember-data/serializer/rest';\nimport { decamelize } from '<app-name>/utils/string-utils';\n\nexport default class ApplicationSerializer extends RESTSerializer {\n  serializeIntoHash(data, type, snapshot, options) {\n    let root = decamelize(type.modelName);\n    data[root] = this.serialize(snapshot, options);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "serializeIntoHash", + "access": "public", + "tagname": "", + "params": [ + { + "name": "hash", + "description": "", + "type": "Object" + }, + { + "name": "typeClass", + "description": "", + "type": "Model" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 1169, + "description": "

serializeAttribute can be used to customize how attr\nproperties are serialized

\n

For example if you wanted to ensure all your attributes were always\nserialized as properties on an attributes object you could\nwrite:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/application.js
1\n2\n3\n4\n5\n6\n7\n8\n
import JSONSerializer from '@ember-data/serializer/json';\n\nexport default class ApplicationSerializer extends JSONSerializer {\n  serializeAttribute(snapshot, json, key, attributes) {\n    json.attributes = json.attributes || {};\n    super.serializeAttribute(snapshot, json.attributes, key, attributes);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "serializeAttribute", + "access": "public", + "tagname": "", + "params": [ + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "json", + "description": "", + "type": "Object" + }, + { + "name": "key", + "description": "", + "type": "String" + }, + { + "name": "attribute", + "description": "", + "type": "Object" + } + ], + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 1217, + "description": "

serializeBelongsTo can be used to customize how belongsTo\nproperties are serialized.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import JSONSerializer from '@ember-data/serializer/json';\n\nexport default class PostSerializer extends JSONSerializer {\n  serializeBelongsTo(snapshot, json, relationship) {\n    let key = relationship.key;\n    let belongsTo = snapshot.belongsTo(key);\n\n    key = this.keyForRelationship ? this.keyForRelationship(key, "belongsTo", "serialize") : key;\n\n    json[key] = !belongsTo ? null : belongsTo.record.toJSON();\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "serializeBelongsTo", + "access": "public", + "tagname": "", + "params": [ + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "json", + "description": "", + "type": "Object" + }, + { + "name": "relationship", + "description": "", + "type": "Object" + } + ], + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 1271, + "description": "

serializeHasMany can be used to customize how hasMany\nproperties are serialized.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import JSONSerializer from '@ember-data/serializer/json';\n\nexport default class PostSerializer extends JSONSerializer {\n  serializeHasMany(snapshot, json, relationship) {\n    let key = relationship.key;\n    if (key === 'comments') {\n      return;\n    } else {\n      super.serializeHasMany(...arguments);\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "serializeHasMany", + "access": "public", + "tagname": "", + "params": [ + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "json", + "description": "", + "type": "Object" + }, + { + "name": "relationship", + "description": "", + "type": "Object" + } + ], + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 1318, + "description": "

You can use this method to customize how polymorphic objects are\nserialized. Objects are considered to be polymorphic if\n{ polymorphic: true } is pass as the second argument to the\nbelongsTo function.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/comment.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import JSONSerializer from '@ember-data/serializer/json';\n\nexport default class CommentSerializer extends JSONSerializer {\n  serializePolymorphicType(snapshot, json, relationship) {\n    let key = relationship.key;\n    let belongsTo = snapshot.belongsTo(key);\n\n    key = this.keyForAttribute ? this.keyForAttribute(key, 'serialize') : key;\n\n    if (!belongsTo) {\n      json[key + '_type'] = null;\n    } else {\n      json[key + '_type'] = belongsTo.modelName;\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "serializePolymorphicType", + "access": "public", + "tagname": "", + "params": [ + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "json", + "description": "", + "type": "Object" + }, + { + "name": "relationship", + "description": "", + "type": "Object" + } + ], + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 1353, + "description": "

extractMeta is used to deserialize any meta information in the\nadapter payload. By default Ember Data expects meta information to\nbe located on the meta property of the payload object.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import JSONSerializer from '@ember-data/serializer/json';\n\nexport default class PostSerializer extends JSONSerializer {\n  extractMeta(store, typeClass, payload) {\n    if (payload && payload.hasOwnProperty('_pagination')) {\n      let meta = payload._pagination;\n      delete payload._pagination;\n      return meta;\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "extractMeta", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "modelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + } + ], + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 1388, + "description": "

extractErrors is used to extract model errors when a call\nto Model#save fails with an InvalidError. By default\nEmber Data expects error information to be located on the errors\nproperty of the payload object.

\n

This serializer expects this errors object to be an Array similar\nto the following, compliant with the https://jsonapi.org/format/#errors specification:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
{\n  "errors": [\n    {\n      "detail": "This username is already taken!",\n      "source": {\n        "pointer": "data/attributes/username"\n      }\n    }, {\n      "detail": "Doesn't look like a valid email.",\n      "source": {\n        "pointer": "data/attributes/email"\n      }\n    }\n  ]\n}
\n
\n
\n \n

The key detail provides a textual description of the problem.\nAlternatively, the key title can be used for the same purpose.

\n

The nested keys source.pointer detail which specific element\nof the request data was invalid.

\n

Note that JSON-API also allows for object-level errors to be placed\nin an object with pointer data, signifying that the problem\ncannot be traced to a specific attribute:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
{\n  "errors": [\n    {\n      "detail": "Some generic non property error message",\n      "source": {\n        "pointer": "data"\n      }\n    }\n  ]\n}
\n
\n
\n \n

When turn into a Errors object, you can read these errors\nthrough the property base:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
{{#each @model.errors.base as |error|}}\n  <div class="error">\n    {{error.message}}\n  </div>\n{{/each}}
\n
\n
\n \n

Example of alternative implementation, overriding the default\nbehavior to deal with a different format of errors:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import JSONSerializer from '@ember-data/serializer/json';\n\nexport default class PostSerializer extends JSONSerializer {\n  extractErrors(store, typeClass, payload, id) {\n    if (payload && typeof payload === 'object' && payload._problems) {\n      payload = payload._problems;\n      this.normalizeErrors(typeClass, payload);\n    }\n    return payload;\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "extractErrors", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "typeClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "(String|Number)" + } + ], + "return": { + "description": "json The deserialized errors", + "type": "Object" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 1523, + "description": "

keyForAttribute can be used to define rules for how to convert an\nattribute name in your model to a key in your JSON.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/application.js
1\n2\n3\n4\n5\n6\n7\n8\n
import JSONSerializer from '@ember-data/serializer/json';\nimport { underscore } from '<app-name>/utils/string-utils';\n\nexport default class ApplicationSerializer extends JSONSerializer {\n  keyForAttribute(attr, method) {\n    return underscore(attr).toUpperCase();\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "keyForAttribute", + "access": "public", + "tagname": "", + "params": [ + { + "name": "key", + "description": "", + "type": "String" + }, + { + "name": "method", + "description": "", + "type": "String" + } + ], + "return": { + "description": "normalized key", + "type": "String" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 1550, + "description": "

keyForRelationship can be used to define a custom key when\nserializing and deserializing relationship properties. By default\nJSONSerializer does not provide an implementation of this method.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/post.js
1\n2\n3\n4\n5\n6\n7\n8\n
  import JSONSerializer from '@ember-data/serializer/json';\n  import { underscore } from '<app-name>/utils/string-utils';\n\n  export default class PostSerializer extends JSONSerializer {\n    keyForRelationship(key, relationship, method) {\n      return `rel_${underscore(key)}`;\n    }\n  }
\n
\n
\n \n", + "itemtype": "method", + "name": "keyForRelationship", + "access": "public", + "tagname": "", + "params": [ + { + "name": "key", + "description": "", + "type": "String" + }, + { + "name": "typeClass", + "description": "", + "type": "String" + }, + { + "name": "method", + "description": "", + "type": "String" + } + ], + "return": { + "description": "normalized key", + "type": "String" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 1579, + "description": "

keyForLink can be used to define a custom key when deserializing link\nproperties.

\n", + "itemtype": "method", + "name": "keyForLink", + "access": "public", + "tagname": "", + "params": [ + { + "name": "key", + "description": "", + "type": "String" + }, + { + "name": "kind", + "description": "`belongsTo` or `hasMany`", + "type": "String" + } + ], + "return": { + "description": "normalized key", + "type": "String" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 1595, + "itemtype": "method", + "name": "transformFor", + "access": "private", + "tagname": "", + "params": [ + { + "name": "attributeType", + "description": "", + "type": "String" + }, + { + "name": "skipAssertion", + "description": "", + "type": "Boolean" + } + ], + "return": { + "description": "transform", + "type": "Transform" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/index.ts", + "line": 163, + "description": "

The normalizeResponse method is used to normalize a payload from the\nserver to a JSON-API Document.

\n

http://jsonapi.org/format/#document-structure

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
Serializer.extend({\n  normalizeResponse(store, primaryModelClass, payload, id, requestType) {\n    if (requestType === 'findRecord') {\n      return this.normalize(primaryModelClass, payload);\n    } else {\n      return payload.reduce(function(documentHash, item) {\n        let { data, included } = this.normalize(primaryModelClass, item);\n        documentHash.included.push(...included);\n        documentHash.data.push(data);\n        return documentHash;\n      }, { data: [], included: [] })\n    }\n  }\n});
\n
\n
\n \n", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer", + "inherited": true, + "inheritedFrom": "Serializer" + }, + { + "file": "../packages/serializer/src/index.ts", + "line": 199, + "description": "

The serialize method is used when a record is saved in order to convert\nthe record into the form that your external data source expects.

\n

serialize takes an optional options hash with a single option:

\n
    \n
  • includeId: If this is true, serialize should include the ID\nin the serialized object it builds.
  • \n
\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
Serializer.extend({\n  serialize(snapshot, options) {\n    let json = {\n      id: snapshot.id\n    };\n\n    snapshot.eachAttribute((key, attribute) => {\n      json[key] = snapshot.attr(key);\n    });\n\n    snapshot.eachRelationship((key, relationship) => {\n      if (relationship.kind === 'belongsTo') {\n        json[key] = snapshot.belongsTo(key, { id: true });\n      } else if (relationship.kind === 'hasMany') {\n        json[key] = snapshot.hasMany(key, { ids: true });\n      }\n    });\n\n    return json;\n  },\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "serialize", + "access": "public", + "tagname": "", + "params": [ + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "options", + "description": "", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer", + "inherited": true, + "inheritedFrom": "Serializer" + }, + { + "file": "../packages/serializer/src/index.ts", + "line": 241, + "description": "

The normalize method is used to convert a payload received from your\nexternal data source into the normalized form store.push() expects. You\nshould override this method, munge the hash and return the normalized\npayload.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
Serializer.extend({\n  normalize(modelClass, resourceHash) {\n    let data = {\n      id:            resourceHash.id,\n      type:          modelClass.modelName,\n      attributes:    resourceHash\n    };\n    return { data: data };\n  }\n})
\n
\n
\n \n", + "itemtype": "method", + "name": "normalize", + "access": "public", + "tagname": "", + "params": [ + { + "name": "typeClass", + "description": "", + "type": "Model" + }, + { + "name": "hash", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer", + "inherited": true, + "inheritedFrom": "Serializer" + } + ], + "events": [], + "properties": [ + { + "file": "../packages/serializer/src/json.js", + "line": 95, + "description": "

The primaryKey is used when serializing and deserializing\ndata. Ember Data always uses the id property to store the id of\nthe record. The external source may not always follow this\nconvention. In these cases it is useful to override the\nprimaryKey property to match the primaryKey of your external\nstore.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/application.js
1\n2\n3\n4\n5\n
import JSONSerializer from '@ember-data/serializer/json';\n\nexport default class ApplicationSerializer extends JSONSerializer {\n  primaryKey = '_id'\n}
\n
\n
\n \n", + "itemtype": "property", + "name": "primaryKey", + "type": "{String}", + "access": "public", + "tagname": "", + "default": "'id'", + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 120, + "itemtype": "property", + "description": "

The attrs object can be used to declare a simple mapping between\nproperty names on Model records and payload keys in the\nserialized JSON object representing the record. An object with the\nproperty key can also be used to designate the attribute's key on\nthe response payload.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/models/person.js
1\n2\n3\n4\n5\n
import Model, { attr } from '@ember-data/model';\n\nexport default class PersonModel extends Model {\n  @attr('boolean') admin;\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/person.js
1\n2\n3\n4\n5\n6\n7\n8\n
import JSONSerializer from '@ember-data/serializer/json';\n\nexport default class PersonSerializer extends JSONSerializer {\n  attrs = {\n    admin: 'is_admin',\n    occupation: { key: 'career' }\n  }\n}
\n
\n
\n \n

You can also remove attributes and relationships by setting the serialize\nkey to false in your mapping object.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/person.js
1\n2\n3\n4\n5\n6\n7\n8\n
import JSONSerializer from '@ember-data/serializer/json';\n\nexport default class PostSerializer extends JSONSerializer {\n  attrs = {\n    admin: { serialize: false },\n    occupation: { key: 'career' }\n  }\n}
\n
\n
\n \n

When serialized:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
{\n  "firstName": "Harry",\n  "lastName": "Houdini",\n  "career": "magician"\n}
\n
\n
\n \n

Note that the admin is now not included in the payload.

\n

Setting serialize to true enforces serialization for hasMany\nrelationships even if it's neither a many-to-many nor many-to-none\nrelationship.

\n", + "name": "attrs", + "access": "public", + "tagname": "", + "type": "{Object}", + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/index.ts", + "line": 141, + "description": "

The store property is the application's store that contains\nall records. It can be used to look up serializers for other model\ntypes that may be nested inside the payload response.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
Serializer.extend({\n  extractRelationship(relationshipModelName, relationshipHash) {\n    let modelClass = this.store.modelFor(relationshipModelName);\n    let relationshipSerializer = this.store.serializerFor(relationshipModelName);\n    return relationshipSerializer.normalize(modelClass, relationshipHash);\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "store", + "type": "{Store}", + "access": "public", + "tagname": "", + "class": "JSONSerializer", + "module": "@ember-data/serializer", + "inherited": true, + "inheritedFrom": "Serializer" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-data-5.3.0-Serializer", + "type": "class" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-data-5.3.0-JSONAPISerializer" + }, + { + "type": "class", + "id": "ember-data-5.3.0-RESTSerializer" + } + ] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/serializer/json", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-LifetimesService.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-LifetimesService.json new file mode 100644 index 000000000..355ed2e9d --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-LifetimesService.json @@ -0,0 +1,45 @@ +{ + "data": { + "id": "ember-data-5.3.0-LifetimesService", + "type": "class", + "attributes": { + "name": "LifetimesService", + "shortname": "LifetimesService", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/request-utils", + "namespace": "", + "file": "../request-utils/src/index.ts", + "line": 582, + "description": "

A basic LifetimesService that can be added to the Store service.

\n

Determines staleness based on time since the request was last received from the API\nusing the date header.

\n

This allows the Store's CacheHandler to determine if a request is expired and\nshould be refetched upon next request.

\n

The Fetch handler provided by @ember-data/request/fetch will automatically\nadd the date header to responses if it is not present.

\n

Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { LifetimesService } from '@ember-data/request-utils';\nimport DataStore from '@ember-data/store';\n\n// ...\n\nexport class Store extends DataStore {\n  constructor(args) {\n    super(args);\n    this.lifetimes = new LifetimesService(this, { apiCacheSoftExpires: 30_000, apiCacheHardExpires: 60_000 });\n  }\n}
\n
\n
\n \n", + "access": "public", + "tagname": "", + "methods": [], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/request-utils", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-ManyArray.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-ManyArray.json new file mode 100644 index 000000000..b360da322 --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-ManyArray.json @@ -0,0 +1,143 @@ +{ + "data": { + "id": "ember-data-5.3.0-ManyArray", + "type": "class", + "attributes": { + "name": "ManyArray", + "shortname": "ManyArray", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/store", + "namespace": "", + "file": "../model/src/-private/many-array.ts", + "line": 43, + "access": "public", + "description": "

A ManyArray is a MutableArray that represents the contents of a has-many\nrelationship.

\n

The ManyArray is instantiated lazily the first time the relationship is\nrequested.

\n

This class is not intended to be directly instantiated by consuming applications.

\n

Inverses

\n

Often, the relationships in Ember Data applications will have\nan inverse. For example, imagine the following models are\ndefined:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/models/post.js
1\n2\n3\n4\n5\n
import Model, { hasMany } from '@ember-data/model';\n\nexport default class PostModel extends Model {\n  @hasmany('comment') comments;\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/models/comment.js
1\n2\n3\n4\n5\n
import Model, { belongsTo } from '@ember-data/model';\n\nexport default class CommentModel extends Model {\n  @belongsto('post') post;\n}
\n
\n
\n \n

If you created a new instance of Post and added\na Comment record to its comments has-many\nrelationship, you would expect the comment's post\nproperty to be set to the post that contained\nthe has-many.

\n

We call the record to which a relationship belongs-to the\nrelationship's owner.

\n", + "tagname": "", + "methods": [ + { + "file": "../packages/model/src/-private/many-array.ts", + "line": 284, + "description": "

Reloads all of the records in the manyArray. If the manyArray\nholds a relationship that was originally fetched using a links url\nEmber Data will revisit the original links url to repopulate the\nrelationship.

\n

If the manyArray holds the result of a store.query() reload will\nre-run the original query.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let user = store.peekRecord('user', '1')\nawait login(user);\n\nlet permissions = await user.permissions;\nawait permissions.reload();
\n
\n
\n \n", + "itemtype": "method", + "name": "reload", + "access": "public", + "tagname": "", + "class": "ManyArray", + "module": "@ember-data/store" + }, + { + "file": "../packages/model/src/-private/many-array.ts", + "line": 311, + "description": "

Saves all of the records in the ManyArray.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let inbox = await store.findRecord('inbox', '1');\nlet messages = await inbox.messages;\nmessages.forEach((message) => {\n  message.isRead = true;\n});\nmessages.save();
\n
\n
\n \n", + "itemtype": "method", + "name": "save", + "access": "public", + "tagname": "", + "return": { + "description": "promise", + "type": "PromiseArray" + }, + "class": "ManyArray", + "module": "@ember-data/store" + }, + { + "file": "../packages/model/src/-private/many-array.ts", + "line": 330, + "description": "

Create a child record within the owner

\n", + "itemtype": "method", + "name": "createRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "hash", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "record", + "type": "Model" + }, + "class": "ManyArray", + "module": "@ember-data/store" + } + ], + "events": [], + "properties": [ + { + "file": "../packages/model/src/-private/many-array.ts", + "line": 88, + "description": "

The loading state of this array

\n", + "itemtype": "property", + "name": "isLoaded", + "type": "Boolean", + "access": "public", + "tagname": "", + "class": "ManyArray", + "module": "@ember-data/store" + }, + { + "file": "../packages/model/src/-private/many-array.ts", + "line": 96, + "description": "

true if the relationship is polymorphic, false otherwise.

\n", + "itemtype": "property", + "name": "isPolymorphic", + "type": "Boolean", + "access": "private", + "tagname": "", + "class": "ManyArray", + "module": "@ember-data/store" + }, + { + "file": "../packages/model/src/-private/many-array.ts", + "line": 104, + "description": "

Metadata associated with the request for async hasMany relationships.

\n

Example

\n

Given that the server returns the following JSON payload when fetching a\nhasMany relationship:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
{\n  "comments": [{\n    "id": 1,\n    "comment": "This is the first comment",\n  }, {\n// ...\n  }],\n\n  "meta": {\n    "page": 1,\n    "total": 5\n  }\n}
\n
\n
\n \n

You can then access the meta data via the meta property:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let comments = await post.comments;\nlet meta = comments.meta;\n\n// meta.page => 1\n// meta.total => 5
\n
\n
\n \n", + "itemtype": "property", + "name": "meta", + "type": "Object | null", + "access": "public", + "tagname": "", + "class": "ManyArray", + "module": "@ember-data/store" + }, + { + "file": "../packages/model/src/-private/many-array.ts", + "line": 142, + "description": "

Retrieve the links for this relationship

\n", + "itemtype": "property", + "name": "links", + "type": "Object | null", + "access": "public", + "tagname": "", + "class": "ManyArray", + "module": "@ember-data/store" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/store", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-Model.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-Model.json new file mode 100644 index 000000000..7433e4d06 --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-Model.json @@ -0,0 +1,780 @@ +{ + "data": { + "id": "ember-data-5.3.0-Model", + "type": "class", + "attributes": { + "name": "Model", + "shortname": "Model", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/model", + "namespace": "", + "file": "../model/src/-private/model.js", + "line": 99, + "access": "public", + "description": "

Base class from which Models can be defined.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import Model, { attr } from '@ember-data/model';\n\nexport default class User extends Model {\n  @attr name;\n}
\n
\n
\n \n", + "tagname": "", + "extends": "Ember.EmberObject", + "methods": [ + { + "file": "../packages/model/src/-private/model.js", + "line": 609, + "description": "

Create a JSON representation of the record, using the serialization\nstrategy of the store's adapter.

\n

serialize takes an optional hash as a parameter, currently\nsupported options are:

\n
    \n
  • includeId: true if the record's ID should be included in the\nJSON representation.
  • \n
\n", + "itemtype": "method", + "name": "serialize", + "access": "public", + "tagname": "", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "an object whose values are primitive JSON values only", + "type": "Object" + }, + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 644, + "itemtype": "method", + "description": "

Marks the record as deleted but does not save it. You must call\nsave afterwards if you want to persist it. You might use this\nmethod if you want to allow the user to still rollbackAttributes()\nafter a delete was made.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/controllers/model/delete.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Controller from '@ember/controller';\nimport { action } from '@ember/object';\n\nexport default class ModelDeleteController extends Controller {\n  @action undo() {\n    this.model.rollbackAttributes();\n  }\n}
\n
\n
\n \n", + "name": "deleteRecord", + "access": "public", + "tagname": "", + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 684, + "itemtype": "method", + "description": "

Same as deleteRecord, but saves the record immediately.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/controllers/model/delete.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Controller from '@ember/controller';\nimport { action } from '@ember/object';\n\nexport default class ModelDeleteController extends Controller {\n  @action delete() {\n    this.model.destroyRecord().then(function() {\n      this.transitionToRoute('model.index');\n    });\n  }\n}
\n
\n
\n \n

If you pass an object on the adapterOptions property of the options\nargument it will be passed to your adapter via the snapshot

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.destroyRecord({ adapterOptions: { subscribe: false } });
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import MyCustomAdapter from './custom-adapter';\n\nexport default class PostAdapter extends MyCustomAdapter {\n  deleteRecord(store, type, snapshot) {\n    if (snapshot.adapterOptions.subscribe) {\n      // ...\n    }\n    // ...\n  }\n}
\n
\n
\n \n", + "name": "destroyRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "a promise that will be resolved when the adapter returns\nsuccessfully or rejected if the adapter returns with an error.", + "type": "Promise" + }, + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 741, + "description": "

Unloads the record from the store. This will not send a delete request\nto your server, it just unloads the record from memory.

\n", + "itemtype": "method", + "name": "unloadRecord", + "access": "public", + "tagname": "", + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 755, + "itemtype": "method", + "name": "_notifyProperties", + "access": "private", + "tagname": "", + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 772, + "itemtype": "method", + "description": "

Returns an object, whose keys are changed properties, and value is\nan [oldProp, newProp] array.

\n

The array represents the diff of the canonical state with the local state\nof the model. Note: if the model is created locally, the canonical state is\nempty since the adapter hasn't acknowledged the attributes yet:

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/models/mascot.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Model, { attr } from '@ember-data/model';\n\nexport default class MascotModel extends Model {\n  @attr('boolean', {\n    defaultValue: false\n  })\n  isAdmin;\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
let mascot = store.createRecord('mascot');\n\nmascot.changedAttributes(); // {}\n\nmascot.set('name', 'Tomster');\nmascot.changedAttributes(); // { name: [undefined, 'Tomster'] }\n\nmascot.set('isAdmin', true);\nmascot.changedAttributes(); // { isAdmin: [undefined, true], name: [undefined, 'Tomster'] }\n\nmascot.save().then(function() {\n  mascot.changedAttributes(); // {}\n\n  mascot.set('isAdmin', false);\n  mascot.changedAttributes(); // { isAdmin: [true, false] }\n});
\n
\n
\n \n", + "name": "changedAttributes", + "access": "public", + "tagname": "", + "return": { + "description": "an object, whose keys are changed properties,\n and value is an [oldProp, newProp] array.", + "type": "Object" + }, + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 822, + "description": "

If the model hasDirtyAttributes this function will discard any unsaved\nchanges. If the model isNew it will be removed from the store.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
record.name; // 'Untitled Document'\nrecord.set('name', 'Doc 1');\nrecord.name; // 'Doc 1'\nrecord.rollbackAttributes();\nrecord.name; // 'Untitled Document'
\n
\n
\n \n", + "since": "1.13.0", + "itemtype": "method", + "name": "rollbackAttributes", + "access": "public", + "tagname": "", + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 854, + "itemtype": "method", + "name": "_createSnapshot", + "access": "private", + "tagname": "", + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 870, + "description": "

Save the record and persist any changes to the record to an\nexternal source via the adapter.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
record.set('name', 'Tomster');\nrecord.save().then(function() {\n  // Success callback\n}, function() {\n  // Error callback\n});
\n
\n
\n \n

If you pass an object using the adapterOptions property of the options\n argument it will be passed to your adapter via the snapshot.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.save({ adapterOptions: { subscribe: false } });
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import MyCustomAdapter from './custom-adapter';\n\nexport default class PostAdapter extends MyCustomAdapter {\n  updateRecord(store, type, snapshot) {\n    if (snapshot.adapterOptions.subscribe) {\n      // ...\n    }\n    // ...\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "save", + "access": "public", + "tagname": "", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "a promise that will be resolved when the adapter returns\nsuccessfully or rejected if the adapter returns with an error.", + "type": "Promise" + }, + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 924, + "itemtype": "method", + "description": "

Reload the record from the adapter.

\n

This will only work if the record has already finished loading.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/controllers/model/view.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Controller from '@ember/controller';\nimport { action } from '@ember/object';\n\nexport default class ViewController extends Controller {\n  @action reload() {\n    this.model.reload().then(function(model) {\n    // do something with the reloaded model\n    });\n  }\n}
\n
\n
\n \n", + "name": "reload", + "access": "public", + "tagname": "", + "params": [ + { + "name": "options", + "description": "optional, may include `adapterOptions` hash which will be passed to adapter request", + "type": "Object" + } + ], + "return": { + "description": "a promise that will be resolved with the record when the\nadapter returns successfully or rejected if the adapter returns\nwith an error.", + "type": "Promise" + }, + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 985, + "itemtype": "method", + "description": "

Get the reference for the specified belongsTo relationship.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/models/blog.js
1\n2\n3\n4\n5\n
import Model, { belongsTo } from '@ember-data/model';\n\nexport default class BlogModel extends Model {\n  @belongsto('user', { async: true, inverse: null }) user;\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n42\n
let blog = store.push({\n  data: {\n    type: 'blog',\n    id: 1,\n    relationships: {\n      user: {\n        data: { type: 'user', id: 1 }\n      }\n    }\n  }\n});\nlet userRef = blog.belongsTo('user');\n\n// check if the user relationship is loaded\nlet isLoaded = userRef.value() !== null;\n\n// get the record of the reference (null if not yet available)\nlet user = userRef.value();\n\n// get the identifier of the reference\nif (userRef.remoteType() === "id") {\n  let id = userRef.id();\n} else if (userRef.remoteType() === "link") {\n  let link = userRef.link();\n}\n\n// load user (via store.findRecord or store.findBelongsTo)\nuserRef.load().then(...)\n\n// or trigger a reload\nuserRef.reload().then(...)\n\n// provide data for reference\nuserRef.push({\n  type: 'user',\n  id: 1,\n  attributes: {\n    username: "@user"\n  }\n}).then(function(user) {\n  userRef.value() === user;\n});
\n
\n
\n \n", + "name": "belongsTo", + "access": "public", + "tagname": "", + "params": [ + { + "name": "name", + "description": "of the relationship", + "type": "String" + } + ], + "since": "2.5.0", + "return": { + "description": "reference for this relationship", + "type": "BelongsToReference" + }, + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 1053, + "itemtype": "method", + "description": "

Get the reference for the specified hasMany relationship.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/models/blog.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n42\n43\n44\n45\n
import Model, { hasMany } from '@ember-data/model';\n\nexport default class BlogModel extends Model {\n  @hasmany('comment', { async: true, inverse: null }) comments;\n}\n\nlet blog = store.push({\n  data: {\n    type: 'blog',\n    id: 1,\n    relationships: {\n      comments: {\n        data: [\n          { type: 'comment', id: 1 },\n          { type: 'comment', id: 2 }\n        ]\n      }\n    }\n  }\n});\nlet commentsRef = blog.hasMany('comments');\n\n// check if the comments are loaded already\nlet isLoaded = commentsRef.value() !== null;\n\n// get the records of the reference (null if not yet available)\nlet comments = commentsRef.value();\n\n// get the identifier of the reference\nif (commentsRef.remoteType() === "ids") {\n  let ids = commentsRef.ids();\n} else if (commentsRef.remoteType() === "link") {\n  let link = commentsRef.link();\n}\n\n// load comments (via store.findMany or store.findHasMany)\ncommentsRef.load().then(...)\n\n// or trigger a reload\ncommentsRef.reload().then(...)\n\n// provide data for reference\ncommentsRef.push([{ type: 'comment', id: 1 }, { type: 'comment', id: 2 }]).then(function(comments) {\n  commentsRef.value() === comments;\n});
\n
\n
\n \n", + "name": "hasMany", + "access": "public", + "tagname": "", + "params": [ + { + "name": "name", + "description": "of the relationship", + "type": "String" + } + ], + "since": "2.5.0", + "return": { + "description": "reference for this relationship", + "type": "HasManyReference" + }, + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 1116, + "description": "

Given a callback, iterates over each of the relationships in the model,\ninvoking the callback with the name of each relationship and its relationship\ndescriptor.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(name, descriptor);
\n
\n
\n \n
    \n
  • name the name of the current property in the iteration
  • \n
  • descriptor the meta object that describes this relationship
  • \n
\n

The relationship descriptor argument is an object with the following properties.

\n
    \n
  • key String the name of this relationship on the Model
  • \n
  • kind String "hasMany" or "belongsTo"
  • \n
  • options Object the original options hash passed when the relationship was declared
  • \n
  • parentType Model the type of the Model that owns this relationship
  • \n
  • type String the type name of the related Model
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import JSONSerializer from '@ember-data/serializer/json';\n\nexport default class ApplicationSerializer extends JSONSerializer {\n   serialize(record, options) {\n   let json = {};\n\n   record.eachRelationship(function(name, descriptor) {\n     if (descriptor.kind === 'hasMany') {\n       let serializedHasManyName = name.toUpperCase() + '_IDS';\n       json[serializedHasManyName] = record.get(name).map(r => r.id);\n     }\n   });\n\n   return json;\n }\n  }
\n
\n
\n \n", + "itemtype": "method", + "name": "eachRelationship", + "access": "public", + "tagname": "", + "params": [ + { + "name": "callback", + "description": "the callback to invoke", + "type": "Function" + }, + { + "name": "binding", + "description": "the value to which the callback's `this` should be bound", + "type": "Any" + } + ], + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 1187, + "description": "

Create should only ever be called by the store. To create an instance of a\nModel in a dirty state use store.createRecord.

\n

To create instances of Model in a clean state, use store.push

\n", + "itemtype": "method", + "name": "create", + "access": "private", + "tagname": "", + "static": 1, + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 1248, + "itemtype": "method", + "description": "

For a given relationship name, returns the model type of the relationship.

\n

For example, if you define a model like this:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/models/post.js
1\n2\n3\n4\n5\n
import Model, { hasMany } from '@ember-data/model';\n\nexport default class PostModel extends Model {\n  @hasmany('comment') comments;\n}
\n
\n
\n \n

Calling store.modelFor('post').typeForRelationship('comments', store) will return Comment.

\n", + "name": "typeForRelationship", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "name", + "description": "the name of the relationship", + "type": "String" + }, + { + "name": "store", + "description": "an instance of Store", + "type": "Store" + } + ], + "return": { + "description": "the type of the relationship, or undefined", + "type": "Model" + }, + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 1289, + "itemtype": "method", + "description": "

Find the relationship which is the inverse of the one asked for.

\n

For example, if you define models like this:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/models/post.js
1\n2\n3\n4\n5\n
import Model, { hasMany } from '@ember-data/model';\n\nexport default class PostModel extends Model {\n  @hasmany('message') comments;\n }
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/models/message.js
1\n2\n3\n4\n5\n
import Model, { belongsTo } from '@ember-data/model';\n\nexport default class MessageModel extends Model {\n  @belongsto('post') owner;\n }
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
store.modelFor('post').inverseFor('comments', store) // { type: App.Message, name: 'owner', kind: 'belongsTo' }\nstore.modelFor('message').inverseFor('owner', store) // { type: App.Post, name: 'comments', kind: 'hasMany' }
\n
\n
\n \n", + "name": "inverseFor", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "name", + "description": "the name of the relationship", + "type": "String" + }, + { + "name": "store", + "description": "", + "type": "Store" + } + ], + "return": { + "description": "the inverse relationship, or null", + "type": "Object" + }, + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 1804, + "description": "

Given a callback, iterates over each of the relationships in the model,\ninvoking the callback with the name of each relationship and its relationship\ndescriptor.

\n", + "itemtype": "method", + "name": "eachRelationship", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "callback", + "description": "the callback to invoke", + "type": "Function" + }, + { + "name": "binding", + "description": "the value to which the callback's `this` should be bound", + "type": "Any" + } + ], + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 1826, + "description": "

Given a callback, iterates over each of the types related to a model,\ninvoking the callback with the related type's class. Each type will be\nreturned just once, regardless of how many different relationships it has\nwith a model.

\n", + "itemtype": "method", + "name": "eachRelatedType", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "callback", + "description": "the callback to invoke", + "type": "Function" + }, + { + "name": "binding", + "description": "the value to which the callback's `this` should be bound", + "type": "Any" + } + ], + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 1999, + "itemtype": "method", + "description": "

Iterates through the attributes of the model, calling the passed function on each\nattribute.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(name, meta);
\n
\n
\n \n
    \n
  • name the name of the current property in the iteration
  • \n
  • meta the meta object for the attribute property in the iteration
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Model, { attr } from '@ember-data/model';\n\nclass PersonModel extends Model {\n  @attr('date') birthday;\n }\n\nPersonModel.eachAttribute(function(name, meta) {\n   // do thing\n });\n\n// prints:\n// firstName {type: "string", isAttribute: true, options: Object, parentType: function, name: "firstName"}\n// lastName {type: "string", isAttribute: true, options: Object, parentType: function, name: "lastName"}\n// birthday {type: "date", isAttribute: true, options: Object, parentType: function, name: "birthday"}
\n
\n
\n \n", + "name": "eachAttribute", + "access": "public", + "tagname": "", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "binding", + "description": "the value to which the callback's `this` should be bound", + "type": "Object", + "optional": true + } + ], + "static": 1, + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 2054, + "description": "

Iterates through the transformedAttributes of the model, calling\nthe passed function on each attribute. Note the callback will not be\ncalled for any attributes that do not have an transformation type.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(name, type);
\n
\n
\n \n
    \n
  • name the name of the current property in the iteration
  • \n
  • type a string containing the name of the type of transformed\napplied to the attribute
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Model, { attr } from '@ember-data/model';\n\nlet Person = Model.extend({\n   firstName: attr(),\n   lastName: attr('string'),\n   birthday: attr('date')\n });\n\nPerson.eachTransformedAttribute(function(name, type) {\n   // do thing\n });\n\n// prints:\n// lastName string\n// birthday date
\n
\n
\n \n", + "itemtype": "method", + "name": "eachTransformedAttribute", + "access": "public", + "tagname": "", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "binding", + "description": "the value to which the callback's `this` should be bound", + "type": "Object", + "optional": true + } + ], + "static": 1, + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 2110, + "description": "

Returns the name of the model class.

\n", + "itemtype": "method", + "name": "toString", + "access": "public", + "tagname": "", + "static": 1, + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 2133, + "description": "

Provides info about the model for debugging purposes\nby grouping the properties into more semantic groups.

\n

Meant to be used by debugging tools such as the Chrome Ember Extension.

\n
    \n
  • Groups all attributes in "Attributes" group.
  • \n
  • Groups all belongsTo relationships in "Belongs To" group.
  • \n
  • Groups all hasMany relationships in "Has Many" group.
  • \n
  • Groups all flags in "Flags" group.
  • \n
  • Flags relationship CPs as expensive properties.
  • \n
\n", + "itemtype": "method", + "name": "_debugInfo", + "access": "private", + "tagname": "", + "class": "Model", + "module": "@ember-data/model" + } + ], + "events": [], + "properties": [ + { + "file": "../packages/model/src/-private/model.js", + "line": 170, + "description": "

If this property is true the record is in the empty\nstate. Empty is the first state all records enter after they have\nbeen created. Most records created by the store will quickly\ntransition to the loading state if data needs to be fetched from\nthe server or the created state if the record is created on the\nclient. A record can also enter the empty state if the adapter is\nunable to locate the record.

\n", + "itemtype": "property", + "name": "isEmpty", + "access": "public", + "tagname": "", + "type": "{Boolean}", + "readonly": "", + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 189, + "description": "

If this property is true the record is in the loading state. A\nrecord enters this state when the store asks the adapter for its\ndata. It remains in this state until the adapter provides the\nrequested data.

\n", + "itemtype": "property", + "name": "isLoading", + "access": "public", + "tagname": "", + "type": "{Boolean}", + "readonly": "", + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 205, + "description": "

If this property is true the record is in the loaded state. A\nrecord enters this state when its data is populated. Most of a\nrecord's lifecycle is spent inside substates of the loaded\nstate.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let record = store.createRecord('model');\nrecord.isLoaded; // true\n\nstore.findRecord('model', 1).then(function(model) {\n  model.isLoaded; // true\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "isLoaded", + "access": "public", + "tagname": "", + "type": "{Boolean}", + "readonly": "", + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 232, + "description": "

If this property is true the record is in the dirty state. The\nrecord has local changes that have not yet been saved by the\nadapter. This includes records that have been created (but not yet\nsaved) or deleted.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
let record = store.createRecord('model');\nrecord.hasDirtyAttributes; // true\n\nstore.findRecord('model', 1).then(function(model) {\n  model.hasDirtyAttributes; // false\n  model.set('foo', 'some value');\n  model.hasDirtyAttributes; // true\n});
\n
\n
\n \n", + "since": "1.13.0", + "itemtype": "property", + "name": "hasDirtyAttributes", + "access": "public", + "tagname": "", + "type": "{Boolean}", + "readonly": "", + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 262, + "description": "

If this property is true the record is in the saving state. A\nrecord enters the saving state when save is called, but the\nadapter has not yet acknowledged that the changes have been\npersisted to the backend.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let record = store.createRecord('model');\nrecord.isSaving; // false\nlet promise = record.save();\nrecord.isSaving; // true\npromise.then(function() {\n  record.isSaving; // false\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "isSaving", + "access": "public", + "tagname": "", + "type": "{Boolean}", + "readonly": "", + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 290, + "description": "

If this property is true the record is in the deleted state\nand has been marked for deletion. When isDeleted is true and\nhasDirtyAttributes is true, the record is deleted locally but the deletion\nwas not yet persisted. When isSaving is true, the change is\nin-flight. When both hasDirtyAttributes and isSaving are false, the\nchange has persisted.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
let record = store.createRecord('model');\nrecord.isDeleted;    // false\nrecord.deleteRecord();\n\n// Locally deleted\nrecord.isDeleted;           // true\nrecord.hasDirtyAttributes;  // true\nrecord.isSaving;            // false\n\n// Persisting the deletion\nlet promise = record.save();\nrecord.isDeleted;    // true\nrecord.isSaving;     // true\n\n// Deletion Persisted\npromise.then(function() {\n  record.isDeleted;          // true\n  record.isSaving;           // false\n  record.hasDirtyAttributes; // false\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "isDeleted", + "access": "public", + "tagname": "", + "type": "{Boolean}", + "readonly": "", + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 333, + "description": "

If this property is true the record is in the new state. A\nrecord will be in the new state when it has been created on the\nclient and the adapter has not yet report that it was successfully\nsaved.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let record = store.createRecord('model');\nrecord.isNew; // true\n\nrecord.save().then(function(model) {\n  model.isNew; // false\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "isNew", + "access": "public", + "tagname": "", + "type": "{Boolean}", + "readonly": "", + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 360, + "description": "

If this property is true the record is in the valid state.

\n

A record will be in the valid state when the adapter did not report any\nserver-side validation failures.

\n", + "itemtype": "property", + "name": "isValid", + "access": "public", + "tagname": "", + "type": "{Boolean}", + "readonly": "", + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 376, + "description": "

If the record is in the dirty state this property will report what\nkind of change has caused it to move into the dirty\nstate. Possible values are:

\n
    \n
  • created The record has been created by the client and not yet saved to the adapter.
  • \n
  • updated The record has been updated by the client and not yet saved to the adapter.
  • \n
  • deleted The record has been deleted by the client and not yet saved to the adapter.
  • \n
\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let record = store.createRecord('model');\nrecord.dirtyType; // 'created'
\n
\n
\n \n", + "itemtype": "property", + "name": "dirtyType", + "access": "public", + "tagname": "", + "type": "{String}", + "readonly": "", + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 402, + "description": "

If true the adapter reported that it was unable to save local\nchanges to the backend for any reason other than a server-side\nvalidation error.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
record.isError; // false\nrecord.set('foo', 'valid value');\nrecord.save().then(null, function() {\n  record.isError; // true\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "isError", + "access": "public", + "tagname": "", + "type": "{Boolean}", + "readonly": "", + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 432, + "description": "

If true the store is attempting to reload the record from the adapter.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
record.isReloading; // false\nrecord.reload();\nrecord.isReloading; // true
\n
\n
\n \n", + "itemtype": "property", + "name": "isReloading", + "access": "public", + "tagname": "", + "type": "{Boolean}", + "readonly": "", + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 450, + "description": "

All ember models have an id property. This is an identifier\nmanaged by an external source. These are always coerced to be\nstrings before being used internally. Note when declaring the\nattributes for a model it is an error to declare an id\nattribute.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let record = store.createRecord('model');\nrecord.id; // null\n\nstore.findRecord('model', 1).then(function(model) {\n  model.id; // '1'\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "id", + "access": "public", + "tagname": "", + "type": "{String}", + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 503, + "itemtype": "property", + "name": "currentState", + "access": "private", + "tagname": "", + "type": "{Object}", + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 527, + "description": "

The store service instance which created this record instance

\n", + "itemtype": "property", + "name": "store", + "access": "public", + "tagname": "", + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 534, + "description": "

When the record is in the invalid state this object will contain\nany errors returned by the adapter. When present the errors hash\ncontains keys corresponding to the invalid property names\nand values which are arrays of Javascript objects with two keys:

\n
    \n
  • message A string containing the error message from the backend
  • \n
  • attribute The name of the property associated with this error message
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
record.errors.length; // 0\nrecord.set('foo', 'invalid value');\nrecord.save().catch(function() {\n  record.errors.foo;\n  // [{message: 'foo should be a number.', attribute: 'foo'}]\n});
\n
\n
\n \n

The errors property is useful for displaying error messages to\nthe user.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
<label>Username: <Input @value={{@model.username}} /> </label>\n{{#each @model.errors.username as |error|}}\n  <div class="error">\n    {{error.message}}\n  </div>\n{{/each}}\n<label>Email: <Input @value={{@model.email}} /> </label>\n{{#each @model.errors.email as |error|}}\n  <div class="error">\n    {{error.message}}\n  </div>\n{{/each}}
\n
\n
\n \n

You can also access the special messages property on the error\nobject to get an array of all the error strings.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
{{#each @model.errors.messages as |message|}}\n  <div class="error">\n    {{message}}\n  </div>\n{{/each}}
\n
\n
\n \n", + "itemtype": "property", + "name": "errors", + "access": "public", + "tagname": "", + "type": "{Errors}", + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 593, + "description": "

This property holds the AdapterError object with which\nlast adapter operation was rejected.

\n", + "itemtype": "property", + "name": "adapterError", + "access": "public", + "tagname": "", + "type": "{AdapterError}", + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 1198, + "description": "

Represents the model's class name as a string. This can be used to look up the model's class name through\nStore's modelFor method.

\n

modelName is generated for you by Ember Data. It will be a lowercased, dasherized string.\nFor example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
store.modelFor('post').modelName; // 'post'\nstore.modelFor('blog-post').modelName; // 'blog-post'
\n
\n
\n \n

The most common place you'll want to access modelName is in your serializer's payloadKeyFromModelName method. For example, to change payload\nkeys to underscore (instead of dasherized), you might use the following code:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import RESTSerializer from '@ember-data/serializer/rest';\nimport { underscore } from '<app-name>/utils/string-utils';\n\nexport default const PostSerializer = RESTSerializer.extend({\n  payloadKeyFromModelName(modelName) {\n    return underscore(modelName);\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "modelName", + "access": "public", + "tagname": "", + "type": "String", + "readonly": "", + "static": 1, + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 1478, + "itemtype": "property", + "description": "

The model's relationships as a map, keyed on the type of the\nrelationship. The value of each entry is an array containing a descriptor\nfor each relationship with that type, describing the name of the relationship\nas well as the type.

\n

For example, given the following model definition:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/models/blog.js
1\n2\n3\n4\n5\n
import Model, { belongsTo, hasMany } from '@ember-data/model';\n\nexport default class BlogModel extends Model {\n  @hasmany('post') posts;\n }
\n
\n
\n \n

This computed property would return a map describing these\nrelationships, like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { get } from '@ember/object';\nimport Blog from 'app/models/blog';\nimport User from 'app/models/user';\nimport Post from 'app/models/post';\n\nlet relationships = Blog.relationships;\nrelationships.user;\n//=> [ { name: 'users', kind: 'hasMany' },\n//     { name: 'owner', kind: 'belongsTo' } ]\nrelationships.post;\n//=> [ { name: 'posts', kind: 'hasMany' } ]
\n
\n
\n \n

@belongsto('user') owner;

\n", + "name": "relationships", + "access": "public", + "tagname": "", + "static": 1, + "type": "Map", + "readonly": "", + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 1544, + "itemtype": "property", + "description": "

A hash containing lists of the model's relationships, grouped\nby the relationship kind. For example, given a model with this\ndefinition:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/models/blog.js
1\n2\n3\n4\n5\n
import Model, { belongsTo, hasMany } from '@ember-data/model';\n\nexport default class BlogModel extends Model {\n  @hasmany('post') posts;\n }
\n
\n
\n \n

This property would contain the following:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import { get } from '@ember/object';\nimport Blog from 'app/models/blog';\n\nlet relationshipNames = Blog.relationshipNames;\nrelationshipNames.hasMany;\n//=> ['users', 'posts']\nrelationshipNames.belongsTo;\n//=> ['owner']
\n
\n
\n \n

@belongsto('user') owner;

\n", + "name": "relationshipNames", + "access": "public", + "tagname": "", + "static": 1, + "type": "Object", + "readonly": "", + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 1599, + "itemtype": "property", + "description": "

An array of types directly related to a model. Each type will be\nincluded once, regardless of the number of relationships it has with\nthe model.

\n

For example, given a model with this definition:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/models/blog.js
1\n2\n3\n4\n5\n
import Model, { belongsTo, hasMany } from '@ember-data/model';\n\nexport default class BlogModel extends Model {\n  @hasmany('post') posts;\n }
\n
\n
\n \n

This property would contain the following:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { get } from '@ember/object';\nimport Blog from 'app/models/blog';\n\nlet relatedTypes = Blog.relatedTypes');\n//=> ['user', 'post']
\n
\n
\n \n

@belongsto('user') owner;

\n", + "name": "relatedTypes", + "access": "public", + "tagname": "", + "static": 1, + "type": "Ember.Array", + "readonly": "", + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 1660, + "itemtype": "property", + "description": "

A map whose keys are the relationships of a model and whose values are\nrelationship descriptors.

\n

For example, given a model with this\ndefinition:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/models/blog.js
1\n2\n3\n4\n5\n
import Model, { belongsTo, hasMany } from '@ember-data/model';\n\nexport default class BlogModel extends Model {\n  @hasmany('post') posts;\n }
\n
\n
\n \n

This property would contain the following:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import { get } from '@ember/object';\nimport Blog from 'app/models/blog';\n\nlet relationshipsByName = Blog.relationshipsByName;\nrelationshipsByName.users;\n//=> { key: 'users', kind: 'hasMany', type: 'user', options: Object, isRelationship: true }\nrelationshipsByName.owner;\n//=> { key: 'owner', kind: 'belongsTo', type: 'user', options: Object, isRelationship: true }
\n
\n
\n \n

@belongsto('user') owner;

\n", + "name": "relationshipsByName", + "access": "public", + "tagname": "", + "static": 1, + "type": "Map", + "readonly": "", + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 1742, + "itemtype": "property", + "description": "

A map whose keys are the fields of the model and whose values are strings\ndescribing the kind of the field. A model's fields are the union of all of its\nattributes and relationships.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/models/blog.js
1\n2\n3\n4\n5\n6\n7\n
import Model, { attr, belongsTo, hasMany } from '@ember-data/model';\n\nexport default class BlogModel extends Model {\n  @hasmany('post') posts;\n  @belongsto('user') owner;\n  @attr('string') title;\n }
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import { get } from '@ember/object';\nimport Blog from 'app/models/blog'\n\nlet fields = Blog.fields;\nfields.forEach(function(kind, field) {\n   // do thing\n });\n\n// prints:\n// users, hasMany\n// owner, belongsTo\n// posts, hasMany\n// title, attribute
\n
\n
\n \n", + "name": "fields", + "access": "public", + "tagname": "", + "static": 1, + "type": "Map", + "readonly": "", + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 1878, + "itemtype": "property", + "description": "

A map whose keys are the attributes of the model (properties\ndescribed by attr) and whose values are the meta object for the\nproperty.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/models/person.js
1\n2\n3\n4\n5\n
import Model, { attr } from '@ember-data/model';\n\nexport default class PersonModel extends Model {\n  @attr('date') birthday;\n }
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import { get } from '@ember/object';\nimport Person from 'app/models/person'\n\nlet attributes = Person.attributes\n\nattributes.forEach(function(meta, name) {\n   // do thing\n });\n\n// prints:\n// firstName {type: "string", isAttribute: true, options: Object, parentType: function, name: "firstName"}\n// lastName {type: "string", isAttribute: true, options: Object, parentType: function, name: "lastName"}\n// birthday {type: "date", isAttribute: true, options: Object, parentType: function, name: "birthday"}
\n
\n
\n \n", + "name": "attributes", + "access": "public", + "tagname": "", + "static": 1, + "type": "{Map}", + "readonly": "", + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 1942, + "itemtype": "property", + "description": "

A map whose keys are the attributes of the model (properties\ndescribed by attr) and whose values are type of transformation\napplied to each attribute. This map does not include any\nattributes that do not have an transformation type.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/models/person.js
1\n2\n3\n4\n5\n
import Model, { attr } from '@ember-data/model';\n\nexport default class PersonModel extends Model {\n  @attr('date') birthday;\n }
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import { get } from '@ember/object';\nimport Person from 'app/models/person';\n\nlet transformedAttributes = Person.transformedAttributes\n\ntransformedAttributes.forEach(function(field, type) {\n   // do thing\n });\n\n// prints:\n// lastName string\n// birthday date
\n
\n
\n \n", + "name": "transformedAttributes", + "access": "public", + "tagname": "", + "static": 1, + "type": "{Map}", + "readonly": "", + "class": "Model", + "module": "@ember-data/model" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "Ember.EmberObject", + "type": "missing" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/model", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-NotFoundError.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-NotFoundError.json new file mode 100644 index 000000000..c569c0ccd --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-NotFoundError.json @@ -0,0 +1,49 @@ +{ + "data": { + "id": "ember-data-5.3.0-NotFoundError", + "type": "class", + "attributes": { + "name": "NotFoundError", + "shortname": "NotFoundError", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/adapter/error", + "namespace": "", + "file": "../adapter/src/error.js", + "line": 279, + "access": "public", + "description": "

A NotFoundError equates to a HTTP 404 Not Found response status.\nIt is used by an adapter to signal that a request to the external API\nwas rejected because the resource could not be found on the API.

\n

An example use case would be to detect if the user has entered a route\nfor a specific model that does not exist. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Route from '@ember/routing/route';\nimport { NotFoundError } from '@ember-data/adapter/error';\nimport { inject as service } from '@ember/service';\nimport { action } from '@ember/object';\n\nexport default class PostRoute extends Route {\n  @service store;\n  model(params) {\n    return this.store.findRecord('post', params.post_id);\n  }\n  @action error(error, transition) {\n    if (error instanceof NotFoundError) {\n      // redirect to a list of all posts instead\n      this.transitionTo('posts');\n    } else {\n      // otherwise let the error bubble\n      return true;\n    }\n  }\n}
\n
\n
\n \n", + "tagname": "", + "extends": "AdapterError", + "methods": [], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-data-5.3.0-AdapterError", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/adapter/error", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-NotificationManager.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-NotificationManager.json new file mode 100644 index 000000000..56e1592ff --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-NotificationManager.json @@ -0,0 +1,120 @@ +{ + "data": { + "id": "ember-data-5.3.0-NotificationManager", + "type": "class", + "attributes": { + "name": "NotificationManager", + "shortname": "NotificationManager", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/store", + "namespace": "", + "file": "../store/src/-private/managers/notification-manager.ts", + "line": 71, + "description": "

The NotificationManager provides the ability to subscribe to\nchanges to Cache state.

\n

This Feature is what allows EmberData to create subscriptions that\nwork with any framework or change-notification system.

\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "../packages/store/src/-private/managers/notification-manager.ts", + "line": 102, + "description": "

Subscribe to changes for a given resource identifier, resource addition/removal, or document addition/removal.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
export type CacheOperation = 'added' | 'removed' | 'updated' | 'state';\n\nexport interface NotificationCallback {\n  (identifier: StableRecordIdentifier, notificationType: 'attributes' | 'relationships', key?: string): void;\n  (identifier: StableRecordIdentifier, notificationType: 'errors' | 'meta' | 'identity' | 'state'): void;\n  (identifier: StableRecordIdentifier, notificationType: NotificationType, key?: string): void;\n}\nexport interface ResourceOperationCallback {\n  // resource updates\n  (identifier: StableRecordIdentifier, notificationType: CacheOperation): void;\n}\nexport interface DocumentOperationCallback {\n  // document updates\n  (identifier: StableDocumentIdentifier, notificationType: CacheOperation): void;\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "subscribe", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "", + "type": "StableDocumentIdentifier | StableRecordIdentifier | 'resource' | 'document'" + }, + { + "name": "callback", + "description": "", + "type": "NotificationCallback | ResourceOperationCallback | DocumentOperationCallback" + } + ], + "return": { + "description": "an opaque token to be used with unsubscribe", + "type": "UnsubscribeToken" + }, + "class": "NotificationManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/notification-manager.ts", + "line": 157, + "description": "

remove a previous subscription

\n", + "itemtype": "method", + "name": "unsubscribe", + "access": "public", + "tagname": "", + "params": [ + { + "name": "token", + "description": "", + "type": "UnsubscribeToken" + } + ], + "class": "NotificationManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/notification-manager.ts", + "line": 170, + "description": "

Custom Caches and Application Code should not call this method directly.

\n", + "itemtype": "method", + "name": "notify", + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "value", + "description": "" + }, + { + "name": "key", + "description": "" + } + ], + "return": { + "description": "whether a notification was delivered to any subscribers", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "NotificationManager", + "module": "@ember-data/store" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/store", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-NumberTransform.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-NumberTransform.json new file mode 100644 index 000000000..16103f2cb --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-NumberTransform.json @@ -0,0 +1,45 @@ +{ + "data": { + "id": "ember-data-5.3.0-NumberTransform", + "type": "class", + "attributes": { + "name": "NumberTransform", + "shortname": "NumberTransform", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/serializer", + "namespace": "", + "file": "../serializer/src/-private/transforms/number.js", + "line": 9, + "access": "public", + "description": "

The NumberTransform class is used to serialize and deserialize\nnumeric attributes on Ember Data record objects. This transform is\nused when number is passed as the type parameter to the\nattr function.

\n

Usage

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/models/score.js
1\n2\n3\n4\n5\n
import Model, { attr, belongsTo } from '@ember-data/model';\n\nexport default class ScoreModel extends Model {\n  @attr('date') date;\n}
\n
\n
\n \n

@belongsto('player') player;

\n", + "tagname": "", + "methods": [], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/serializer", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-PromiseBelongsTo.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-PromiseBelongsTo.json new file mode 100644 index 000000000..1d7d5d664 --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-PromiseBelongsTo.json @@ -0,0 +1,49 @@ +{ + "data": { + "id": "ember-data-5.3.0-PromiseBelongsTo", + "type": "class", + "attributes": { + "name": "PromiseBelongsTo", + "shortname": "PromiseBelongsTo", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/model", + "namespace": "", + "file": "../model/src/-private/promise-belongs-to.ts", + "line": 39, + "description": "

A PromiseBelongsTo is a PromiseObject that also proxies certain method calls\nto the underlying belongsTo model.\nRight now we proxy:

\n
    \n
  • reload()
  • \n
\n", + "extends": "PromiseObject", + "access": "private", + "tagname": "", + "methods": [], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": { + "id": "PromiseObject", + "type": "missing" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/model", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-PromiseManyArray.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-PromiseManyArray.json new file mode 100644 index 000000000..bdf89b775 --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-PromiseManyArray.json @@ -0,0 +1,232 @@ +{ + "data": { + "id": "ember-data-5.3.0-PromiseManyArray", + "type": "class", + "attributes": { + "name": "PromiseManyArray", + "shortname": "PromiseManyArray", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/model", + "namespace": "", + "file": "../model/src/-private/promise-many-array.ts", + "line": 20, + "description": "

This class is returned as the result of accessing an async hasMany relationship\non an instance of a Model extending from @ember-data/model.

\n

A PromiseManyArray is an iterable proxy that allows templates to consume related\nManyArrays and update once their contents are no longer pending.

\n

In your JS code you should resolve the promise first.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
const comments = await post.comments;
\n
\n
\n \n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "../packages/model/src/-private/promise-many-array.ts", + "line": 82, + "description": "

Iterate the proxied content. Called by the glimmer iterator in #each\nWe do not guarantee that forEach will always be available. This\nmay eventually be made to use Symbol.Iterator once glimmer supports it.

\n", + "itemtype": "method", + "name": "forEach", + "params": [ + { + "name": "cb", + "description": "" + } + ], + "return": { + "description": "" + }, + "access": "private", + "tagname": "", + "class": "PromiseManyArray", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/promise-many-array.ts", + "line": 98, + "description": "

Reload the relationship

\n", + "itemtype": "method", + "name": "reload", + "access": "public", + "tagname": "", + "params": [ + { + "name": "options", + "description": "" + } + ], + "return": { + "description": "" + }, + "class": "PromiseManyArray", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/promise-many-array.ts", + "line": 142, + "description": "

chain this promise

\n", + "itemtype": "method", + "name": "then", + "access": "public", + "tagname": "", + "params": [ + { + "name": "success", + "description": "" + }, + { + "name": "fail", + "description": "" + } + ], + "return": { + "description": "Promise" + }, + "class": "PromiseManyArray", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/promise-many-array.ts", + "line": 155, + "description": "

catch errors thrown by this promise

\n", + "itemtype": "method", + "name": "catch", + "access": "public", + "tagname": "", + "params": [ + { + "name": "callback", + "description": "" + } + ], + "return": { + "description": "Promise" + }, + "class": "PromiseManyArray", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/promise-many-array.ts", + "line": 166, + "description": "

run cleanup after this promise completes

\n", + "itemtype": "method", + "name": "finally", + "access": "public", + "tagname": "", + "params": [ + { + "name": "callback", + "description": "" + } + ], + "return": { + "description": "Promise" + }, + "class": "PromiseManyArray", + "module": "@ember-data/model" + } + ], + "events": [], + "properties": [ + { + "file": "../packages/model/src/-private/promise-many-array.ts", + "line": 56, + "description": "

Retrieve the length of the content

\n", + "itemtype": "property", + "name": "length", + "access": "public", + "tagname": "", + "class": "PromiseManyArray", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/promise-many-array.ts", + "line": 113, + "description": "

Whether the loading promise is still pending

\n", + "itemtype": "property", + "name": "isPending", + "type": "Boolean", + "access": "public", + "tagname": "", + "class": "PromiseManyArray", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/promise-many-array.ts", + "line": 120, + "description": "

Whether the loading promise rejected

\n", + "itemtype": "property", + "name": "isRejected", + "type": "Boolean", + "access": "public", + "tagname": "", + "class": "PromiseManyArray", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/promise-many-array.ts", + "line": 127, + "description": "

Whether the loading promise succeeded

\n", + "itemtype": "property", + "name": "isFulfilled", + "type": "Boolean", + "access": "public", + "tagname": "", + "class": "PromiseManyArray", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/promise-many-array.ts", + "line": 134, + "description": "

Whether the loading promise completed (resolved or rejected)

\n", + "itemtype": "property", + "name": "isSettled", + "type": "Boolean", + "access": "public", + "tagname": "", + "class": "PromiseManyArray", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/promise-many-array.ts", + "line": 188, + "description": "

Retrieve the links for this relationship

\n", + "itemtype": "property", + "name": "links", + "access": "public", + "tagname": "", + "class": "PromiseManyArray", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/promise-many-array.ts", + "line": 198, + "description": "

Retrieve the meta for this relationship

\n", + "itemtype": "property", + "name": "meta", + "access": "public", + "tagname": "", + "class": "PromiseManyArray", + "module": "@ember-data/model" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/model", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-RESTAdapter.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-RESTAdapter.json new file mode 100644 index 000000000..6a67c23dc --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-RESTAdapter.json @@ -0,0 +1,1801 @@ +{ + "data": { + "id": "ember-data-5.3.0-RESTAdapter", + "type": "class", + "attributes": { + "name": "RESTAdapter", + "shortname": "RESTAdapter", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/adapter/rest", + "namespace": "", + "file": "../adapter/src/rest.ts", + "line": 69, + "description": "
\n

\n ⚠️ This is LEGACY documentation for a feature that is no longer encouraged to be used.\n If starting a new app or thinking of implementing a new adapter, consider writing a\n Handler instead to be used with the RequestManager\n

\n
\n\n

The REST adapter allows your store to communicate with an HTTP server by\n transmitting JSON via XHR.

\n

This adapter is designed around the idea that the JSON exchanged with\n the server should be conventional. It builds URLs in a manner that follows\n the structure of most common REST-style web services.

\n

Success and failure

\n

The REST adapter will consider a success any response with a status code\n of the 2xx family ("Success"), as well as 304 ("Not Modified"). Any other\n status code will be considered a failure.

\n

On success, the request promise will be resolved with the full response\n payload.

\n

Failed responses with status code 422 ("Unprocessable Entity") will be\n considered "invalid". The response will be discarded, except for the\n errors key. The request promise will be rejected with a InvalidError.\n This error object will encapsulate the saved errors value.

\n

Any other status codes will be treated as an "adapter error". The request\n promise will be rejected, similarly to the "invalid" case, but with\n an instance of AdapterError instead.

\n

JSON Structure

\n

The REST adapter expects the JSON returned from your server to follow\n these conventions.

\n

Object Root

\n

The JSON payload should be an object that contains the record inside a\n root property. For example, in response to a GET request for\n /posts/1, the JSON should look like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
 {\n   "posts": {\n     "id": 1,\n     "title": "I'm Running to Reform the W3C's Tag",\n     "author": "Yehuda Katz"\n   }\n }
\n
\n
\n \n

Similarly, in response to a GET request for /posts, the JSON should\n look like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
 {\n   "posts": [\n     {\n       "id": 1,\n       "title": "I'm Running to Reform the W3C's Tag",\n       "author": "Yehuda Katz"\n     },\n     {\n       "id": 2,\n       "title": "Rails is omakase",\n       "author": "D2H"\n     }\n   ]\n }
\n
\n
\n \n

Note that the object root can be pluralized for both a single-object response\n and an array response: the REST adapter is not strict on this. Further, if the\n HTTP server responds to a GET request to /posts/1 (e.g. the response to a\n findRecord query) with more than one object in the array, Ember Data will\n only display the object with the matching ID.

\n

Conventional Names

\n

Attribute names in your JSON payload should be the camelCased versions of\n the attributes in your Ember.js models.

\n

For example, if you have a Person model:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/models/person.js
1\n2\n3\n4\n5\n6\n7\n
 import Model, { attr } from '@ember-data/model';\n\n export default Model.extend({\n   firstName: attr('string'),\n   lastName: attr('string'),\n   occupation: attr('string')\n });
\n
\n
\n \n

The JSON returned should look like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
 {\n   "people": {\n     "id": 5,\n     "firstName": "Zaphod",\n     "lastName": "Beeblebrox",\n     "occupation": "President"\n   }\n }
\n
\n
\n \n

Relationships

\n

Relationships are usually represented by ids to the record in the\n relationship. The related records can then be sideloaded in the\n response under a key for the type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
 {\n   "posts": {\n     "id": 5,\n     "title": "I'm Running to Reform the W3C's Tag",\n     "author": "Yehuda Katz",\n     "comments": [1, 2]\n   },\n   "comments": [{\n     "id": 1,\n     "author": "User 1",\n     "message": "First!",\n   }, {\n     "id": 2,\n     "author": "User 2",\n     "message": "Good Luck!",\n   }]\n }
\n
\n
\n \n

If the records in the relationship are not known when the response\n is serialized it's also possible to represent the relationship as a\n URL using the links key in the response. Ember Data will fetch\n this URL to resolve the relationship when it is accessed for the\n first time.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
 {\n   "posts": {\n     "id": 5,\n     "title": "I'm Running to Reform the W3C's Tag",\n     "author": "Yehuda Katz",\n     "links": {\n       "comments": "/posts/5/comments"\n     }\n   }\n }
\n
\n
\n \n

Errors

\n

If a response is considered a failure, the JSON payload is expected to include\n a top-level key errors, detailing any specific issues. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
 {\n   "errors": {\n     "msg": "Something went wrong"\n   }\n }
\n
\n
\n \n

This adapter does not make any assumptions as to the format of the errors\n object. It will simply be passed along as is, wrapped in an instance\n of InvalidError or AdapterError. The serializer can interpret it\n afterwards.

\n

Customization

\n

Endpoint path customization

\n

Endpoint paths can be prefixed with a namespace by setting the namespace\n property on the adapter:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n
 import RESTAdapter from '@ember-data/adapter/rest';\n\n export default class ApplicationAdapter extends RESTAdapter {\n   namespace = 'api/1';\n }
\n
\n
\n \n

Requests for the Person model would now target /api/1/people/1.

\n

Host customization

\n

An adapter can target other hosts by setting the host property.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n
 import RESTAdapter from '@ember-data/adapter/rest';\n\n export default class ApplicationAdapter extends RESTAdapter {\n   host = 'https://api.example.com';\n }
\n
\n
\n \n

Headers customization

\n

Some APIs require HTTP headers, e.g. to provide an API key. Arbitrary\n headers can be set as key/value pairs on the RESTAdapter's headers\n object and Ember Data will send them along with each ajax request.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
 import RESTAdapter from '@ember-data/adapter/rest';\n import { computed } from '@ember/object';\n\n export default class ApplicationAdapter extends RESTAdapter {\n   headers: computed(function() {\n     return {\n       'API_KEY': 'secret key',\n       'ANOTHER_HEADER': 'Some header value'\n     };\n   }\n }
\n
\n
\n \n

headers can also be used as a computed property to support dynamic\n headers. In the example below, the session object has been\n injected into an adapter by Ember's container.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
 import RESTAdapter from '@ember-data/adapter/rest';\n import { computed } from '@ember/object';\n\n export default class ApplicationAdapter extends RESTAdapter {\n   headers: computed('session.authToken', function() {\n     return {\n       'API_KEY': this.session.authToken,\n       'ANOTHER_HEADER': 'Some header value'\n     };\n   })\n }
\n
\n
\n \n

In some cases, your dynamic headers may require data from some\n object outside of Ember's observer system (for example\n document.cookie). You can use the\n volatile\n function to set the property into a non-cached mode causing the headers to\n be recomputed with every request.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
 import RESTAdapter from '@ember-data/adapter/rest';\n import { computed } from '@ember/object';\n\n export default class ApplicationAdapter extends RESTAdapter {\n   headers: computed(function() {\n     return {\n       'API_KEY': document.cookie.match(/apiKey\\=([^;]*)/)['1'],\n       'ANOTHER_HEADER': 'Some header value'\n     };\n   }).volatile()\n }
\n
\n
\n \n

@mainName @ember-data/adapter/rest\n @tag main

\n", + "_main": true, + "access": "public", + "tagname": "", + "is_constructor": 1, + "extends": "Adapter", + "uses": [ + "BuildURLMixin" + ], + "methods": [ + { + "file": "../packages/adapter/src/rest.ts", + "line": 370, + "description": "

By default, the RESTAdapter will send the query params sorted alphabetically to the\nserver.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
store.query('posts', { sort: 'price', category: 'pets' });
\n
\n
\n \n

will generate a requests like this /posts?category=pets&sort=price, even if the\nparameters were specified in a different order.

\n

That way the generated URL will be deterministic and that simplifies caching mechanisms\nin the backend.

\n

Setting sortQueryParams to a falsey value will respect the original order.

\n

In case you want to sort the query parameters with a different criteria, set\nsortQueryParams to your custom sort function.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import RESTAdapter from '@ember-data/adapter/rest';\n\nexport default class ApplicationAdapter extends RESTAdapter {\n  sortQueryParams(params) {\n    let sortedKeys = Object.keys(params).sort().reverse();\n    let len = sortedKeys.length, newParams = {};\n\n    for (let i = 0; i < len; i++) {\n      newParams[sortedKeys[i]] = params[sortedKeys[i]];\n    }\n\n    return newParams;\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "sortQueryParams", + "params": [ + { + "name": "obj", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RESTAdapter", + "module": "@ember-data/adapter/rest" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 552, + "description": "

Called by the store in order to fetch the JSON for a given\ntype and ID.

\n

The findRecord method makes an Ajax request to a URL computed by\nbuildURL, and returns a promise for the resulting payload.

\n

This method performs an HTTP GET request with the id provided as part of the query string.

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "findRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "", + "type": "Model" + }, + { + "name": "id", + "description": "", + "type": "String" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "class": "RESTAdapter", + "module": "@ember-data/adapter/rest" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 577, + "description": "

Called by the store in order to fetch a JSON array for all\nof the records for a given type.

\n

The findAll method makes an Ajax (HTTP GET) request to a URL computed by buildURL, and returns a\npromise for the resulting payload.

\n", + "itemtype": "method", + "name": "findAll", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "", + "type": "Model" + }, + { + "name": "neverSet", + "description": "a value is never provided to this argument", + "type": "Undefined" + }, + { + "name": "snapshotRecordArray", + "description": "", + "type": "SnapshotRecordArray" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "class": "RESTAdapter", + "module": "@ember-data/adapter/rest" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 608, + "description": "

Called by the store in order to fetch a JSON array for\nthe records that match a particular query.

\n

The query method makes an Ajax (HTTP GET) request to a URL\ncomputed by buildURL, and returns a promise for the resulting\npayload.

\n

The query argument is a simple JavaScript object that will be passed directly\nto the server as parameters.

\n", + "itemtype": "method", + "name": "query", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "", + "type": "Model" + }, + { + "name": "query", + "description": "", + "type": "Object" + }, + { + "name": "recordArray", + "description": "", + "type": "Collection" + }, + { + "name": "adapterOptions", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "class": "RESTAdapter", + "module": "@ember-data/adapter/rest" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 638, + "description": "

Called by the store in order to fetch a JSON object for\nthe record that matches a particular query.

\n

The queryRecord method makes an Ajax (HTTP GET) request to a URL\ncomputed by buildURL, and returns a promise for the resulting\npayload.

\n

The query argument is a simple JavaScript object that will be passed directly\nto the server as parameters.

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "queryRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "", + "type": "Model" + }, + { + "name": "query", + "description": "", + "type": "Object" + }, + { + "name": "adapterOptions", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "class": "RESTAdapter", + "module": "@ember-data/adapter/rest" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 673, + "description": "

Called by the store in order to fetch several records together if coalesceFindRequests is true

\n

For example, if the original payload looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
{\n  "id": 1,\n  "title": "Rails is omakase",\n  "comments": [ 1, 2, 3 ]\n}
\n
\n
\n \n

The IDs will be passed as a URL-encoded Array of IDs, in this form:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
ids[]=1&ids[]=2&ids[]=3
\n
\n
\n

Many servers, such as Rails and PHP, will automatically convert this URL-encoded array\ninto an Array for you on the server-side. If you want to encode the\nIDs, differently, just override this (one-line) method.

\n

The findMany method makes an Ajax (HTTP GET) request to a URL computed by buildURL, and returns a\npromise for the resulting payload.

\n", + "itemtype": "method", + "name": "findMany", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "", + "type": "Model" + }, + { + "name": "ids", + "description": "", + "type": "Array" + }, + { + "name": "snapshots", + "description": "", + "type": "Array" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "class": "RESTAdapter", + "module": "@ember-data/adapter/rest" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 712, + "description": "

Called by the store in order to fetch a JSON array for\nthe unloaded records in a has-many relationship that were originally\nspecified as a URL (inside of links).

\n

For example, if your original payload looks like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
{\n  "post": {\n    "id": 1,\n    "title": "Rails is omakase",\n    "links": { "comments": "/posts/1/comments" }\n  }\n}
\n
\n
\n \n

This method will be called with the parent record and /posts/1/comments.

\n

The findHasMany method will make an Ajax (HTTP GET) request to the originally specified URL.

\n

The format of your links value will influence the final request URL via the urlPrefix method:

\n
    \n
  • Links beginning with //, http://, https://, will be used as is, with no further manipulation.

    \n
  • \n
  • Links beginning with a single / will have the current adapter's host value prepended to it.

    \n
  • \n
  • Links with no beginning / will have a parentURL prepended to it, via the current adapter's buildURL.

    \n
  • \n
\n", + "itemtype": "method", + "name": "findHasMany", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "url", + "description": "", + "type": "String" + }, + { + "name": "relationship", + "description": "meta object describing the relationship", + "type": "Object" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "class": "RESTAdapter", + "module": "@ember-data/adapter/rest" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 767, + "description": "

Called by the store in order to fetch the JSON for the unloaded record in a\nbelongs-to relationship that was originally specified as a URL (inside of\nlinks).

\n

For example, if your original payload looks like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
{\n  "person": {\n    "id": 1,\n    "name": "Tom Dale",\n    "links": { "group": "/people/1/group" }\n  }\n}
\n
\n
\n \n

This method will be called with the parent record and /people/1/group.

\n

The findBelongsTo method will make an Ajax (HTTP GET) request to the originally specified URL.

\n

The format of your links value will influence the final request URL via the urlPrefix method:

\n
    \n
  • Links beginning with //, http://, https://, will be used as is, with no further manipulation.

    \n
  • \n
  • Links beginning with a single / will have the current adapter's host value prepended to it.

    \n
  • \n
  • Links with no beginning / will have a parentURL prepended to it, via the current adapter's buildURL.

    \n
  • \n
\n", + "itemtype": "method", + "name": "findBelongsTo", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "url", + "description": "", + "type": "String" + }, + { + "name": "relationship", + "description": "meta object describing the relationship", + "type": "Object" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "class": "RESTAdapter", + "module": "@ember-data/adapter/rest" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 816, + "description": "

Called by the store when a newly created record is\nsaved via the save method on a model record instance.

\n

The createRecord method serializes the record and makes an Ajax (HTTP POST) request\nto a URL computed by buildURL.

\n

See serialize for information on how to customize the serialized form\nof a record.

\n", + "itemtype": "method", + "name": "createRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "", + "type": "Model" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "class": "RESTAdapter", + "module": "@ember-data/adapter/rest" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 841, + "description": "

Called by the store when an existing record is saved\nvia the save method on a model record instance.

\n

The updateRecord method serializes the record and makes an Ajax (HTTP PUT) request\nto a URL computed by buildURL.

\n

See serialize for information on how to customize the serialized form\nof a record.

\n", + "itemtype": "method", + "name": "updateRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "schema", + "description": "", + "type": "Model" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "class": "RESTAdapter", + "module": "@ember-data/adapter/rest" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 868, + "description": "

Called by the store when a record is deleted.

\n

The deleteRecord method makes an Ajax (HTTP DELETE) request to a URL computed by buildURL.

\n", + "itemtype": "method", + "name": "deleteRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "", + "type": "Model" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "class": "RESTAdapter", + "module": "@ember-data/adapter/rest" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 918, + "description": "

Organize records into groups, each of which is to be passed to separate\ncalls to findMany.

\n

This implementation groups together records that have the same base URL but\ndiffering ids. For example /comments/1 and /comments/2 will be grouped together\nbecause we know findMany can coalesce them together as /comments?ids[]=1&ids[]=2

\n

It also supports urls where ids are passed as a query param, such as /comments?id=1\nbut not those where there is more than 1 query param such as /comments?id=2&name=David\nCurrently only the query param of id is supported. If you need to support others, please\noverride this or the _stripIDFromURL method.

\n

It does not group records that have differing base urls, such as for example: /posts/1/comments/2\nand /posts/2/comments/3

\n", + "itemtype": "method", + "name": "groupRecordsForFindMany", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "snapshots", + "description": "", + "type": "Array" + } + ], + "return": { + "description": "an array of arrays of records, each of which is to be\n loaded separately by `findMany`.", + "type": "Array" + }, + "class": "RESTAdapter", + "module": "@ember-data/adapter/rest" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 965, + "description": "

Takes an ajax response, and returns the json payload or an error.

\n

By default this hook just returns the json payload passed to it.\nYou might want to override it in two cases:

\n
    \n
  1. Your API might return useful results in the response headers.\nResponse headers are passed in as the second argument.

    \n
  2. \n
  3. Your API might return errors as successful responses with status code\n200 and an Errors text or object. You can return a InvalidError or a\nAdapterError (or a sub class) from this hook and it will automatically\nreject the promise and put your record into the invalid or error state.

    \n
  4. \n
\n

Returning a InvalidError from this method will cause the\nrecord to transition into the invalid state and make the\nerrors object available on the record. When returning an\nInvalidError the store will attempt to normalize the error data\nreturned from the server using the serializer's extractErrors\nmethod.

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "handleResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "status", + "description": "", + "type": "Number" + }, + { + "name": "headers", + "description": "", + "type": "Object" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "requestData", + "description": "- the original request information", + "type": "Object" + } + ], + "return": { + "description": "response", + "type": "Object | AdapterError" + }, + "class": "RESTAdapter", + "module": "@ember-data/adapter/rest" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 1028, + "description": "

Default handleResponse implementation uses this hook to decide if the\nresponse is a success.

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "isSuccess", + "access": "public", + "tagname": "", + "params": [ + { + "name": "status", + "description": "", + "type": "Number" + }, + { + "name": "headers", + "description": "", + "type": "Object" + }, + { + "name": "payload", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "RESTAdapter", + "module": "@ember-data/adapter/rest" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 1044, + "description": "

Default handleResponse implementation uses this hook to decide if the\nresponse is an invalid error.

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "isInvalid", + "access": "public", + "tagname": "", + "params": [ + { + "name": "status", + "description": "", + "type": "Number" + }, + { + "name": "headers", + "description": "", + "type": "Object" + }, + { + "name": "payload", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "RESTAdapter", + "module": "@ember-data/adapter/rest" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 1060, + "description": "

Takes a URL, an HTTP method and a hash of data, and makes an\nHTTP request.

\n

When the server responds with a payload, Ember Data will call into extractSingle\nor extractArray (depending on whether the original query was for one record or\nmany records).

\n

By default, ajax method has the following behavior:

\n
    \n
  • It sets the response dataType to "json"
  • \n
  • If the HTTP method is not "GET", it sets the Content-Type to be\napplication/json; charset=utf-8
  • \n
  • If the HTTP method is not "GET", it stringifies the data passed in. The\ndata is the serialized record in the case of a save.
  • \n
  • Registers success and failure handlers.
  • \n
\n", + "itemtype": "method", + "name": "ajax", + "access": "private", + "tagname": "", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + }, + { + "name": "type", + "description": "The request type GET, POST, PUT, DELETE etc.", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "class": "RESTAdapter", + "module": "@ember-data/adapter/rest" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 1105, + "itemtype": "method", + "name": "_ajaxRequest", + "access": "private", + "tagname": "", + "params": [ + { + "name": "options", + "description": "jQuery ajax options to be used for the ajax request", + "type": "Object" + } + ], + "class": "RESTAdapter", + "module": "@ember-data/adapter/rest" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 1129, + "itemtype": "method", + "name": "ajaxOptions", + "access": "private", + "tagname": "", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + }, + { + "name": "type", + "description": "The request type GET, POST, PUT, DELETE etc.", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "RESTAdapter", + "module": "@ember-data/adapter/rest" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 1204, + "itemtype": "method", + "name": "parseErrorResponse", + "access": "private", + "tagname": "", + "params": [ + { + "name": "responseText", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "RESTAdapter", + "module": "@ember-data/adapter/rest" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 1222, + "itemtype": "method", + "name": "normalizeErrorResponse", + "access": "private", + "tagname": "", + "params": [ + { + "name": "status", + "description": "", + "type": "Number" + }, + { + "name": "headers", + "description": "", + "type": "Object" + }, + { + "name": "payload", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "errors payload", + "type": "Array" + }, + "class": "RESTAdapter", + "module": "@ember-data/adapter/rest" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 1252, + "description": "

Generates a detailed ("friendly") error message, with plenty\nof information for debugging (good luck!)

\n", + "itemtype": "method", + "name": "generatedDetailedMessage", + "access": "private", + "tagname": "", + "params": [ + { + "name": "status", + "description": "", + "type": "Number" + }, + { + "name": "headers", + "description": "", + "type": "Object" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "requestData", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "detailed error message", + "type": "String" + }, + "class": "RESTAdapter", + "module": "@ember-data/adapter/rest" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 1286, + "description": "

Used by findAll and findRecord to build the query's data hash\nsupplied to the ajax method.

\n", + "itemtype": "method", + "name": "buildQuery", + "since": "2.5.0", + "access": "public", + "tagname": "", + "params": [ + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "RESTAdapter", + "module": "@ember-data/adapter/rest" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 260, + "description": "

The findRecord() method is invoked when the store is asked for a record that\nhas not previously been loaded. In response to findRecord() being called, you\nshould query your persistence layer for a record with the given ID. The findRecord\nmethod should return a promise that will resolve to a JavaScript object that will be\nnormalized by the serializer.

\n

Here is an example of the findRecord implementation:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Adapter from '@ember-data/adapter';\nimport RSVP from 'RSVP';\nimport $ from 'jquery';\n\nexport default class ApplicationAdapter extends Adapter {\n  findRecord(store, type, id, snapshot) {\n    return new RSVP.Promise(function(resolve, reject) {\n      $.getJSON(`/${type.modelName}/${id}`).then(function(data) {\n        resolve(data);\n      }, function(jqXHR) {\n        reject(jqXHR);\n      });\n    });\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "findRecord", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "", + "type": "Model" + }, + { + "name": "id", + "description": "", + "type": "String" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "access": "public", + "tagname": "", + "class": "RESTAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "Adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 302, + "description": "

The findAll() method is used to retrieve all records for a given type.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Adapter from '@ember-data/adapter';\nimport RSVP from 'RSVP';\nimport $ from 'jquery';\n\nexport default class ApplicationAdapter extends Adapter {\n  findAll(store, type) {\n    return new RSVP.Promise(function(resolve, reject) {\n      $.getJSON(`/${type.modelName}`).then(function(data) {\n        resolve(data);\n      }, function(jqXHR) {\n        reject(jqXHR);\n      });\n    });\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "findAll", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "", + "type": "Model" + }, + { + "name": "neverSet", + "description": "a value is never provided to this argument", + "type": "Undefined" + }, + { + "name": "snapshotRecordArray", + "description": "", + "type": "SnapshotRecordArray" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "access": "public", + "tagname": "", + "class": "RESTAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "Adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 345, + "description": "

This method is called when you call query on the store.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Adapter from '@ember-data/adapter';\nimport RSVP from 'RSVP';\nimport $ from 'jquery';\n\nexport default class ApplicationAdapter extends Adapter {\n  query(store, type, query) {\n    return new RSVP.Promise(function(resolve, reject) {\n      $.getJSON(`/${type.modelName}`, query).then(function(data) {\n        resolve(data);\n      }, function(jqXHR) {\n        reject(jqXHR);\n      });\n    });\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "query", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "", + "type": "Model" + }, + { + "name": "query", + "description": "", + "type": "Object" + }, + { + "name": "recordArray", + "description": "", + "type": "Collection" + }, + { + "name": "adapterOptions", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "access": "public", + "tagname": "", + "class": "RESTAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "Adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 384, + "description": "

The queryRecord() method is invoked when the store is asked for a single\nrecord through a query object.

\n

In response to queryRecord() being called, you should always fetch fresh\ndata. Once found, you can asynchronously call the store's push() method\nto push the record into the store.

\n

Here is an example queryRecord implementation:

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Adapter, { BuildURLMixin } from '@ember-data/adapter';\nimport RSVP from 'RSVP';\nimport $ from 'jquery';\n\nexport default class ApplicationAdapter extends Adapter.extend(BuildURLMixin) {\n  queryRecord(store, type, query) {\n    return new RSVP.Promise(function(resolve, reject) {\n      $.getJSON(`/${type.modelName}`, query).then(function(data) {\n        resolve(data);\n      }, function(jqXHR) {\n        reject(jqXHR);\n      });\n    });\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "queryRecord", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "", + "type": "Subclass of Model" + }, + { + "name": "query", + "description": "", + "type": "Object" + }, + { + "name": "adapterOptions", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "access": "public", + "tagname": "", + "class": "RESTAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "Adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 429, + "description": "

If the globally unique IDs for your records should be generated on the client,\nimplement the generateIdForRecord() method. This method will be invoked\neach time you create a new record, and the value returned from it will be\nassigned to the record's primaryKey.

\n

Most traditional REST-like HTTP APIs will not use this method. Instead, the ID\nof the record will be set by the server, and your adapter will update the store\nwith the new ID when it calls didCreateRecord(). Only implement this method if\nyou intend to generate record IDs on the client-side.

\n

The generateIdForRecord() method will be invoked with the requesting store as\nthe first parameter and the newly created record as the second parameter:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import Adapter from '@ember-data/adapter';\nimport { v4 } from 'uuid';\n\nexport default class ApplicationAdapter extends Adapter {\n  generateIdForRecord(store, type, inputProperties) {\n    return v4();\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "generateIdForRecord", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "the Model class of the record", + "type": "Model" + }, + { + "name": "inputProperties", + "description": "a hash of properties to set on the\n newly created record.", + "type": "Object" + } + ], + "return": { + "description": "id", + "type": "(String|Number)" + }, + "access": "public", + "tagname": "", + "class": "RESTAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "Adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 463, + "description": "

Proxies to the serializer's serialize method.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Adapter from '@ember-data/adapter';\n\nexport default class ApplicationAdapter extends Adapter {\n  createRecord(store, type, snapshot) {\n    let data = this.serialize(snapshot, { includeId: true });\n    let url = `/${type.modelName}`;\n\n    // ...\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "serialize", + "params": [ + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "serialized snapshot", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RESTAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "Adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 491, + "description": "

Implement this method in a subclass to handle the creation of\nnew records.

\n

Serializes the record and sends it to the server.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n
import Adapter from '@ember-data/adapter';\nimport RSVP from 'RSVP';\nimport $ from 'jquery';\n\nexport default class ApplicationAdapter extends Adapter {\n  createRecord(store, type, snapshot) {\n    let data = this.serialize(snapshot, { includeId: true });\n\n    return new RSVP.Promise(function (resolve, reject) {\n      $.ajax({\n        type: 'POST',\n        url: `/${type.modelName}`,\n        dataType: 'json',\n        data: data\n      }).then(function (data) {\n        resolve(data);\n      }, function (jqXHR) {\n        jqXHR.then = null; // tame jQuery's ill mannered promises\n        reject(jqXHR);\n      });\n    });\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "createRecord", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "the Model class of the record", + "type": "Model" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "access": "public", + "tagname": "", + "class": "RESTAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "Adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 539, + "description": "

Implement this method in a subclass to handle the updating of\na record.

\n

Serializes the record update and sends it to the server.

\n

The updateRecord method is expected to return a promise that will\nresolve with the serialized record. This allows the backend to\ninform the Ember Data store the current state of this record after\nthe update. If it is not possible to return a serialized record\nthe updateRecord promise can also resolve with undefined and the\nEmber Data store will assume all of the updates were successfully\napplied on the backend.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n
import Adapter from '@ember-data/adapter';\nimport RSVP from 'RSVP';\nimport $ from 'jquery';\n\nexport default class ApplicationAdapter extends Adapter {\n  updateRecord(store, type, snapshot) {\n    let data = this.serialize(snapshot, { includeId: true });\n    let id = snapshot.id;\n\n    return new RSVP.Promise(function(resolve, reject) {\n      $.ajax({\n        type: 'PUT',\n        url: `/${type.modelName}/${id}`,\n        dataType: 'json',\n        data: data\n      }).then(function(data) {\n        resolve(data);\n      }, function(jqXHR) {\n        jqXHR.then = null; // tame jQuery's ill mannered promises\n        reject(jqXHR);\n      });\n    });\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "updateRecord", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "the Model class of the record", + "type": "Model" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "access": "public", + "tagname": "", + "class": "RESTAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "Adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 596, + "description": "

Implement this method in a subclass to handle the deletion of\na record.

\n

Sends a delete request for the record to the server.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n
import Adapter from '@ember-data/adapter';\nimport RSVP from 'RSVP';\nimport $ from 'jquery';\n\nexport default class ApplicationAdapter extends Adapter {\n  deleteRecord(store, type, snapshot) {\n    let data = this.serialize(snapshot, { includeId: true });\n    let id = snapshot.id;\n\n    return new RSVP.Promise(function(resolve, reject) {\n      $.ajax({\n        type: 'DELETE',\n        url: `/${type.modelName}/${id}`,\n        dataType: 'json',\n        data: data\n      }).then(function(data) {\n        resolve(data)\n      }, function(jqXHR) {\n        jqXHR.then = null; // tame jQuery's ill mannered promises\n        reject(jqXHR);\n      });\n    });\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "deleteRecord", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "the Model class of the record", + "type": "Model" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "access": "public", + "tagname": "", + "class": "RESTAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "Adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 667, + "description": "

The store will call findMany instead of multiple findRecord\nrequests to find multiple records at once if coalesceFindRequests\nis true.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Adapter from '@ember-data/adapter';\nimport RSVP from 'RSVP';\nimport $ from 'jquery';\n\nexport default class ApplicationAdapter extends Adapter {\n  findMany(store, type, ids, snapshots) {\n    return new RSVP.Promise(function(resolve, reject) {\n      $.ajax({\n        type: 'GET',\n        url: `/${type.modelName}/`,\n        dataType: 'json',\n        data: { filter: { id: ids.join(',') } }\n      }).then(function(data) {\n        resolve(data);\n      }, function(jqXHR) {\n        jqXHR.then = null; // tame jQuery's ill mannered promises\n        reject(jqXHR);\n      });\n    });\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "findMany", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "the Model class of the records", + "type": "Model" + }, + { + "name": "ids", + "description": "", + "type": "Array" + }, + { + "name": "snapshots", + "description": "", + "type": "Array" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "access": "public", + "tagname": "", + "class": "RESTAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "Adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 705, + "description": "

Organize records into groups, each of which is to be passed to separate\ncalls to findMany.

\n

For example, if your API has nested URLs that depend on the parent, you will\nwant to group records by their parent.

\n

The default implementation returns the records as a single group.

\n", + "itemtype": "method", + "name": "groupRecordsForFindMany", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "snapshots", + "description": "", + "type": "Array" + } + ], + "return": { + "description": "an array of arrays of records, each of which is to be\n loaded separately by `findMany`.", + "type": "Array" + }, + "class": "RESTAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "Adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 725, + "description": "

This method is used by the store to determine if the store should\nreload a record from the adapter when a record is requested by\nstore.findRecord.

\n

If this method returns true, the store will re-fetch a record from\nthe adapter. If this method returns false, the store will resolve\nimmediately using the cached record.

\n

For example, if you are building an events ticketing system, in which users\ncan only reserve tickets for 20 minutes at a time, and want to ensure that\nin each route you have data that is no more than 20 minutes old you could\nwrite:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
shouldReloadRecord(store, ticketSnapshot) {\n  let lastAccessedAt = ticketSnapshot.attr('lastAccessedAt');\n  let timeDiff = moment().diff(lastAccessedAt, 'minutes');\n\n  if (timeDiff > 20) {\n    return true;\n  } else {\n    return false;\n  }\n}
\n
\n
\n \n

This method would ensure that whenever you do store.findRecord('ticket',\nid) you will always get a ticket that is no more than 20 minutes old. In\ncase the cached version is more than 20 minutes old, findRecord will not\nresolve until you fetched the latest version.

\n

By default this hook returns false, as most UIs should not block user\ninteractions while waiting on data update.

\n

Note that, with default settings, shouldBackgroundReloadRecord will always\nre-fetch the records in the background even if shouldReloadRecord returns\nfalse. You can override shouldBackgroundReloadRecord if this does not\nsuit your use case.

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "shouldReloadRecord", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "RESTAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "Adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 776, + "description": "

This method is used by the store to determine if the store should\nreload all records from the adapter when records are requested by\nstore.findAll.

\n

If this method returns true, the store will re-fetch all records from\nthe adapter. If this method returns false, the store will resolve\nimmediately using the cached records.

\n

For example, if you are building an events ticketing system, in which users\ncan only reserve tickets for 20 minutes at a time, and want to ensure that\nin each route you have data that is no more than 20 minutes old you could\nwrite:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
shouldReloadAll(store, snapshotArray) {\n  let snapshots = snapshotArray.snapshots();\n\n  return snapshots.any((ticketSnapshot) => {\n    let lastAccessedAt = ticketSnapshot.attr('lastAccessedAt');\n    let timeDiff = moment().diff(lastAccessedAt, 'minutes');\n\n    if (timeDiff > 20) {\n      return true;\n    } else {\n      return false;\n    }\n  });\n}
\n
\n
\n \n

This method would ensure that whenever you do store.findAll('ticket') you\nwill always get a list of tickets that are no more than 20 minutes old. In\ncase a cached version is more than 20 minutes old, findAll will not\nresolve until you fetched the latest versions.

\n

By default, this method returns true if the passed snapshotRecordArray\nis empty (meaning that there are no records locally available yet),\notherwise, it returns false.

\n

Note that, with default settings, shouldBackgroundReloadAll will always\nre-fetch all the records in the background even if shouldReloadAll returns\nfalse. You can override shouldBackgroundReloadAll if this does not suit\nyour use case.

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "shouldReloadAll", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "snapshotRecordArray", + "description": "", + "type": "SnapshotRecordArray" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "RESTAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "Adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 832, + "description": "

This method is used by the store to determine if the store should\nreload a record after the store.findRecord method resolves a\ncached record.

\n

This method is only checked by the store when the store is\nreturning a cached record.

\n

If this method returns true the store will re-fetch a record from\nthe adapter.

\n

For example, if you do not want to fetch complex data over a mobile\nconnection, or if the network is down, you can implement\nshouldBackgroundReloadRecord as follows:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
shouldBackgroundReloadRecord(store, snapshot) {\n  let { downlink, effectiveType } = navigator.connection;\n\n  return downlink > 0 && effectiveType === '4g';\n}
\n
\n
\n \n

By default, this hook returns true so the data for the record is updated\nin the background.

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "shouldBackgroundReloadRecord", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "RESTAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "Adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 869, + "description": "

This method is used by the store to determine if the store should\nreload a record array after the store.findAll method resolves\nwith a cached record array.

\n

This method is only checked by the store when the store is\nreturning a cached record array.

\n

If this method returns true the store will re-fetch all records\nfrom the adapter.

\n

For example, if you do not want to fetch complex data over a mobile\nconnection, or if the network is down, you can implement\nshouldBackgroundReloadAll as follows:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
shouldBackgroundReloadAll(store, snapshotArray) {\n  let { downlink, effectiveType } = navigator.connection;\n\n  return downlink > 0 && effectiveType === '4g';\n}
\n
\n
\n \n

By default this method returns true, indicating that a background reload\nshould always be triggered.

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "shouldBackgroundReloadAll", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "snapshotRecordArray", + "description": "", + "type": "SnapshotRecordArray" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "RESTAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "Adapter" + }, + { + "file": "../packages/adapter/src/-private/build-url-mixin.ts", + "line": 145, + "description": "

Builds a URL for a given type and optional ID.

\n

By default, it pluralizes the type's name (for example, 'post'\nbecomes 'posts' and 'person' becomes 'people'). To override the\npluralization see pathForType.

\n

If an ID is specified, it adds the ID to the path generated\nfor the type, separated by a /.

\n

When called by RESTAdapter.findMany() the id and snapshot parameters\nwill be arrays of ids and snapshots.

\n", + "itemtype": "method", + "name": "buildURL", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelName", + "description": "", + "type": "String" + }, + { + "name": "id", + "description": "single id or array of ids or query", + "type": "(String|Array|Object)" + }, + { + "name": "snapshot", + "description": "single snapshot or array of snapshots", + "type": "(Snapshot|SnapshotRecordArray)" + }, + { + "name": "requestType", + "description": "", + "type": "String" + }, + { + "name": "query", + "description": "object of query parameters to send for query requests.", + "type": "Object" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "RESTAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "BuildURLMixin" + }, + { + "file": "../packages/adapter/src/-private/build-url-mixin.ts", + "line": 294, + "itemtype": "method", + "name": "_buildURL", + "access": "private", + "tagname": "", + "params": [ + { + "name": "modelName", + "description": "", + "type": "String" + }, + { + "name": "id", + "description": "", + "type": "String" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "RESTAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "BuildURLMixin" + }, + { + "file": "../packages/adapter/src/-private/build-url-mixin.ts", + "line": 329, + "description": "

Builds a URL for a store.findRecord(type, id) call.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/user.js
1\n2\n3\n4\n5\n6\n7\n8\n
import JSONAPIAdapter from '@ember-data/adapter/json-api';\n\nexport default class ApplicationAdapter extends JSONAPIAdapter {\n  urlForFindRecord(id, modelName, snapshot) {\n    let baseUrl = this.buildURL(modelName, id, snapshot);\n    return `${baseUrl}/users/${snapshot.adapterOptions.user_id}/playlists/${id}`;\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "urlForFindRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "id", + "description": "", + "type": "String" + }, + { + "name": "modelName", + "description": "", + "type": "String" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "RESTAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "BuildURLMixin" + }, + { + "file": "../packages/adapter/src/-private/build-url-mixin.ts", + "line": 357, + "description": "

Builds a URL for a store.findAll(type) call.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/comment.js
1\n2\n3\n4\n5\n6\n7\n8\n
import JSONAPIAdapter from '@ember-data/adapter/json-api';\n\nexport default class ApplicationAdapter extends JSONAPIAdapter {\n  urlForFindAll(modelName, snapshot) {\n    let baseUrl = this.buildURL(modelName);\n    return `${baseUrl}/data/comments.json`;\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "urlForFindAll", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelName", + "description": "", + "type": "String" + }, + { + "name": "snapshot", + "description": "", + "type": "SnapshotRecordArray" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "RESTAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "BuildURLMixin" + }, + { + "file": "../packages/adapter/src/-private/build-url-mixin.ts", + "line": 383, + "description": "

Builds a URL for a store.query(type, query) call.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import RESTAdapter from '@ember-data/adapter/rest';\n\nexport default class ApplicationAdapter extends RESTAdapter {\n  host = 'https://api.github.com';\n  urlForQuery (query, modelName) {\n    switch(modelName) {\n      case 'repo':\n        return `https://api.github.com/orgs/${query.orgId}/repos`;\n      default:\n        return super.urlForQuery(...arguments);\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "urlForQuery", + "access": "public", + "tagname": "", + "params": [ + { + "name": "query", + "description": "", + "type": "Object" + }, + { + "name": "modelName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "RESTAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "BuildURLMixin" + }, + { + "file": "../packages/adapter/src/-private/build-url-mixin.ts", + "line": 414, + "description": "

Builds a URL for a store.queryRecord(type, query) call.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n
import RESTAdapter from '@ember-data/adapter/rest';\n\nexport default class ApplicationAdapter extends RESTAdapter {\n  urlForQueryRecord({ slug }, modelName) {\n    let baseUrl = this.buildURL();\n    return `${baseUrl}/${encodeURIComponent(slug)}`;\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "urlForQueryRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "query", + "description": "", + "type": "Object" + }, + { + "name": "modelName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "RESTAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "BuildURLMixin" + }, + { + "file": "../packages/adapter/src/-private/build-url-mixin.ts", + "line": 440, + "description": "

Builds a URL for coalescing multiple store.findRecord(type, id)\nrecords into 1 request when the adapter's coalesceFindRequests\nproperty is true.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n
import RESTAdapter from '@ember-data/adapter/rest';\n\nexport default class ApplicationAdapter extends RESTAdapter {\n  urlForFindMany(ids, modelName) {\n    let baseUrl = this.buildURL();\n    return `${baseUrl}/coalesce`;\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "urlForFindMany", + "access": "public", + "tagname": "", + "params": [ + { + "name": "ids", + "description": "", + "type": "Array" + }, + { + "name": "modelName", + "description": "", + "type": "String" + }, + { + "name": "snapshots", + "description": "", + "type": "Array" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "RESTAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "BuildURLMixin" + }, + { + "file": "../packages/adapter/src/-private/build-url-mixin.ts", + "line": 469, + "description": "

Builds a URL for fetching an async hasMany relationship when a URL\nis not provided by the server.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n
import JSONAPIAdapter from '@ember-data/adapter/json-api';\n\nexport default class ApplicationAdapter extends JSONAPIAdapter {\n  urlForFindHasMany(id, modelName, snapshot) {\n    let baseUrl = this.buildURL(modelName, id);\n    return `${baseUrl}/relationships`;\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "urlForFindHasMany", + "access": "public", + "tagname": "", + "params": [ + { + "name": "id", + "description": "", + "type": "String" + }, + { + "name": "modelName", + "description": "", + "type": "String" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "RESTAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "BuildURLMixin" + }, + { + "file": "../packages/adapter/src/-private/build-url-mixin.ts", + "line": 497, + "description": "

Builds a URL for fetching an async belongsTo relationship when a url\nis not provided by the server.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n
import JSONAPIAdapter from '@ember-data/adapter/json-api';\n\nexport default class ApplicationAdapter extends JSONAPIAdapter {\n  urlForFindBelongsTo(id, modelName, snapshot) {\n    let baseUrl = this.buildURL(modelName, id);\n    return `${baseUrl}/relationships`;\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "urlForFindBelongsTo", + "access": "public", + "tagname": "", + "params": [ + { + "name": "id", + "description": "", + "type": "String" + }, + { + "name": "modelName", + "description": "", + "type": "String" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "RESTAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "BuildURLMixin" + }, + { + "file": "../packages/adapter/src/-private/build-url-mixin.ts", + "line": 525, + "description": "

Builds a URL for a record.save() call when the record was created\nlocally using store.createRecord().

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n
import RESTAdapter from '@ember-data/adapter/rest';\n\nexport default class ApplicationAdapter extends RESTAdapter {\n  urlForCreateRecord(modelName, snapshot) {\n    return super.urlForCreateRecord(...arguments) + '/new';\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "urlForCreateRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelName", + "description": "", + "type": "String" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "RESTAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "BuildURLMixin" + }, + { + "file": "../packages/adapter/src/-private/build-url-mixin.ts", + "line": 551, + "description": "

Builds a URL for a record.save() call when the record has been updated locally.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n
import RESTAdapter from '@ember-data/adapter/rest';\n\nexport default class ApplicationAdapter extends RESTAdapter {\n  urlForUpdateRecord(id, modelName, snapshot) {\n    return `/${id}/feed?access_token=${snapshot.adapterOptions.token}`;\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "urlForUpdateRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "id", + "description": "", + "type": "String" + }, + { + "name": "modelName", + "description": "", + "type": "String" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "RESTAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "BuildURLMixin" + }, + { + "file": "../packages/adapter/src/-private/build-url-mixin.ts", + "line": 577, + "description": "

Builds a URL for a record.save() call when the record has been deleted locally.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n
import RESTAdapter from '@ember-data/adapter/rest';\n\nexport default class ApplicationAdapter extends RESTAdapter {\n  urlForDeleteRecord(id, modelName, snapshot) {\n    return super.urlForDeleteRecord(...arguments) + '/destroy';\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "urlForDeleteRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "id", + "description": "", + "type": "String" + }, + { + "name": "modelName", + "description": "", + "type": "String" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "RESTAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "BuildURLMixin" + }, + { + "file": "../packages/adapter/src/-private/build-url-mixin.ts", + "line": 603, + "itemtype": "method", + "name": "urlPrefix", + "access": "private", + "tagname": "", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + }, + { + "name": "parentURL", + "description": "", + "type": "String" + } + ], + "return": { + "description": "urlPrefix", + "type": "String" + }, + "class": "RESTAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "BuildURLMixin" + }, + { + "file": "../packages/adapter/src/-private/build-url-mixin.ts", + "line": 643, + "description": "

Determines the pathname for a given type.

\n

By default, it pluralizes the type's name (for example,\n'post' becomes 'posts' and 'person' becomes 'people').

\n

Pathname customization

\n

For example, if you have an object LineItem with an\nendpoint of /line_items/.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import RESTAdapter from '@ember-data/adapter/rest';\nimport { decamelize, pluralize } from '<app-name>/utils/string-utils';\n\nexport default class ApplicationAdapter extends RESTAdapter {\n  pathForType(modelName) {\n    var decamelized = decamelize(modelName);\n    return pluralize(decamelized);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "pathForType", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "path", + "type": "String" + }, + "class": "RESTAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "BuildURLMixin" + } + ], + "events": [], + "properties": [ + { + "file": "../packages/adapter/src/rest.ts", + "line": 343, + "description": "

This property allows ajax to still be used instead when false.

\n", + "itemtype": "property", + "name": "useFetch", + "type": "{Boolean}", + "default": "true", + "access": "public", + "tagname": "", + "class": "RESTAdapter", + "module": "@ember-data/adapter/rest" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 428, + "description": "

By default the RESTAdapter will send each find request coming from a store.find\nor from accessing a relationship separately to the server. If your server supports passing\nids as a query string, you can set coalesceFindRequests to true to coalesce all find requests\nwithin a single runloop.

\n

For example, if you have an initial payload of:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
{\n  post: {\n    id: 1,\n    comments: [1, 2]\n  }\n}
\n
\n
\n \n

By default calling post.comments will trigger the following requests(assuming the\ncomments haven't been loaded before):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
GET /comments/1\nGET /comments/2
\n
\n
\n

If you set coalesceFindRequests to true it will instead trigger the following request:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
GET /comments?ids[]=1&ids[]=2
\n
\n
\n

Setting coalesceFindRequests to true also works for store.find requests and belongsTo\nrelationships accessed within the same runloop. If you set coalesceFindRequests: true

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
store.findRecord('comment', 1);\nstore.findRecord('comment', 2);
\n
\n
\n \n

will also send a request to: GET /comments?ids[]=1&ids[]=2

\n

Note: Requests coalescing rely on URL building strategy. So if you override buildURL in your app\ngroupRecordsForFindMany more likely should be overridden as well in order for coalescing to work.

\n", + "itemtype": "property", + "name": "coalesceFindRequests", + "access": "public", + "tagname": "", + "type": "{boolean}", + "class": "RESTAdapter", + "module": "@ember-data/adapter/rest" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 488, + "description": "

Endpoint paths can be prefixed with a namespace by setting the namespace\nproperty on the adapter:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n
import RESTAdapter from '@ember-data/adapter/rest';\n\nexport default class ApplicationAdapter extends RESTAdapter {\n  namespace = 'api/1';\n}
\n
\n
\n \n

Requests for the Post model would now target /api/1/post/.

\n", + "itemtype": "property", + "name": "namespace", + "access": "public", + "tagname": "", + "type": "{String}", + "class": "RESTAdapter", + "module": "@ember-data/adapter/rest" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 507, + "description": "

An adapter can target other hosts by setting the host property.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n
import RESTAdapter from '@ember-data/adapter/rest';\n\nexport default class ApplicationAdapter extends RESTAdapter {\n  host = 'https://api.example.com';\n}
\n
\n
\n \n

Requests for the Post model would now target https://api.example.com/post/.

\n", + "itemtype": "property", + "name": "host", + "access": "public", + "tagname": "", + "type": "{String}", + "class": "RESTAdapter", + "module": "@ember-data/adapter/rest" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 525, + "description": "

Some APIs require HTTP headers, e.g. to provide an API\nkey. Arbitrary headers can be set as key/value pairs on the\nRESTAdapter's headers object and Ember Data will send them\nalong with each ajax request. For dynamic headers see headers\ncustomization.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import RESTAdapter from '@ember-data/adapter/rest';\nimport { computed } from '@ember/object';\n\nexport default class ApplicationAdapter extends RESTAdapter {\n  headers: computed(function() {\n    return {\n      'API_KEY': 'secret key',\n      'ANOTHER_HEADER': 'Some header value'\n    };\n  })\n}
\n
\n
\n \n", + "itemtype": "property", + "name": "headers", + "access": "public", + "tagname": "", + "type": "{Object}", + "class": "RESTAdapter", + "module": "@ember-data/adapter/rest" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 645, + "description": "

By default the store will try to coalesce all findRecord calls within the same runloop\ninto as few requests as possible by calling groupRecordsForFindMany and passing it into a findMany call.\nYou can opt out of this behaviour by either not implementing the findMany hook or by setting\ncoalesceFindRequests to false.

\n", + "itemtype": "property", + "name": "coalesceFindRequests", + "access": "public", + "tagname": "", + "type": "{boolean}", + "class": "RESTAdapter", + "module": "@ember-data/adapter", + "inherited": true, + "inheritedFrom": "Adapter" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-data-5.3.0-Adapter", + "type": "class" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-data-5.3.0-JSONAPIAdapter" + } + ] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/adapter/rest", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-RESTSerializer.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-RESTSerializer.json new file mode 100644 index 000000000..c85301562 --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-RESTSerializer.json @@ -0,0 +1,1951 @@ +{ + "data": { + "id": "ember-data-5.3.0-RESTSerializer", + "type": "class", + "attributes": { + "name": "RESTSerializer", + "shortname": "RESTSerializer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/serializer/rest", + "namespace": "", + "file": "../serializer/src/rest.js", + "line": 18, + "description": "
\n

\n ⚠️ This is LEGACY documentation for a feature that is no longer encouraged to be used.\n If starting a new app or thinking of implementing a new adapter, consider writing a\n Handler instead to be used with the RequestManager\n

\n
\n\n

Normally, applications will use the RESTSerializer by implementing\n the normalize method.

\n

This allows you to do whatever kind of munging you need and is\n especially useful if your server is inconsistent and you need to\n do munging differently for many different kinds of responses.

\n

See the normalize documentation for more information.

\n

Across the Board Normalization

\n

There are also a number of hooks that you might find useful to define\n across-the-board rules for your payload. These rules will be useful\n if your server is consistent, or if you're building an adapter for\n an infrastructure service, like Firebase, and want to encode service\n conventions.

\n

For example, if all of your keys are underscored and all-caps, but\n otherwise consistent with the names you use in your models, you\n can implement across-the-board rules for how to convert an attribute\n name in your model to a key in your JSON.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/application.js
1\n2\n3\n4\n5\n6\n7\n8\n
 import RESTSerializer from '@ember-data/serializer/rest';\n import { underscore } from '<app-name>/utils/string-utils';\n\n export default class ApplicationSerializer extends RESTSerializer {\n   keyForAttribute(attr, method) {\n     return underscore(attr).toUpperCase();\n   }\n }
\n
\n
\n \n

You can also implement keyForRelationship, which takes the name\n of the relationship as the first parameter, the kind of\n relationship (hasMany or belongsTo) as the second parameter, and\n the method (serialize or deserialize) as the third parameter.\n @mainName @ember-data/serializer/rest\n @tag main

\n", + "_main": true, + "access": "public", + "tagname": "", + "extends": "JSONSerializer", + "methods": [ + { + "file": "../packages/serializer/src/rest.js", + "line": 71, + "description": "

keyForPolymorphicType can be used to define a custom key when\nserializing and deserializing a polymorphic type. By default, the\nreturned key is ${key}Type.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
 import RESTSerializer from '@ember-data/serializer/rest';\n\n export default class ApplicationSerializer extends RESTSerializer {\n   keyForPolymorphicType(key, relationship) {\n     let relationshipKey = this.keyForRelationship(key);\n\n     return 'type-' + relationshipKey;\n   }\n }
\n
\n
\n \n", + "itemtype": "method", + "name": "keyForPolymorphicType", + "access": "public", + "tagname": "", + "params": [ + { + "name": "key", + "description": "", + "type": "String" + }, + { + "name": "typeClass", + "description": "", + "type": "String" + }, + { + "name": "method", + "description": "", + "type": "String" + } + ], + "return": { + "description": "normalized key", + "type": "String" + }, + "class": "RESTSerializer", + "module": "@ember-data/serializer/rest" + }, + { + "file": "../packages/serializer/src/rest.js", + "line": 103, + "description": "

Normalizes a part of the JSON payload returned by\nthe server. You should override this method, munge the hash\nand call super if you have generic normalization to do.

\n

It takes the type of the record that is being normalized\n(as a Model class), the property where the hash was\noriginally found, and the hash to normalize.

\n

For example, if you have a payload that looks like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
{\n  "post": {\n    "id": 1,\n    "title": "Rails is omakase",\n    "comments": [ 1, 2 ]\n  },\n  "comments": [{\n    "id": 1,\n    "body": "FIRST"\n  }, {\n    "id": 2,\n    "body": "Rails is unagi"\n  }]\n}
\n
\n
\n \n

The normalize method will be called three times:

\n
    \n
  • With App.Post, "posts" and { id: 1, title: "Rails is omakase", ... }
  • \n
  • With App.Comment, "comments" and { id: 1, body: "FIRST" }
  • \n
  • With App.Comment, "comments" and { id: 2, body: "Rails is unagi" }
  • \n
\n

You can use this method, for example, to normalize underscored keys to camelized\nor other general-purpose normalizations. You will only need to implement\nnormalize and manipulate the payload as desired.

\n

For example, if the IDs under "comments" are provided as _id instead of\nid, you can specify how to normalize just the comments:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import RESTSerializer from '@ember-data/serializer/rest';\n\nexport default class ApplicationSerializer extends RESTSerializer {\n  normalize(model, hash, prop) {\n    if (prop === 'comments') {\n      hash.id = hash._id;\n      delete hash._id;\n    }\n\n    return super.normalize(...arguments);\n  }\n}
\n
\n
\n \n

On each call to the normalize method, the third parameter (prop) is always\none of the keys that were in the original payload or in the result of another\nnormalization as normalizeResponse.

\n", + "itemtype": "method", + "name": "normalize", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelClass", + "description": "", + "type": "Model" + }, + { + "name": "resourceHash", + "description": "", + "type": "Object" + }, + { + "name": "prop", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "RESTSerializer", + "module": "@ember-data/serializer/rest" + }, + { + "file": "../packages/serializer/src/rest.js", + "line": 171, + "description": "

Normalizes an array of resource payloads and returns a JSON-API Document\nwith primary data and, if any, included data as { data, included }.

\n", + "itemtype": "method", + "name": "_normalizeArray", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "modelName", + "description": "", + "type": "String" + }, + { + "name": "arrayHash", + "description": "", + "type": "Object" + }, + { + "name": "prop", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "private", + "tagname": "", + "class": "RESTSerializer", + "module": "@ember-data/serializer/rest" + }, + { + "file": "../packages/serializer/src/rest.js", + "line": 222, + "itemtype": "method", + "name": "_normalizeResponse", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + }, + { + "name": "isSingle", + "description": "", + "type": "Boolean" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "access": "private", + "tagname": "", + "class": "RESTSerializer", + "module": "@ember-data/serializer/rest" + }, + { + "file": "../packages/serializer/src/rest.js", + "line": 364, + "description": "

This method allows you to push a payload containing top-level\ncollections of records organized per type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
{\n  "posts": [{\n    "id": "1",\n    "title": "Rails is omakase",\n    "author", "1",\n    "comments": [ "1" ]\n  }],\n  "comments": [{\n    "id": "1",\n    "body": "FIRST"\n  }],\n  "users": [{\n    "id": "1",\n    "name": "@d2h"\n  }]\n}
\n
\n
\n \n

It will first normalize the payload, so you can use this to push\nin data streaming in from your server structured the same way\nthat fetches and saves are structured.

\n", + "itemtype": "method", + "name": "pushPayload", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "payload", + "description": "", + "type": "Object" + } + ], + "class": "RESTSerializer", + "module": "@ember-data/serializer/rest" + }, + { + "file": "../packages/serializer/src/rest.js", + "line": 425, + "description": "

This method is used to convert each JSON root key in the payload\ninto a modelName that it can use to look up the appropriate model for\nthat part of the payload.

\n

For example, your server may send a model name that does not correspond with\nthe name of the model in your app. Let's take a look at an example model,\nand an example payload:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/models/post.js
1\n2\n3\n
import Model from '@ember-data/model';\n\nexport default class Post extends Model {}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
  {\n    "blog/post": {\n      "id": "1\n    }\n  }
\n
\n
\n \n

Ember Data is going to normalize the payload's root key for the modelName. As a result,\nit will try to look up the "blog/post" model. Since we don't have a model called "blog/post"\n(or a file called app/models/blog/post.js in ember-cli), Ember Data will throw an error\nbecause it cannot find the "blog/post" model.

\n

Since we want to remove this namespace, we can define a serializer for the application that will\nremove "blog/" from the payload key whenver it's encountered by Ember Data:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import RESTSerializer from '@ember-data/serializer/rest';\n\nexport default class ApplicationSerializer extends RESTSerializer {\n  modelNameFromPayloadKey(payloadKey) {\n    if (payloadKey === 'blog/post') {\n      return super.modelNameFromPayloadKey(payloadKey.replace('blog/', ''));\n    } else {\n     return super.modelNameFromPayloadKey(payloadKey);\n    }\n  }\n}
\n
\n
\n \n

After refreshing, Ember Data will appropriately look up the "post" model.

\n

By default the modelName for a model is its\nname in dasherized form. This means that a payload key like "blogPost" would be\nnormalized to "blog-post" when Ember Data looks up the model. Usually, Ember Data\ncan use the correct inflection to do this for you. Most of the time, you won't\nneed to override modelNameFromPayloadKey for this purpose.

\n", + "itemtype": "method", + "name": "modelNameFromPayloadKey", + "access": "public", + "tagname": "", + "params": [ + { + "name": "key", + "description": "", + "type": "String" + } + ], + "return": { + "description": "the model's modelName", + "type": "String" + }, + "class": "RESTSerializer", + "module": "@ember-data/serializer/rest" + }, + { + "file": "../packages/serializer/src/rest.js", + "line": 489, + "itemtype": "method", + "description": "

Called when a record is saved in order to convert the\nrecord into JSON.

\n

By default, it creates a JSON object with a key for\neach attribute and belongsTo relationship.

\n

For example, consider this model:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/models/comment.js
1\n2\n3\n4\n5\n6\n
import Model, { attr, belongsTo } from '@ember-data/model';\n\nexport default class Comment extends Model {\n  @attr body\n  @belongsto('user') author\n}
\n
\n
\n \n

The default serialization would create a JSON object like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
{\n  "title": "Rails is unagi",\n  "body": "Rails? Omakase? O_O",\n  "author": 12\n}
\n
\n
\n \n

By default, attributes are passed through as-is, unless\nyou specified an attribute type (attr('date')). If\nyou specify a transform, the JavaScript value will be\nserialized when inserted into the JSON hash.

\n

By default, belongs-to relationships are converted into\nIDs when inserted into the JSON hash.

\n

IDs

\n

serialize takes an options hash with a single option:\nincludeId. If this option is true, serialize will,\nby default include the ID in the JSON object it builds.

\n

The adapter passes in includeId: true when serializing\na record for createRecord, but not for updateRecord.

\n

Customization

\n

Your server may expect a different JSON format than the\nbuilt-in serialization format.

\n

In that case, you can implement serialize yourself and\nreturn a JSON hash of your choosing.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import RESTSerializer from '@ember-data/serializer/rest';\n\nexport default class ApplicationSerializer extends RESTSerializer {\n  serialize(snapshot, options) {\n    let json = {\n      POST_TTL: snapshot.attr('title'),\n      POST_BDY: snapshot.attr('body'),\n      POST_CMS: snapshot.hasMany('comments', { ids: true })\n    };\n\n    if (options.includeId) {\n      json.POST_ID_ = snapshot.id;\n    }\n\n    return json;\n  }\n}
\n
\n
\n \n

Customizing an App-Wide Serializer

\n

If you want to define a serializer for your entire\napplication, you'll probably want to use eachAttribute\nand eachRelationship on the record.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n
import RESTSerializer from '@ember-data/serializer/rest';\nimport { pluralize } from '<app-name>/utils/string-utils';\n\nexport default class ApplicationSerializer extends RESTSerializer {\n  serialize(snapshot, options) {\n    let json = {};\n\n    snapshot.eachAttribute(function(name) {\n      json[serverAttributeName(name)] = snapshot.attr(name);\n    });\n\n    snapshot.eachRelationship(function(name, relationship) {\n      if (relationship.kind === 'hasMany') {\n        json[serverHasManyName(name)] = snapshot.hasMany(name, { ids: true });\n      }\n    });\n\n    if (options.includeId) {\n      json.ID_ = snapshot.id;\n    }\n\n    return json;\n  }\n}\n\nfunction serverAttributeName(attribute) {\n  return attribute.underscore().toUpperCase();\n}\n\nfunction serverHasManyName(name) {\n  return serverAttributeName(singularize(name)) + "_IDS";\n}
\n
\n
\n \n

This serializer will generate JSON that looks like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
{\n  "TITLE": "Rails is omakase",\n  "BODY": "Yep. Omakase.",\n  "COMMENT_IDS": [ 1, 2, 3 ]\n}
\n
\n
\n \n

Tweaking the Default JSON

\n

If you just want to do some small tweaks on the default JSON,\nyou can call super first and make the tweaks on the returned\nJSON.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import RESTSerializer from '@ember-data/serializer/rest';\n\nexport default class ApplicationSerializer extends RESTSerializer {\n  serialize(snapshot, options) {\n    let json = super.serialize(snapshot, options);\n\n    json.subject = json.title;\n    delete json.title;\n\n    return json;\n  }\n}
\n
\n
\n \n", + "name": "serialize", + "access": "public", + "tagname": "", + "params": [ + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "json", + "type": "Object" + }, + "class": "RESTSerializer", + "module": "@ember-data/serializer/rest" + }, + { + "file": "../packages/serializer/src/rest.js", + "line": 646, + "description": "

You can use this method to customize the root keys serialized into the JSON.\nThe hash property should be modified by reference (possibly using something like _.extend)\nBy default the REST Serializer sends the modelName of a model, which is a camelized\nversion of the name.

\n

For example, your server may expect underscored root objects.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import RESTSerializer from '@ember-data/serializer/rest';\nimport { decamelize } from '<app-name>/utils/string-utils';\n\nexport default class ApplicationSerializer extends RESTSerializer {\n  serializeIntoHash(data, type, record, options) {\n    let root = decamelize(type.modelName);\n    data[root] = this.serialize(record, options);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "serializeIntoHash", + "access": "public", + "tagname": "", + "params": [ + { + "name": "hash", + "description": "", + "type": "Object" + }, + { + "name": "typeClass", + "description": "", + "type": "Model" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "RESTSerializer", + "module": "@ember-data/serializer/rest" + }, + { + "file": "../packages/serializer/src/rest.js", + "line": 678, + "description": "

You can use payloadKeyFromModelName to override the root key for an outgoing\nrequest. By default, the RESTSerializer returns a camelized version of the\nmodel's name.

\n

For a model called TacoParty, its modelName would be the string taco-party. The RESTSerializer\nwill send it to the server with tacoParty as the root key in the JSON payload:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
{\n  "tacoParty": {\n    "id": "1",\n    "location": "Matthew Beale's House"\n  }\n}
\n
\n
\n \n

For example, your server may expect dasherized root objects:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/application.js
1\n2\n3\n4\n5\n6\n7\n8\n
import RESTSerializer from '@ember-data/serializer/rest';\nimport { dasherize } from '<app-name>/utils/string-utils';\n\nexport default class ApplicationSerializer extends RESTSerializer {\n  payloadKeyFromModelName(modelName) {\n    return dasherize(modelName);\n  }\n}
\n
\n
\n \n

Given a TacoParty model, calling save on it would produce an outgoing\nrequest like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
{\n  "taco-party": {\n    "id": "1",\n    "location": "Matthew Beale's House"\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "payloadKeyFromModelName", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "String" + }, + "class": "RESTSerializer", + "module": "@ember-data/serializer/rest" + }, + { + "file": "../packages/serializer/src/rest.js", + "line": 729, + "description": "

You can use this method to customize how polymorphic objects are serialized.\nBy default the REST Serializer creates the key by appending Type to\nthe attribute and value from the model's camelcased model name.

\n", + "itemtype": "method", + "name": "serializePolymorphicType", + "access": "public", + "tagname": "", + "params": [ + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "json", + "description": "", + "type": "Object" + }, + { + "name": "relationship", + "description": "", + "type": "Object" + } + ], + "class": "RESTSerializer", + "module": "@ember-data/serializer/rest" + }, + { + "file": "../packages/serializer/src/rest.js", + "line": 752, + "description": "

You can use this method to customize how a polymorphic relationship should\nbe extracted.

\n", + "itemtype": "method", + "name": "extractPolymorphicRelationship", + "access": "public", + "tagname": "", + "params": [ + { + "name": "relationshipType", + "description": "", + "type": "Object" + }, + { + "name": "relationshipHash", + "description": "", + "type": "Object" + }, + { + "name": "relationshipOptions", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "RESTSerializer", + "module": "@ember-data/serializer/rest" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 189, + "description": "

Given a subclass of Model and a JSON object this method will\niterate through each attribute of the Model and invoke the\nTransform#deserialize method on the matching property of the\nJSON object. This method is typically called after the\nserializer's normalize method.

\n", + "itemtype": "method", + "name": "applyTransforms", + "access": "private", + "tagname": "", + "params": [ + { + "name": "typeClass", + "description": "", + "type": "Model" + }, + { + "name": "data", + "description": "The data to transform", + "type": "Object" + } + ], + "return": { + "description": "data The transformed data object", + "type": "Object" + }, + "class": "RESTSerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 218, + "description": "

The normalizeResponse method is used to normalize a payload from the\nserver to a JSON-API Document.

\n

http://jsonapi.org/format/#document-structure

\n

This method delegates to a more specific normalize method based on\nthe requestType.

\n

To override this method with a custom one, make sure to call\nreturn super.normalizeResponse(store, primaryModelClass, payload, id, requestType) with your\npre-processed data.

\n

Here's an example of using normalizeResponse manually:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
socket.on('message', function(message) {\n  let data = message.data;\n  let modelClass = store.modelFor(data.modelName);\n  let serializer = store.serializerFor(data.modelName);\n  let normalized = serializer.normalizeSingleResponse(store, modelClass, data, data.id);\n\n  store.push(normalized);\n});
\n
\n
\n \n", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "RESTSerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 279, + "description": "

Called by the default normalizeResponse implementation when the\ntype of request is findRecord

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeFindRecordResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "RESTSerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 297, + "description": "

Called by the default normalizeResponse implementation when the\ntype of request is queryRecord

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeQueryRecordResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "RESTSerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 315, + "description": "

Called by the default normalizeResponse implementation when the\ntype of request is findAll

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeFindAllResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "RESTSerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 333, + "description": "

Called by the default normalizeResponse implementation when the\ntype of request is findBelongsTo

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeFindBelongsToResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "RESTSerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 351, + "description": "

Called by the default normalizeResponse implementation when the\ntype of request is findHasMany

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeFindHasManyResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "RESTSerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 369, + "description": "

Called by the default normalizeResponse implementation when the\ntype of request is findMany

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeFindManyResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "RESTSerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 387, + "description": "

Called by the default normalizeResponse implementation when the\ntype of request is query

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeQueryResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "RESTSerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 405, + "description": "

Called by the default normalizeResponse implementation when the\ntype of request is createRecord

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeCreateRecordResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "RESTSerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 423, + "description": "

Called by the default normalizeResponse implementation when the\ntype of request is deleteRecord

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeDeleteRecordResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "RESTSerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 441, + "description": "

Called by the default normalizeResponse implementation when the\ntype of request is updateRecord

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeUpdateRecordResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "RESTSerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 459, + "description": "

normalizeUpdateRecordResponse, normalizeCreateRecordResponse and\nnormalizeDeleteRecordResponse delegate to this method by default.

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeSaveResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "RESTSerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 477, + "description": "

normalizeQueryResponse and normalizeFindRecordResponse delegate to this\nmethod by default.

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeSingleResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "RESTSerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 495, + "description": "

normalizeQueryResponse, normalizeFindManyResponse, and normalizeFindHasManyResponse delegate\nto this method by default.

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeArrayResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "RESTSerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 513, + "itemtype": "method", + "name": "_normalizeResponse", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + }, + { + "name": "isSingle", + "description": "", + "type": "Boolean" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "access": "private", + "tagname": "", + "class": "RESTSerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 562, + "description": "

Normalizes a part of the JSON payload returned by\nthe server. You should override this method, munge the hash\nand call super if you have generic normalization to do.

\n

It takes the type of the record that is being normalized\n(as a Model class), the property where the hash was\noriginally found, and the hash to normalize.

\n

You can use this method, for example, to normalize underscored keys to camelized\nor other general-purpose normalizations.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import JSONSerializer from '@ember-data/serializer/json';\nimport { underscore } from '<app-name>/utils/string-utils';\nimport { get } from '@ember/object';\n\nexport default class ApplicationSerializer extends JSONSerializer {\n  normalize(typeClass, hash) {\n    let fields = typeClass.fields;\n\n    fields.forEach(function(type, field) {\n      let payloadField = underscore(field);\n      if (field === payloadField) { return; }\n\n      hash[field] = hash[payloadField];\n      delete hash[payloadField];\n    });\n\n    return super.normalize(...arguments);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "normalize", + "access": "public", + "tagname": "", + "params": [ + { + "name": "typeClass", + "description": "", + "type": "Model" + }, + { + "name": "hash", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "RESTSerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 626, + "description": "

Returns the resource's ID.

\n", + "itemtype": "method", + "name": "extractId", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelClass", + "description": "", + "type": "Object" + }, + { + "name": "resourceHash", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "String" + }, + "class": "RESTSerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 641, + "description": "

Returns the resource's attributes formatted as a JSON-API "attributes object".

\n

http://jsonapi.org/format/#document-resource-object-attributes

\n", + "itemtype": "method", + "name": "extractAttributes", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelClass", + "description": "", + "type": "Object" + }, + { + "name": "resourceHash", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "RESTSerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 666, + "description": "

Returns a relationship formatted as a JSON-API "relationship object".

\n

http://jsonapi.org/format/#document-resource-object-relationships

\n", + "itemtype": "method", + "name": "extractRelationship", + "access": "public", + "tagname": "", + "params": [ + { + "name": "relationshipModelName", + "description": "", + "type": "Object" + }, + { + "name": "relationshipHash", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "RESTSerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 701, + "description": "

Returns a polymorphic relationship formatted as a JSON-API "relationship object".

\n

http://jsonapi.org/format/#document-resource-object-relationships

\n

relationshipOptions is a hash which contains more information about the\npolymorphic relationship which should be extracted:

\n
    \n
  • resourceHash complete hash of the resource the relationship should be\nextracted from
  • \n
  • relationshipKey key under which the value for the relationship is\nextracted from the resourceHash
  • \n
  • relationshipMeta meta information about the relationship
  • \n
\n", + "itemtype": "method", + "name": "extractPolymorphicRelationship", + "access": "public", + "tagname": "", + "params": [ + { + "name": "relationshipModelName", + "description": "", + "type": "Object" + }, + { + "name": "relationshipHash", + "description": "", + "type": "Object" + }, + { + "name": "relationshipOptions", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "RESTSerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 725, + "description": "

Returns the resource's relationships formatted as a JSON-API "relationships object".

\n

http://jsonapi.org/format/#document-resource-object-relationships

\n", + "itemtype": "method", + "name": "extractRelationships", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelClass", + "description": "", + "type": "Object" + }, + { + "name": "resourceHash", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "RESTSerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 797, + "description": "

Dasherizes the model name in the payload

\n", + "itemtype": "method", + "name": "modelNameFromPayloadKey", + "access": "public", + "tagname": "", + "params": [ + { + "name": "key", + "description": "", + "type": "String" + } + ], + "return": { + "description": "the model's modelName", + "type": "String" + }, + "class": "RESTSerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 809, + "itemtype": "method", + "name": "normalizeRelationships", + "access": "private", + "tagname": "", + "class": "RESTSerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 832, + "itemtype": "method", + "name": "normalizeUsingDeclaredMapping", + "access": "private", + "tagname": "", + "class": "RESTSerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 865, + "description": "

Looks up the property key that was set by the custom attr mapping\npassed to the serializer.

\n", + "itemtype": "method", + "name": "_getMappedKey", + "access": "private", + "tagname": "", + "params": [ + { + "name": "key", + "description": "", + "type": "String" + } + ], + "return": { + "description": "key", + "type": "String" + }, + "class": "RESTSerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 904, + "description": "

Check attrs.key.serialize property to inform if the key\ncan be serialized

\n", + "itemtype": "method", + "name": "_canSerialize", + "access": "private", + "tagname": "", + "params": [ + { + "name": "key", + "description": "", + "type": "String" + } + ], + "return": { + "description": "true if the key can be serialized", + "type": "Boolean" + }, + "class": "RESTSerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 919, + "description": "

When attrs.key.serialize is set to true then\nit takes priority over the other checks and the related\nattribute/relationship will be serialized

\n", + "itemtype": "method", + "name": "_mustSerialize", + "access": "private", + "tagname": "", + "params": [ + { + "name": "key", + "description": "", + "type": "String" + } + ], + "return": { + "description": "true if the key must be serialized", + "type": "Boolean" + }, + "class": "RESTSerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 935, + "description": "

Check if the given hasMany relationship should be serialized

\n

By default only many-to-many and many-to-none relationships are serialized.\nThis could be configured per relationship by Serializer's attrs object.

\n", + "itemtype": "method", + "name": "shouldSerializeHasMany", + "access": "public", + "tagname": "", + "params": [ + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "key", + "description": "", + "type": "String" + }, + { + "name": "relationship", + "description": "", + "type": "RelationshipSchema" + } + ], + "return": { + "description": "true if the hasMany relationship should be serialized", + "type": "Boolean" + }, + "class": "RESTSerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 958, + "itemtype": "method", + "description": "

Called when a record is saved in order to convert the\nrecord into JSON.

\n

By default, it creates a JSON object with a key for\neach attribute and belongsTo relationship.

\n

For example, consider this model:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/models/comment.js
1\n2\n3\n4\n5\n6\n
import Model, { attr, belongsTo } from '@ember-data/model';\n\nexport default class CommentModel extends Model {\n  @attr body;\n  @belongsto('user') author;\n}
\n
\n
\n \n

The default serialization would create a JSON object like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
{\n  "title": "Rails is unagi",\n  "body": "Rails? Omakase? O_O",\n  "author": 12\n}
\n
\n
\n \n

By default, attributes are passed through as-is, unless\nyou specified an attribute type (attr('date')). If\nyou specify a transform, the JavaScript value will be\nserialized when inserted into the JSON hash.

\n

By default, belongs-to relationships are converted into\nIDs when inserted into the JSON hash.

\n

IDs

\n

serialize takes an options hash with a single option:\nincludeId. If this option is true, serialize will,\nby default include the ID in the JSON object it builds.

\n

The adapter passes in includeId: true when serializing\na record for createRecord, but not for updateRecord.

\n

Customization

\n

Your server may expect a different JSON format than the\nbuilt-in serialization format.

\n

In that case, you can implement serialize yourself and\nreturn a JSON hash of your choosing.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import JSONSerializer from '@ember-data/serializer/json';\n\nexport default class PostSerializer extends JSONSerializer {\n  serialize(snapshot, options) {\n    let json = {\n      POST_TTL: snapshot.attr('title'),\n      POST_BDY: snapshot.attr('body'),\n      POST_CMS: snapshot.hasMany('comments', { ids: true })\n    };\n\n    if (options.includeId) {\n      json.POST_ID_ = snapshot.id;\n    }\n\n    return json;\n  }\n}
\n
\n
\n \n

Customizing an App-Wide Serializer

\n

If you want to define a serializer for your entire\napplication, you'll probably want to use eachAttribute\nand eachRelationship on the record.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n
import JSONSerializer from '@ember-data/serializer/json';\nimport { singularize } from '<app-name>/utils/string-utils';\n\nexport default class ApplicationSerializer extends JSONSerializer {\n  serialize(snapshot, options) {\n    let json = {};\n\n    snapshot.eachAttribute((name) => {\n      json[serverAttributeName(name)] = snapshot.attr(name);\n    });\n\n    snapshot.eachRelationship((name, relationship) => {\n      if (relationship.kind === 'hasMany') {\n        json[serverHasManyName(name)] = snapshot.hasMany(name, { ids: true });\n      }\n    });\n\n    if (options.includeId) {\n      json.ID_ = snapshot.id;\n    }\n\n    return json;\n  }\n}\n\nfunction serverAttributeName(attribute) {\n  return attribute.underscore().toUpperCase();\n}\n\nfunction serverHasManyName(name) {\n  return serverAttributeName(singularize(name)) + "_IDS";\n}
\n
\n
\n \n

This serializer will generate JSON that looks like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
{\n  "TITLE": "Rails is omakase",\n  "BODY": "Yep. Omakase.",\n  "COMMENT_IDS": [ "1", "2", "3" ]\n}
\n
\n
\n \n

Tweaking the Default JSON

\n

If you just want to do some small tweaks on the default JSON,\nyou can call super.serialize first and make the tweaks on\nthe returned JSON.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import JSONSerializer from '@ember-data/serializer/json';\n\nexport default class PostSerializer extends JSONSerializer {\n  serialize(snapshot, options) {\n    let json = super.serialize(...arguments);\n\n    json.subject = json.title;\n    delete json.title;\n\n    return json;\n  }\n}
\n
\n
\n \n", + "name": "serialize", + "access": "public", + "tagname": "", + "params": [ + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "json", + "type": "Object" + }, + "class": "RESTSerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 1136, + "description": "

You can use this method to customize how a serialized record is added to the complete\nJSON hash to be sent to the server. By default the JSON Serializer does not namespace\nthe payload and just sends the raw serialized JSON object.\nIf your server expects namespaced keys, you should consider using the RESTSerializer.\nOtherwise you can override this method to customize how the record is added to the hash.\nThe hash property should be modified by reference.

\n

For example, your server may expect underscored root objects.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import RESTSerializer from '@ember-data/serializer/rest';\nimport { decamelize } from '<app-name>/utils/string-utils';\n\nexport default class ApplicationSerializer extends RESTSerializer {\n  serializeIntoHash(data, type, snapshot, options) {\n    let root = decamelize(type.modelName);\n    data[root] = this.serialize(snapshot, options);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "serializeIntoHash", + "access": "public", + "tagname": "", + "params": [ + { + "name": "hash", + "description": "", + "type": "Object" + }, + { + "name": "typeClass", + "description": "", + "type": "Model" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "RESTSerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 1169, + "description": "

serializeAttribute can be used to customize how attr\nproperties are serialized

\n

For example if you wanted to ensure all your attributes were always\nserialized as properties on an attributes object you could\nwrite:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/application.js
1\n2\n3\n4\n5\n6\n7\n8\n
import JSONSerializer from '@ember-data/serializer/json';\n\nexport default class ApplicationSerializer extends JSONSerializer {\n  serializeAttribute(snapshot, json, key, attributes) {\n    json.attributes = json.attributes || {};\n    super.serializeAttribute(snapshot, json.attributes, key, attributes);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "serializeAttribute", + "access": "public", + "tagname": "", + "params": [ + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "json", + "description": "", + "type": "Object" + }, + { + "name": "key", + "description": "", + "type": "String" + }, + { + "name": "attribute", + "description": "", + "type": "Object" + } + ], + "class": "RESTSerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 1217, + "description": "

serializeBelongsTo can be used to customize how belongsTo\nproperties are serialized.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import JSONSerializer from '@ember-data/serializer/json';\n\nexport default class PostSerializer extends JSONSerializer {\n  serializeBelongsTo(snapshot, json, relationship) {\n    let key = relationship.key;\n    let belongsTo = snapshot.belongsTo(key);\n\n    key = this.keyForRelationship ? this.keyForRelationship(key, "belongsTo", "serialize") : key;\n\n    json[key] = !belongsTo ? null : belongsTo.record.toJSON();\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "serializeBelongsTo", + "access": "public", + "tagname": "", + "params": [ + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "json", + "description": "", + "type": "Object" + }, + { + "name": "relationship", + "description": "", + "type": "Object" + } + ], + "class": "RESTSerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 1271, + "description": "

serializeHasMany can be used to customize how hasMany\nproperties are serialized.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import JSONSerializer from '@ember-data/serializer/json';\n\nexport default class PostSerializer extends JSONSerializer {\n  serializeHasMany(snapshot, json, relationship) {\n    let key = relationship.key;\n    if (key === 'comments') {\n      return;\n    } else {\n      super.serializeHasMany(...arguments);\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "serializeHasMany", + "access": "public", + "tagname": "", + "params": [ + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "json", + "description": "", + "type": "Object" + }, + { + "name": "relationship", + "description": "", + "type": "Object" + } + ], + "class": "RESTSerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 1318, + "description": "

You can use this method to customize how polymorphic objects are\nserialized. Objects are considered to be polymorphic if\n{ polymorphic: true } is pass as the second argument to the\nbelongsTo function.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/comment.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import JSONSerializer from '@ember-data/serializer/json';\n\nexport default class CommentSerializer extends JSONSerializer {\n  serializePolymorphicType(snapshot, json, relationship) {\n    let key = relationship.key;\n    let belongsTo = snapshot.belongsTo(key);\n\n    key = this.keyForAttribute ? this.keyForAttribute(key, 'serialize') : key;\n\n    if (!belongsTo) {\n      json[key + '_type'] = null;\n    } else {\n      json[key + '_type'] = belongsTo.modelName;\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "serializePolymorphicType", + "access": "public", + "tagname": "", + "params": [ + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "json", + "description": "", + "type": "Object" + }, + { + "name": "relationship", + "description": "", + "type": "Object" + } + ], + "class": "RESTSerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 1353, + "description": "

extractMeta is used to deserialize any meta information in the\nadapter payload. By default Ember Data expects meta information to\nbe located on the meta property of the payload object.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import JSONSerializer from '@ember-data/serializer/json';\n\nexport default class PostSerializer extends JSONSerializer {\n  extractMeta(store, typeClass, payload) {\n    if (payload && payload.hasOwnProperty('_pagination')) {\n      let meta = payload._pagination;\n      delete payload._pagination;\n      return meta;\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "extractMeta", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "modelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + } + ], + "class": "RESTSerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 1388, + "description": "

extractErrors is used to extract model errors when a call\nto Model#save fails with an InvalidError. By default\nEmber Data expects error information to be located on the errors\nproperty of the payload object.

\n

This serializer expects this errors object to be an Array similar\nto the following, compliant with the https://jsonapi.org/format/#errors specification:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
{\n  "errors": [\n    {\n      "detail": "This username is already taken!",\n      "source": {\n        "pointer": "data/attributes/username"\n      }\n    }, {\n      "detail": "Doesn't look like a valid email.",\n      "source": {\n        "pointer": "data/attributes/email"\n      }\n    }\n  ]\n}
\n
\n
\n \n

The key detail provides a textual description of the problem.\nAlternatively, the key title can be used for the same purpose.

\n

The nested keys source.pointer detail which specific element\nof the request data was invalid.

\n

Note that JSON-API also allows for object-level errors to be placed\nin an object with pointer data, signifying that the problem\ncannot be traced to a specific attribute:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
{\n  "errors": [\n    {\n      "detail": "Some generic non property error message",\n      "source": {\n        "pointer": "data"\n      }\n    }\n  ]\n}
\n
\n
\n \n

When turn into a Errors object, you can read these errors\nthrough the property base:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
{{#each @model.errors.base as |error|}}\n  <div class="error">\n    {{error.message}}\n  </div>\n{{/each}}
\n
\n
\n \n

Example of alternative implementation, overriding the default\nbehavior to deal with a different format of errors:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import JSONSerializer from '@ember-data/serializer/json';\n\nexport default class PostSerializer extends JSONSerializer {\n  extractErrors(store, typeClass, payload, id) {\n    if (payload && typeof payload === 'object' && payload._problems) {\n      payload = payload._problems;\n      this.normalizeErrors(typeClass, payload);\n    }\n    return payload;\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "extractErrors", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "typeClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "(String|Number)" + } + ], + "return": { + "description": "json The deserialized errors", + "type": "Object" + }, + "class": "RESTSerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 1523, + "description": "

keyForAttribute can be used to define rules for how to convert an\nattribute name in your model to a key in your JSON.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/application.js
1\n2\n3\n4\n5\n6\n7\n8\n
import JSONSerializer from '@ember-data/serializer/json';\nimport { underscore } from '<app-name>/utils/string-utils';\n\nexport default class ApplicationSerializer extends JSONSerializer {\n  keyForAttribute(attr, method) {\n    return underscore(attr).toUpperCase();\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "keyForAttribute", + "access": "public", + "tagname": "", + "params": [ + { + "name": "key", + "description": "", + "type": "String" + }, + { + "name": "method", + "description": "", + "type": "String" + } + ], + "return": { + "description": "normalized key", + "type": "String" + }, + "class": "RESTSerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 1550, + "description": "

keyForRelationship can be used to define a custom key when\nserializing and deserializing relationship properties. By default\nJSONSerializer does not provide an implementation of this method.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/post.js
1\n2\n3\n4\n5\n6\n7\n8\n
  import JSONSerializer from '@ember-data/serializer/json';\n  import { underscore } from '<app-name>/utils/string-utils';\n\n  export default class PostSerializer extends JSONSerializer {\n    keyForRelationship(key, relationship, method) {\n      return `rel_${underscore(key)}`;\n    }\n  }
\n
\n
\n \n", + "itemtype": "method", + "name": "keyForRelationship", + "access": "public", + "tagname": "", + "params": [ + { + "name": "key", + "description": "", + "type": "String" + }, + { + "name": "typeClass", + "description": "", + "type": "String" + }, + { + "name": "method", + "description": "", + "type": "String" + } + ], + "return": { + "description": "normalized key", + "type": "String" + }, + "class": "RESTSerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 1579, + "description": "

keyForLink can be used to define a custom key when deserializing link\nproperties.

\n", + "itemtype": "method", + "name": "keyForLink", + "access": "public", + "tagname": "", + "params": [ + { + "name": "key", + "description": "", + "type": "String" + }, + { + "name": "kind", + "description": "`belongsTo` or `hasMany`", + "type": "String" + } + ], + "return": { + "description": "normalized key", + "type": "String" + }, + "class": "RESTSerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 1595, + "itemtype": "method", + "name": "transformFor", + "access": "private", + "tagname": "", + "params": [ + { + "name": "attributeType", + "description": "", + "type": "String" + }, + { + "name": "skipAssertion", + "description": "", + "type": "Boolean" + } + ], + "return": { + "description": "transform", + "type": "Transform" + }, + "class": "RESTSerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/index.ts", + "line": 163, + "description": "

The normalizeResponse method is used to normalize a payload from the\nserver to a JSON-API Document.

\n

http://jsonapi.org/format/#document-structure

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
Serializer.extend({\n  normalizeResponse(store, primaryModelClass, payload, id, requestType) {\n    if (requestType === 'findRecord') {\n      return this.normalize(primaryModelClass, payload);\n    } else {\n      return payload.reduce(function(documentHash, item) {\n        let { data, included } = this.normalize(primaryModelClass, item);\n        documentHash.included.push(...included);\n        documentHash.data.push(data);\n        return documentHash;\n      }, { data: [], included: [] })\n    }\n  }\n});
\n
\n
\n \n", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "RESTSerializer", + "module": "@ember-data/serializer", + "inherited": true, + "inheritedFrom": "Serializer" + }, + { + "file": "../packages/serializer/src/index.ts", + "line": 199, + "description": "

The serialize method is used when a record is saved in order to convert\nthe record into the form that your external data source expects.

\n

serialize takes an optional options hash with a single option:

\n
    \n
  • includeId: If this is true, serialize should include the ID\nin the serialized object it builds.
  • \n
\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
Serializer.extend({\n  serialize(snapshot, options) {\n    let json = {\n      id: snapshot.id\n    };\n\n    snapshot.eachAttribute((key, attribute) => {\n      json[key] = snapshot.attr(key);\n    });\n\n    snapshot.eachRelationship((key, relationship) => {\n      if (relationship.kind === 'belongsTo') {\n        json[key] = snapshot.belongsTo(key, { id: true });\n      } else if (relationship.kind === 'hasMany') {\n        json[key] = snapshot.hasMany(key, { ids: true });\n      }\n    });\n\n    return json;\n  },\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "serialize", + "access": "public", + "tagname": "", + "params": [ + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "options", + "description": "", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "RESTSerializer", + "module": "@ember-data/serializer", + "inherited": true, + "inheritedFrom": "Serializer" + }, + { + "file": "../packages/serializer/src/index.ts", + "line": 241, + "description": "

The normalize method is used to convert a payload received from your\nexternal data source into the normalized form store.push() expects. You\nshould override this method, munge the hash and return the normalized\npayload.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
Serializer.extend({\n  normalize(modelClass, resourceHash) {\n    let data = {\n      id:            resourceHash.id,\n      type:          modelClass.modelName,\n      attributes:    resourceHash\n    };\n    return { data: data };\n  }\n})
\n
\n
\n \n", + "itemtype": "method", + "name": "normalize", + "access": "public", + "tagname": "", + "params": [ + { + "name": "typeClass", + "description": "", + "type": "Model" + }, + { + "name": "hash", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "RESTSerializer", + "module": "@ember-data/serializer", + "inherited": true, + "inheritedFrom": "Serializer" + } + ], + "events": [], + "properties": [ + { + "file": "../packages/serializer/src/json.js", + "line": 95, + "description": "

The primaryKey is used when serializing and deserializing\ndata. Ember Data always uses the id property to store the id of\nthe record. The external source may not always follow this\nconvention. In these cases it is useful to override the\nprimaryKey property to match the primaryKey of your external\nstore.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/application.js
1\n2\n3\n4\n5\n
import JSONSerializer from '@ember-data/serializer/json';\n\nexport default class ApplicationSerializer extends JSONSerializer {\n  primaryKey = '_id'\n}
\n
\n
\n \n", + "itemtype": "property", + "name": "primaryKey", + "type": "{String}", + "access": "public", + "tagname": "", + "default": "'id'", + "class": "RESTSerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 120, + "itemtype": "property", + "description": "

The attrs object can be used to declare a simple mapping between\nproperty names on Model records and payload keys in the\nserialized JSON object representing the record. An object with the\nproperty key can also be used to designate the attribute's key on\nthe response payload.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/models/person.js
1\n2\n3\n4\n5\n
import Model, { attr } from '@ember-data/model';\n\nexport default class PersonModel extends Model {\n  @attr('boolean') admin;\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/person.js
1\n2\n3\n4\n5\n6\n7\n8\n
import JSONSerializer from '@ember-data/serializer/json';\n\nexport default class PersonSerializer extends JSONSerializer {\n  attrs = {\n    admin: 'is_admin',\n    occupation: { key: 'career' }\n  }\n}
\n
\n
\n \n

You can also remove attributes and relationships by setting the serialize\nkey to false in your mapping object.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/person.js
1\n2\n3\n4\n5\n6\n7\n8\n
import JSONSerializer from '@ember-data/serializer/json';\n\nexport default class PostSerializer extends JSONSerializer {\n  attrs = {\n    admin: { serialize: false },\n    occupation: { key: 'career' }\n  }\n}
\n
\n
\n \n

When serialized:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
{\n  "firstName": "Harry",\n  "lastName": "Houdini",\n  "career": "magician"\n}
\n
\n
\n \n

Note that the admin is now not included in the payload.

\n

Setting serialize to true enforces serialization for hasMany\nrelationships even if it's neither a many-to-many nor many-to-none\nrelationship.

\n", + "name": "attrs", + "access": "public", + "tagname": "", + "type": "{Object}", + "class": "RESTSerializer", + "module": "@ember-data/serializer/json", + "inherited": true, + "inheritedFrom": "JSONSerializer" + }, + { + "file": "../packages/serializer/src/index.ts", + "line": 141, + "description": "

The store property is the application's store that contains\nall records. It can be used to look up serializers for other model\ntypes that may be nested inside the payload response.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
Serializer.extend({\n  extractRelationship(relationshipModelName, relationshipHash) {\n    let modelClass = this.store.modelFor(relationshipModelName);\n    let relationshipSerializer = this.store.serializerFor(relationshipModelName);\n    return relationshipSerializer.normalize(modelClass, relationshipHash);\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "store", + "type": "{Store}", + "access": "public", + "tagname": "", + "class": "RESTSerializer", + "module": "@ember-data/serializer", + "inherited": true, + "inheritedFrom": "Serializer" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-data-5.3.0-JSONSerializer", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/serializer/rest", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-RecordArray.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-RecordArray.json new file mode 100644 index 000000000..33b6ddf99 --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-RecordArray.json @@ -0,0 +1,97 @@ +{ + "data": { + "id": "ember-data-5.3.0-RecordArray", + "type": "class", + "attributes": { + "name": "RecordArray", + "shortname": "RecordArray", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/store", + "namespace": "", + "file": "../store/src/-private/record-arrays/identifier-array.ts", + "line": 156, + "description": "

A record array is an array that contains records of a certain type (or modelName).\nThe record array materializes records as needed when they are retrieved for the first\ntime. You should not create record arrays yourself. Instead, an instance of\nRecordArray or its subclasses will be returned by your application's store\nin response to queries.

\n

This class should not be imported and instantiated by consuming applications.

\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "../packages/store/src/-private/record-arrays/identifier-array.ts", + "line": 441, + "description": "

Used to get the latest version of all of the records in this array\nfrom the adapter.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
let people = store.peekAll('person');\npeople.isUpdating; // false\n\npeople.update().then(function() {\n  people.isUpdating; // false\n});\n\npeople.isUpdating; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "update", + "access": "public", + "tagname": "", + "class": "RecordArray", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/record-arrays/identifier-array.ts", + "line": 492, + "description": "

Saves all of the records in the RecordArray.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let messages = store.peekAll('message');\nmessages.forEach(function(message) {\n  message.hasBeenSeen = true;\n});\nmessages.save();
\n
\n
\n \n", + "itemtype": "method", + "name": "save", + "access": "public", + "tagname": "", + "return": { + "description": "promise", + "type": "Promise" + }, + "class": "RecordArray", + "module": "@ember-data/store" + } + ], + "events": [], + "properties": [ + { + "file": "../packages/store/src/-private/record-arrays/identifier-array.ts", + "line": 173, + "description": "

The flag to signal a RecordArray is currently loading data.\nExample

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let people = store.peekAll('person');\npeople.isUpdating; // false\npeople.update();\npeople.isUpdating; // true
\n
\n
\n \n", + "itemtype": "property", + "name": "isUpdating", + "access": "public", + "tagname": "", + "type": "Boolean", + "class": "RecordArray", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/record-arrays/identifier-array.ts", + "line": 202, + "description": "

The store that created this record array.

\n", + "itemtype": "property", + "name": "store", + "access": "private", + "tagname": "", + "type": "Store", + "class": "RecordArray", + "module": "@ember-data/store" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/store", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-RecordReference.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-RecordReference.json new file mode 100644 index 000000000..9c572f0cd --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-RecordReference.json @@ -0,0 +1,160 @@ +{ + "data": { + "id": "ember-data-5.3.0-RecordReference", + "type": "class", + "attributes": { + "name": "RecordReference", + "shortname": "RecordReference", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/store", + "namespace": "", + "file": "../store/src/-private/legacy-model-support/record-reference.ts", + "line": 18, + "description": "

A RecordReference is a low-level API that allows users and\naddon authors to perform meta-operations on a record.

\n", + "access": "public", + "tagname": "", + "extends": "Reference", + "methods": [ + { + "file": "../packages/store/src/-private/legacy-model-support/record-reference.ts", + "line": 55, + "description": "

The id of the record that this reference refers to.

\n

Together, the type and id properties form a composite key for\nthe identity map.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
let userRef = store.getReference('user', 1);\n\nuserRef.id(); // '1'
\n
\n
\n \n", + "itemtype": "method", + "name": "id", + "access": "public", + "tagname": "", + "return": { + "description": "The id of the record.", + "type": "String" + }, + "class": "RecordReference", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/legacy-model-support/record-reference.ts", + "line": 78, + "description": "

The identifier of the record that this reference refers to.

\n

Together, the type and id properties form a composite key for\nthe identity map.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
let userRef = store.getReference('user', 1);\n\nuserRef.identifier(); // '1'
\n
\n
\n \n", + "itemtype": "method", + "name": "identifier", + "access": "public", + "tagname": "", + "return": { + "description": "The identifier of the record.", + "type": "String" + }, + "class": "RecordReference", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/legacy-model-support/record-reference.ts", + "line": 100, + "description": "

How the reference will be looked up when it is loaded. Currently\nthis always returns identity to signify that a record will be\nloaded by its type and id.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const userRef = store.getReference('user', 1);\n\nuserRef.remoteType(); // 'identity'
\n
\n
\n \n", + "itemtype": "method", + "name": "remoteType", + "access": "public", + "tagname": "", + "return": { + "description": "'identity'", + "type": "String" + }, + "class": "RecordReference", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/legacy-model-support/record-reference.ts", + "line": 121, + "description": "

This API allows you to provide a reference with new data. The\nsimplest usage of this API is similar to store.push: you provide a\nnormalized hash of data and the object represented by the reference\nwill update.

\n

If you pass a promise to push, Ember Data will not ask the adapter\nfor the data if another attempt to fetch it is made in the\ninterim. When the promise resolves, the underlying object is updated\nwith the new data, and the promise returned by this function is resolved\nwith that object.

\n

For example, recordReference.push(promise) will be resolved with a\nrecord.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
 let userRef = store.getReference('user', 1);\n\n // provide data for reference\n userRef.push({\n   data: {\n     id: "1",\n     type: "user",\n     attributes: {\n       username: "@user"\n     }\n   }\n }).then(function(user) {\n   userRef.value() === user;\n });
\n
\n
\n \n", + "itemtype": "method", + "name": "push", + "access": "public", + "tagname": "", + "params": [ + { + "name": "objectOrPromise", + "description": "a JSON:API ResourceDocument or a promise resolving to one" + } + ], + "return": { + "description": "a promise for the value (record or relationship)" + }, + "class": "RecordReference", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/legacy-model-support/record-reference.ts", + "line": 167, + "description": "

If the entity referred to by the reference is already loaded, it is\npresent as reference.value. Otherwise the value returned by this function\nis null.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
 let userRef = store.getReference('user', 1);\n\n userRef.value(); // user
\n
\n
\n \n", + "itemtype": "method", + "name": "value", + "access": "public", + "tagname": "", + "return": { + "description": "the record for this RecordReference", + "type": "Model" + }, + "class": "RecordReference", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/legacy-model-support/record-reference.ts", + "line": 188, + "description": "

Triggers a fetch for the backing entity based on its remoteType\n(see remoteType definitions per reference type).

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let userRef = store.getReference('user', 1);\n\n// load user (via store.find)\nuserRef.load().then(...)
\n
\n
\n \n", + "itemtype": "method", + "name": "load", + "access": "public", + "tagname": "", + "return": { + "description": "the record for this RecordReference", + "type": "Promise" + }, + "class": "RecordReference", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/legacy-model-support/record-reference.ts", + "line": 213, + "description": "

Reloads the record if it is already loaded. If the record is not\nloaded it will load the record via store.findRecord

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let userRef = store.getReference('user', 1);\n\n// or trigger a reload\nuserRef.reload().then(...)
\n
\n
\n \n", + "itemtype": "method", + "name": "reload", + "access": "public", + "tagname": "", + "return": { + "description": "the record for this RecordReference", + "type": "Promise" + }, + "class": "RecordReference", + "module": "@ember-data/store" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": { + "id": "Reference", + "type": "missing" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/store", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-RequestManager.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-RequestManager.json new file mode 100644 index 000000000..4e6d2e6bd --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-RequestManager.json @@ -0,0 +1,112 @@ +{ + "data": { + "id": "ember-data-5.3.0-RequestManager", + "type": "class", + "attributes": { + "name": "RequestManager", + "shortname": "RequestManager", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/request", + "namespace": "", + "file": "../request/src/-private/manager.ts", + "line": 415, + "description": "
\n
\n
\n \n \n \n \n \n \n \n
1\n
import RequestManager from '@ember-data/request';
\n
\n
\n \n

A RequestManager provides a request/response flow in which configured\nhandlers are successively given the opportunity to handle, modify, or\npass-along a request.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
interface RequestManager {\n  request<T>(req: RequestInfo): Future<T>;\n}
\n
\n
\n \n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import RequestManager from '@ember-data/request';\nimport Fetch from '@ember-data/request/fetch';\nimport Auth from 'ember-simple-auth/ember-data-handler';\nimport Config from './config';\n\nconst { apiUrl } = Config;\n\n// ... create manager\nconst manager = new RequestManager();\nmanager.use([Auth, Fetch]);\n\n// ... execute a request\nconst response = await manager.request({\n  url: `${apiUrl}/users`\n});
\n
\n
\n \n

Futures

\n

The return value of manager.request is a Future, which allows\naccess to limited information about the request while it is still\npending and fulfills with the final state when the request completes.

\n

A Future is cancellable via abort.

\n

Handlers may optionally expose a ReadableStream to the Future for\nstreaming data; however, when doing so the future should not resolve\nuntil the response stream is fully read.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
interface Future<T> extends Promise<StructuredDocument<T>> {\n  abort(): void;\n\n  async getStream(): ReadableStream | null;\n}
\n
\n
\n \n

StructuredDocuments

\n

A Future resolves with a StructuredDataDocument or rejects with a StructuredErrorDocument.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
interface StructuredDataDocument<T> {\n  request: ImmutableRequestInfo;\n  response: ImmutableResponseInfo;\n  content: T;\n}\ninterface StructuredErrorDocument extends Error {\n  request: ImmutableRequestInfo;\n  response: ImmutableResponseInfo;\n  error: string | object;\n}\ntype StructuredDocument<T> = StructuredDataDocument<T> | StructuredErrorDocument;
\n
\n
\n \n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "../packages/request/src/-private/manager.ts", + "line": 501, + "description": "

Register a handler to use for primary cache intercept.

\n

Only one such handler may exist. If using the same\nRequestManager as the Store instance the Store\nregisters itself as a Cache handler.

\n", + "itemtype": "method", + "name": "useCache", + "access": "public", + "tagname": "", + "params": [ + { + "name": "cacheHandler", + "description": "", + "type": "Handler[]" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "RequestManager", + "module": "@ember-data/request" + }, + { + "file": "../packages/request/src/-private/manager.ts", + "line": 528, + "description": "

Register handler(s) to use when a request is issued.

\n

Handlers will be invoked in the order they are registered.\nEach Handler is given the opportunity to handle the request,\ncurry the request, or pass along a modified request.

\n", + "itemtype": "method", + "name": "use", + "access": "public", + "tagname": "", + "params": [ + { + "name": "newHandlers", + "description": "", + "type": "Handler[]" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "RequestManager", + "module": "@ember-data/request" + }, + { + "file": "../packages/request/src/-private/manager.ts", + "line": 562, + "description": "

Issue a Request.

\n

Returns a Future that fulfills with a StructuredDocument

\n", + "itemtype": "method", + "name": "request", + "access": "public", + "tagname": "", + "params": [ + { + "name": "request", + "description": "", + "type": "RequestInfo" + } + ], + "return": { + "description": "", + "type": "Future" + }, + "class": "RequestManager", + "module": "@ember-data/request" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/request", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-RequestStateService.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-RequestStateService.json new file mode 100644 index 000000000..7738cc01d --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-RequestStateService.json @@ -0,0 +1,113 @@ +{ + "data": { + "id": "ember-data-5.3.0-RequestStateService", + "type": "class", + "attributes": { + "name": "RequestStateService", + "shortname": "RequestStateService", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/store", + "namespace": "", + "file": "../store/src/-private/network/request-cache.ts", + "line": 34, + "description": "

The RequestStateService is used to track the state of requests\nfor fetching or updating known resource identifies that are inflight.

\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "../packages/store/src/-private/network/request-cache.ts", + "line": 167, + "description": "

Subscribe to requests for a given resource identity.

\n

The callback will receive the current state of the request.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
interface RequestState {\n  state: 'pending' | 'fulfilled' | 'rejected';\n  type: 'query' | 'mutation';\n  request: Request;\n  response?: { data: unknown };\n}
\n
\n
\n \n

Note: It should be considered dangerous to use this API for more than simple\nstate derivation or debugging. The request and response properties are poorly\nspec'd and may change unexpectedly when shifting what Handlers are in use or how\nrequests are issued from the Store.

\n

We expect to revisit this API in the near future as we continue to refine the\nRequestManager ergonomics, as a simpler but more powerful direct integration\nwith the RequestManager for these purposes is likely to be a better long-term\ndesign.

\n", + "itemtype": "method", + "name": "subscribeForRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "", + "type": "StableRecordIdentifier" + }, + { + "name": "callback", + "description": "", + "type": "(state: RequestState) => void" + } + ], + "class": "RequestStateService", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/network/request-cache.ts", + "line": 205, + "description": "

Retrieve all active requests for a given resource identity.

\n", + "itemtype": "method", + "name": "getPendingRequestsForRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "", + "type": "StableRecordIdentifier" + } + ], + "return": { + "description": "an array of request states for any pending requests for the given identifier", + "type": "RequestState[]" + }, + "class": "RequestStateService", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/network/request-cache.ts", + "line": 217, + "description": "

Retrieve the last completed request for a given resource identity.

\n", + "itemtype": "method", + "name": "getLastRequestForRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "", + "type": "StableRecordIdentifier" + } + ], + "return": { + "description": "the state of the most recent request for the given identifier", + "type": "RequestState | null" + }, + "class": "RequestStateService", + "module": "@ember-data/store" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/store", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-SchemaService.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-SchemaService.json new file mode 100644 index 000000000..1fded80bb --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-SchemaService.json @@ -0,0 +1,112 @@ +{ + "data": { + "id": "ember-data-5.3.0-SchemaService", + "type": "class", + "attributes": { + "name": "SchemaService", + "shortname": "SchemaService", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/store", + "namespace": "", + "file": "../../ember-data-types/q/schema-service.ts", + "line": 8, + "access": "public", + "description": "

A SchemaDefinitionService implementation provides the ability\nto query for various information about a resource in an abstract manner.

\n

How an implementation determines this information is left up to the implementation,\nthis means that schema information could be lazily populated, derived-on-demand,\nor progressively enhanced during the course of an application's runtime.

\n

The implementation provided to work with @ember-data/model makes use of the\nstatic schema properties on those classes to respond to these queries; however,\nthat is not a necessary approach. For instance, Schema information could be sideloaded\nor pre-flighted for API calls, resulting in no need to bundle and ship potentially\nlarge and expensive JSON or JS schemas to pull information from.

\n

To register a custom schema implementation, extend the store service or\nlookup and register the schema service first thing on app-boot. Example below\nshows extending the service.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Store from '@ember-data/store';\nimport CustomSchemas from './custom-schemas';\n\nexport default class extends Store {\n  constructor(...args) {\n    super(...args);\n    this.registerSchemaDefinitionService(new CustomSchemas());\n  }\n}
\n
\n
\n \n

At runtime, both the Store and the StoreWrapper provide\naccess to this service via the getSchemaDefinitionService() method.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
export default class extends Component {\n  @service store;\n\n get attributes() {\n   return this.store\n     .getSchemaDefinitionService()\n     .attributesDefinitionFor(this.args.dataType);\n }\n}
\n
\n
\n \n

This is not a class and cannot be instantiated.

\n", + "tagname": "", + "methods": [ + { + "file": "../ember-data-types/q/schema-service.ts", + "line": 59, + "description": "

Queries whether the schema-definition-service recognizes type as a resource type

\n", + "itemtype": "method", + "name": "doesTypeExist", + "access": "public", + "tagname": "", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "SchemaService", + "module": "@ember-data/store" + }, + { + "file": "../ember-data-types/q/schema-service.ts", + "line": 69, + "itemtype": "method", + "description": "

Returns definitions for all properties of the specified resource\nthat are considered "attributes". Generally these are properties\nthat are not related to book-keeping state on the client and do\nnot represent a linkage to another resource.

\n

The return value should be a dictionary of key:value pairs\nwhere the key is the attribute or property's name and value\nis an object with at least the property name which should also\nmatch key.

\n

Optionally, this object may also specify type, which should\nbe a string reference to a transform, and options which\nshould be dictionary in which any key:value pairs are permissable.

\n

For instance, when using @ember-data/model, the following attribute\ndefinition:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
class extends Model {\n  @attr firstName;\n}
\n
\n
\n \n

Would be returned as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
{\n  greeting: { name: 'greeting', type: 'string', options: { defaultValue: 'hello' } },\n  birthday: { name: 'birthday', type: 'date' },\n  firstName: { name: 'firstName' }\n}
\n
\n
\n \n", + "name": "attributesDefinitionFor", + "access": "public", + "tagname": "", + "params": [ + { + "name": "}", + "description": "identifier", + "type": "RecordIdentifier| type: string" + } + ], + "return": { + "description": "", + "type": "AttributesSchema" + }, + "class": "SchemaService", + "module": "@ember-data/store" + }, + { + "file": "../ember-data-types/q/schema-service.ts", + "line": 112, + "itemtype": "method", + "description": "

Returns definitions for all properties of the specified resource\nthat are considered "relationships". Generally these are properties\nthat represent a linkage to another resource.

\n

The return value should be a dictionary of key:value pairs\nwhere the key is the relationship or property's name and value\nis an object with at least the following properties:

\n
    \n
  • name which should also match the key used in the dictionary.

    \n
  • \n
  • kind which should be either belongsTo or hasMany

    \n
  • \n
  • type which should be the related resource's string "type"

    \n
  • \n
  • options which should be a dictionary allowing any key but with\n at least the below keys present.

    \n
  • \n
  • options.async a boolean representing whether data for this relationship is\n typically loaded on-demand.

    \n
  • \n
  • options.inverse a string or null representing the field name / key of the

    \n
    \n
    \n
    \n \n \n \n \n \n \n \n
    1\n
    corresponding relationship on the inverse resource.
    \n
    \n
    \n
  • \n
\n

Additionally the following options properties are optional. See Polymorphic Relationships

\n
    \n
  • options.polymorphic a boolean representing whether multiple resource types\n can be used to satisfy this relationship.
  • \n
  • options.as a string representing the abstract type that the concrete side of\n a relationship must specify when fulfilling a polymorphic inverse.
  • \n
\n

For example, the following Model using @ember-data/model would generate this relationships\ndefinition by default:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
class User extends Model {\n  @belongsto('user', { async: false, inverse: null }) bestFriend;\n  @hasmany('pet', { async: false, polymorphic: true, inverse: 'owner' }) pets;\n}
\n
\n
\n \n

Which would be returned as

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n
{\n  bestFriend: {\n    name: 'bestFriend',\n    kind: 'belongsTo',\n    type: 'user',\n    options: {\n      async: false,\n      inverse: null\n    }\n  },\n  friends: {\n    name: 'friends',\n    kind: 'hasMany',\n    type: 'user',\n    options: {\n      async: true,\n      inverse: 'friends'\n    }\n  },\n  pets: {\n    name: 'pets',\n    kind: 'hasMany',\n    type: 'pet',\n    options: {\n      async: false,\n      polymorphic: true,\n      inverse: 'owner'\n    }\n  },\n}
\n
\n
\n \n", + "name": "relationshipsDefinitionFor", + "access": "public", + "tagname": "", + "params": [ + { + "name": "}", + "description": "identifier", + "type": "RecordIdentifier| type: string" + } + ], + "return": { + "description": "", + "type": "RelationshipsSchema" + }, + "class": "SchemaService", + "module": "@ember-data/store" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/store", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-Serializer.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-Serializer.json new file mode 100644 index 000000000..a50f84cdf --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-Serializer.json @@ -0,0 +1,166 @@ +{ + "data": { + "id": "ember-data-5.3.0-Serializer", + "type": "class", + "attributes": { + "name": "Serializer", + "shortname": "Serializer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/serializer", + "namespace": "", + "file": "../serializer/src/index.ts", + "line": 116, + "description": "
\n

⚠️ CAUTION you likely want the docs for Serializer\nas extending this abstract class is unnecessary.

\n
\n

Serializer is an abstract base class that you may override in your\napplication to customize it for your backend. The minimum set of methods\nthat you should implement is:

\n
    \n
  • normalizeResponse()
  • \n
  • serialize()
  • \n
\n

And you can optionally override the following methods:

\n
    \n
  • normalize()
  • \n
\n

For an example implementation, see\nJSONSerializer, the included JSON serializer.

\n", + "access": "public", + "tagname": "", + "extends": "Ember.EmberObject", + "methods": [ + { + "file": "../packages/serializer/src/index.ts", + "line": 163, + "description": "

The normalizeResponse method is used to normalize a payload from the\nserver to a JSON-API Document.

\n

http://jsonapi.org/format/#document-structure

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
Serializer.extend({\n  normalizeResponse(store, primaryModelClass, payload, id, requestType) {\n    if (requestType === 'findRecord') {\n      return this.normalize(primaryModelClass, payload);\n    } else {\n      return payload.reduce(function(documentHash, item) {\n        let { data, included } = this.normalize(primaryModelClass, item);\n        documentHash.included.push(...included);\n        documentHash.data.push(data);\n        return documentHash;\n      }, { data: [], included: [] })\n    }\n  }\n});
\n
\n
\n \n", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "Serializer", + "module": "@ember-data/serializer" + }, + { + "file": "../packages/serializer/src/index.ts", + "line": 199, + "description": "

The serialize method is used when a record is saved in order to convert\nthe record into the form that your external data source expects.

\n

serialize takes an optional options hash with a single option:

\n
    \n
  • includeId: If this is true, serialize should include the ID\nin the serialized object it builds.
  • \n
\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
Serializer.extend({\n  serialize(snapshot, options) {\n    let json = {\n      id: snapshot.id\n    };\n\n    snapshot.eachAttribute((key, attribute) => {\n      json[key] = snapshot.attr(key);\n    });\n\n    snapshot.eachRelationship((key, relationship) => {\n      if (relationship.kind === 'belongsTo') {\n        json[key] = snapshot.belongsTo(key, { id: true });\n      } else if (relationship.kind === 'hasMany') {\n        json[key] = snapshot.hasMany(key, { ids: true });\n      }\n    });\n\n    return json;\n  },\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "serialize", + "access": "public", + "tagname": "", + "params": [ + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "options", + "description": "", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "Serializer", + "module": "@ember-data/serializer" + }, + { + "file": "../packages/serializer/src/index.ts", + "line": 241, + "description": "

The normalize method is used to convert a payload received from your\nexternal data source into the normalized form store.push() expects. You\nshould override this method, munge the hash and return the normalized\npayload.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
Serializer.extend({\n  normalize(modelClass, resourceHash) {\n    let data = {\n      id:            resourceHash.id,\n      type:          modelClass.modelName,\n      attributes:    resourceHash\n    };\n    return { data: data };\n  }\n})
\n
\n
\n \n", + "itemtype": "method", + "name": "normalize", + "access": "public", + "tagname": "", + "params": [ + { + "name": "typeClass", + "description": "", + "type": "Model" + }, + { + "name": "hash", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "Serializer", + "module": "@ember-data/serializer" + } + ], + "events": [], + "properties": [ + { + "file": "../packages/serializer/src/index.ts", + "line": 141, + "description": "

The store property is the application's store that contains\nall records. It can be used to look up serializers for other model\ntypes that may be nested inside the payload response.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
Serializer.extend({\n  extractRelationship(relationshipModelName, relationshipHash) {\n    let modelClass = this.store.modelFor(relationshipModelName);\n    let relationshipSerializer = this.store.serializerFor(relationshipModelName);\n    return relationshipSerializer.normalize(modelClass, relationshipHash);\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "store", + "type": "{Store}", + "access": "public", + "tagname": "", + "class": "Serializer", + "module": "@ember-data/serializer" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "Ember.EmberObject", + "type": "missing" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-data-5.3.0-JSONSerializer" + } + ] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/serializer", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-ServerError.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-ServerError.json new file mode 100644 index 000000000..7d61f76b1 --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-ServerError.json @@ -0,0 +1,49 @@ +{ + "data": { + "id": "ember-data-5.3.0-ServerError", + "type": "class", + "attributes": { + "name": "ServerError", + "shortname": "ServerError", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/adapter/error", + "namespace": "", + "file": "../adapter/src/error.js", + "line": 332, + "description": "

A ServerError equates to a HTTP 500 Internal Server Error response\nstatus. It is used by the adapter to indicate that a request has failed\nbecause of an error in the external API.

\n", + "access": "public", + "tagname": "", + "extends": "AdapterError", + "methods": [], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-data-5.3.0-AdapterError", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/adapter/error", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-Snapshot.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-Snapshot.json new file mode 100644 index 000000000..41963cf28 --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-Snapshot.json @@ -0,0 +1,322 @@ +{ + "data": { + "id": "ember-data-5.3.0-Snapshot", + "type": "class", + "attributes": { + "name": "Snapshot", + "shortname": "Snapshot", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/store", + "namespace": "", + "file": "../legacy-compat/src/legacy-network-handler/snapshot.ts", + "line": 23, + "description": "

Snapshot is not directly instantiable.\nInstances are provided to a consuming application's\nadapters and serializers for certain requests.

\n

Snapshots are only available when using @ember-data/legacy-compat\nfor legacy compatibility with adapters and serializers.

\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "../packages/legacy-compat/src/legacy-network-handler/snapshot.ts", + "line": 49, + "itemtype": "method", + "name": "constructor", + "is_constructor": 1, + "access": "private", + "tagname": "", + "params": [ + { + "name": "options", + "description": "" + }, + { + "name": "identifier", + "description": "" + }, + { + "name": "_store", + "description": "" + } + ], + "class": "Snapshot", + "module": "@ember-data/store" + }, + { + "file": "../packages/legacy-compat/src/legacy-network-handler/snapshot.ts", + "line": 176, + "description": "

Returns the value of an attribute.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
// store.push('post', { id: 1, author: 'Tomster', title: 'Ember.js rocks' });\npostSnapshot.attr('author'); // => 'Tomster'\npostSnapshot.attr('title'); // => 'Ember.js rocks'
\n
\n
\n \n

Note: Values are loaded eagerly and cached when the snapshot is created.

\n", + "itemtype": "method", + "name": "attr", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The attribute value or undefined", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Snapshot", + "module": "@ember-data/store" + }, + { + "file": "../packages/legacy-compat/src/legacy-network-handler/snapshot.ts", + "line": 201, + "description": "

Returns all attributes and their corresponding values.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
// store.push('post', { id: 1, author: 'Tomster', title: 'Ember.js rocks' });\npostSnapshot.attributes(); // => { author: 'Tomster', title: 'Ember.js rocks' }
\n
\n
\n \n", + "itemtype": "method", + "name": "attributes", + "return": { + "description": "All attributes of the current snapshot", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Snapshot", + "module": "@ember-data/store" + }, + { + "file": "../packages/legacy-compat/src/legacy-network-handler/snapshot.ts", + "line": 219, + "description": "

Returns all changed attributes and their old and new values.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
// store.push('post', { id: 1, author: 'Tomster', title: 'Ember.js rocks' });\npostModel.set('title', 'Ember.js rocks!');\npostSnapshot.changedAttributes(); // => { title: ['Ember.js rocks', 'Ember.js rocks!'] }
\n
\n
\n \n", + "itemtype": "method", + "name": "changedAttributes", + "return": { + "description": "All changed attributes of the current snapshot", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Snapshot", + "module": "@ember-data/store" + }, + { + "file": "../packages/legacy-compat/src/legacy-network-handler/snapshot.ts", + "line": 250, + "description": "

Returns the current value of a belongsTo relationship.

\n

belongsTo takes an optional hash of options as a second parameter,\ncurrently supported options are:

\n
    \n
  • id: set to true if you only want the ID of the related record to be\nreturned.
  • \n
\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
// store.push('post', { id: 1, title: 'Hello World' });\n// store.createRecord('comment', { body: 'Lorem ipsum', post: post });\ncommentSnapshot.belongsTo('post'); // => Snapshot\ncommentSnapshot.belongsTo('post', { id: true }); // => '1'\n\n// store.push('comment', { id: 1, body: 'Lorem ipsum' });\ncommentSnapshot.belongsTo('post'); // => undefined
\n
\n
\n \n

Calling belongsTo will return a new Snapshot as long as there's any known\ndata for the relationship available, such as an ID. If the relationship is\nknown but unset, belongsTo will return null. If the contents of the\nrelationship is unknown belongsTo will return undefined.

\n

Note: Relationships are loaded lazily and cached upon first access.

\n", + "itemtype": "method", + "name": "belongsTo", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object", + "optional": true + } + ], + "access": "public", + "tagname": "", + "return": { + "description": "A snapshot or ID of a known\nrelationship or null if the relationship is known but unset. undefined\nwill be returned if the contents of the relationship is unknown.", + "type": "(Snapshot|String|null|undefined)" + }, + "class": "Snapshot", + "module": "@ember-data/store" + }, + { + "file": "../packages/legacy-compat/src/legacy-network-handler/snapshot.ts", + "line": 363, + "description": "

Returns the current value of a hasMany relationship.

\n

hasMany takes an optional hash of options as a second parameter,\ncurrently supported options are:

\n
    \n
  • ids: set to true if you only want the IDs of the related records to be\nreturned.
  • \n
\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// store.push('post', { id: 1, title: 'Hello World', comments: [2, 3] });\npostSnapshot.hasMany('comments'); // => [Snapshot, Snapshot]\npostSnapshot.hasMany('comments', { ids: true }); // => ['2', '3']\n\n// store.push('post', { id: 1, title: 'Hello World' });\npostSnapshot.hasMany('comments'); // => undefined
\n
\n
\n \n

Note: Relationships are loaded lazily and cached upon first access.

\n", + "itemtype": "method", + "name": "hasMany", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object", + "optional": true + } + ], + "access": "public", + "tagname": "", + "return": { + "description": "An array of snapshots or IDs of a known\nrelationship or an empty array if the relationship is known but unset.\nundefined will be returned if the contents of the relationship is unknown.", + "type": "(Array|undefined)" + }, + "class": "Snapshot", + "module": "@ember-data/store" + }, + { + "file": "../packages/legacy-compat/src/legacy-network-handler/snapshot.ts", + "line": 472, + "description": "

Iterates through all the attributes of the model, calling the passed\nfunction on each attribute.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
snapshot.eachAttribute(function(name, meta) {\n  // ...\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "eachAttribute", + "params": [ + { + "name": "callback", + "description": "the callback to execute", + "type": "Function" + }, + { + "name": "binding", + "description": "the value to which the callback's `this` should be bound", + "type": "Object", + "optional": true + } + ], + "access": "public", + "tagname": "", + "class": "Snapshot", + "module": "@ember-data/store" + }, + { + "file": "../packages/legacy-compat/src/legacy-network-handler/snapshot.ts", + "line": 496, + "description": "

Iterates through all the relationships of the model, calling the passed\nfunction on each relationship.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
snapshot.eachRelationship(function(name, relationship) {\n  // ...\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "eachRelationship", + "params": [ + { + "name": "callback", + "description": "the callback to execute", + "type": "Function" + }, + { + "name": "binding", + "description": "the value to which the callback's `this` should be bound", + "type": "Object", + "optional": true + } + ], + "access": "public", + "tagname": "", + "class": "Snapshot", + "module": "@ember-data/store" + }, + { + "file": "../packages/legacy-compat/src/legacy-network-handler/snapshot.ts", + "line": 520, + "description": "

Serializes the snapshot using the serializer for the model.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Adapter from '@ember-data/adapter';\n\nexport default Adapter.extend({\n  createRecord(store, type, snapshot) {\n    let data = snapshot.serialize({ includeId: true });\n    let url = `/${type.modelName}`;\n\n    return fetch(url, {\n      method: 'POST',\n      body: data,\n    }).then((response) => response.json())\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "serialize", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "an object whose values are primitive JSON values only", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Snapshot", + "module": "@ember-data/store" + } + ], + "events": [], + "properties": [ + { + "file": "../packages/legacy-compat/src/legacy-network-handler/snapshot.ts", + "line": 69, + "description": "

The unique RecordIdentifier associated with this Snapshot.

\n", + "itemtype": "property", + "name": "identifier", + "access": "public", + "tagname": "", + "type": "{StableRecordIdentifier}", + "class": "Snapshot", + "module": "@ember-data/store" + }, + { + "file": "../packages/legacy-compat/src/legacy-network-handler/snapshot.ts", + "line": 89, + "description": "

The id of the snapshot's underlying record

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
// store.push('post', { id: 1, author: 'Tomster', title: 'Ember.js rocks' });\npostSnapshot.id; // => '1'
\n
\n
\n \n", + "itemtype": "property", + "name": "id", + "type": "{String}", + "access": "public", + "tagname": "", + "class": "Snapshot", + "module": "@ember-data/store" + }, + { + "file": "../packages/legacy-compat/src/legacy-network-handler/snapshot.ts", + "line": 105, + "description": "

A hash of adapter options

\n", + "itemtype": "property", + "name": "adapterOptions", + "type": "{Object}", + "access": "public", + "tagname": "", + "class": "Snapshot", + "module": "@ember-data/store" + }, + { + "file": "../packages/legacy-compat/src/legacy-network-handler/snapshot.ts", + "line": 113, + "description": "

If include was passed to the options hash for the request, the value\nwould be available here.

\n", + "itemtype": "property", + "name": "include", + "type": "{String|Array}", + "access": "public", + "tagname": "", + "class": "Snapshot", + "module": "@ember-data/store" + }, + { + "file": "../packages/legacy-compat/src/legacy-network-handler/snapshot.ts", + "line": 123, + "description": "

The name of the type of the underlying record for this snapshot, as a string.

\n", + "itemtype": "property", + "name": "modelName", + "type": "{String}", + "access": "public", + "tagname": "", + "class": "Snapshot", + "module": "@ember-data/store" + }, + { + "file": "../packages/legacy-compat/src/legacy-network-handler/snapshot.ts", + "line": 137, + "description": "

The underlying record for this snapshot. Can be used to access methods and\nproperties defined on the record.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
let json = snapshot.record.toJSON();
\n
\n
\n \n", + "itemtype": "property", + "name": "record", + "type": "{Model}", + "access": "public", + "tagname": "", + "class": "Snapshot", + "module": "@ember-data/store" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/store", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-SnapshotRecordArray.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-SnapshotRecordArray.json new file mode 100644 index 000000000..68fdea9be --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-SnapshotRecordArray.json @@ -0,0 +1,162 @@ +{ + "data": { + "id": "ember-data-5.3.0-SnapshotRecordArray", + "type": "class", + "attributes": { + "name": "SnapshotRecordArray", + "shortname": "SnapshotRecordArray", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/legacy-compat", + "namespace": "", + "file": "../legacy-compat/src/legacy-network-handler/snapshot-record-array.ts", + "line": 12, + "description": "

SnapshotRecordArray is not directly instantiable.\nInstances are provided to consuming application's\nadapters for certain requests.

\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "../packages/legacy-compat/src/legacy-network-handler/snapshot-record-array.ts", + "line": 29, + "description": "

SnapshotRecordArray is not directly instantiable.\nInstances are provided to consuming application's\nadapters and serializers for certain requests.

\n", + "itemtype": "method", + "name": "constructor", + "access": "private", + "tagname": "", + "is_constructor": 1, + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "" + } + ], + "class": "SnapshotRecordArray", + "module": "@ember-data/legacy-compat" + }, + { + "file": "../packages/legacy-compat/src/legacy-network-handler/snapshot-record-array.ts", + "line": 141, + "description": "

Get snapshots of the underlying record array

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import JSONAPIAdapter from '@ember-data/adapter/json-api';\n\nexport default class PostAdapter extends JSONAPIAdapter {\n  shouldReloadAll(store, snapshotArray) {\n    let snapshots = snapshotArray.snapshots();\n\n    return snapshots.any(function(ticketSnapshot) {\n      let timeDiff = moment().diff(ticketSnapshot.attr('lastAccessedAt'), 'minutes');\n      if (timeDiff > 20) {\n        return true;\n      } else {\n        return false;\n      }\n    });\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "snapshots", + "access": "public", + "tagname": "", + "return": { + "description": "Array of snapshots", + "type": "Array" + }, + "class": "SnapshotRecordArray", + "module": "@ember-data/legacy-compat" + } + ], + "events": [], + "properties": [ + { + "file": "../packages/legacy-compat/src/legacy-network-handler/snapshot-record-array.ts", + "line": 43, + "description": "

An array of snapshots

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_snapshots", + "type": "{Array}", + "class": "SnapshotRecordArray", + "module": "@ember-data/legacy-compat" + }, + { + "file": "../packages/legacy-compat/src/legacy-network-handler/snapshot-record-array.ts", + "line": 51, + "description": "

The modelName of the underlying records for the snapshots in the array, as a Model

\n", + "itemtype": "property", + "name": "modelName", + "access": "public", + "tagname": "", + "type": "{Model}", + "class": "SnapshotRecordArray", + "module": "@ember-data/legacy-compat" + }, + { + "file": "../packages/legacy-compat/src/legacy-network-handler/snapshot-record-array.ts", + "line": 59, + "description": "

A hash of adapter options passed into the store method for this request.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import MyCustomAdapter from './custom-adapter';\n\nexport default class PostAdapter extends MyCustomAdapter {\n  findAll(store, type, sinceToken, snapshotRecordArray) {\n    if (snapshotRecordArray.adapterOptions.subscribe) {\n      // ...\n    }\n    // ...\n  }\n}
\n
\n
\n \n", + "itemtype": "property", + "name": "adapterOptions", + "access": "public", + "tagname": "", + "type": "{Object}", + "class": "SnapshotRecordArray", + "module": "@ember-data/legacy-compat" + }, + { + "file": "../packages/legacy-compat/src/legacy-network-handler/snapshot-record-array.ts", + "line": 83, + "description": "

The relationships to include for this request.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Adapter from '@ember-data/adapter';\n\nexport default class ApplicationAdapter extends Adapter {\n  findAll(store, type, snapshotRecordArray) {\n    let url = `/${type.modelName}?include=${encodeURIComponent(snapshotRecordArray.include)}`;\n\n    return fetch(url).then((response) => response.json())\n  }\n}
\n
\n
\n \n", + "itemtype": "property", + "name": "include", + "access": "public", + "tagname": "", + "type": "{String|Array}", + "class": "SnapshotRecordArray", + "module": "@ember-data/legacy-compat" + }, + { + "file": "../packages/legacy-compat/src/legacy-network-handler/snapshot-record-array.ts", + "line": 107, + "description": "

An array of records

\n", + "itemtype": "property", + "name": "_recordArray", + "access": "private", + "tagname": "", + "type": "{Array}", + "class": "SnapshotRecordArray", + "module": "@ember-data/legacy-compat" + }, + { + "file": "../packages/legacy-compat/src/legacy-network-handler/snapshot-record-array.ts", + "line": 118, + "description": "

Number of records in the array

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/post.js
1\n2\n3\n4\n5\n6\n7\n
import JSONAPIAdapter from '@ember-data/adapter/json-api';\n\nexport default class PostAdapter extends JSONAPIAdapter {\n  shouldReloadAll(store, snapshotRecordArray) {\n    return !snapshotRecordArray.length;\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "length", + "access": "public", + "tagname": "", + "type": "{Number}", + "class": "SnapshotRecordArray", + "module": "@ember-data/legacy-compat" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/legacy-compat", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-StableRecordIdentifier.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-StableRecordIdentifier.json new file mode 100644 index 000000000..767d3c90e --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-StableRecordIdentifier.json @@ -0,0 +1,82 @@ +{ + "data": { + "id": "ember-data-5.3.0-StableRecordIdentifier", + "type": "class", + "attributes": { + "name": "StableRecordIdentifier", + "shortname": "StableRecordIdentifier", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/store", + "namespace": "", + "file": "../../ember-data-types/q/identifier.ts", + "line": 91, + "description": "

A referentially stable object with a unique string (lid) that can be used\nas a reference to data in the cache.

\n

Every record instance has a unique identifier, and identifiers may refer\nto data that has never been loaded (for instance, in an async relationship).

\n", + "access": "public", + "tagname": "", + "methods": [], + "events": [], + "properties": [ + { + "file": "../ember-data-types/q/identifier.ts", + "line": 102, + "description": "

A string representing a unique identity.

\n", + "itemtype": "property", + "name": "lid", + "type": "String", + "access": "public", + "tagname": "", + "class": "StableRecordIdentifier", + "module": "@ember-data/store" + }, + { + "file": "../ember-data-types/q/identifier.ts", + "line": 108, + "description": "

the primary resource type or modelName this identity belongs to.

\n", + "itemtype": "property", + "name": "type", + "type": "String", + "access": "public", + "tagname": "", + "class": "StableRecordIdentifier", + "module": "@ember-data/store" + }, + { + "file": "../ember-data-types/q/identifier.ts", + "line": 114, + "description": "

the primary id for the record this identity belongs to. null\nif not yet assigned an id.

\n", + "itemtype": "property", + "name": "id", + "type": "String | null", + "access": "public", + "tagname": "", + "class": "StableRecordIdentifier", + "module": "@ember-data/store" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/store", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-Store.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-Store.json new file mode 100644 index 000000000..0f30dd5a2 --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-Store.json @@ -0,0 +1,756 @@ +{ + "data": { + "id": "ember-data-5.3.0-Store", + "type": "class", + "attributes": { + "name": "Store", + "shortname": "Store", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/store", + "namespace": "", + "file": "../store/src/-private/store-service.ts", + "line": 71, + "description": "

A Store coordinates interaction between your application, a Cache,\nand sources of data (such as your API or a local persistence layer)\naccessed via a RequestManager.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/services/store.js
1\n2\n3\n
import Store from '@ember-data/store';\n\nexport default class extends Store {}
\n
\n
\n \n

Most Ember applications will only have a single Store configured as a Service\nin this manner. However, setting up multiple stores is possible, including using\neach as a unique service.

\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 235, + "itemtype": "method", + "name": "init", + "access": "private", + "tagname": "", + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 309, + "description": "

Retrieve the RequestStateService instance\nassociated with this Store.

\n

This can be used to query the status of requests\nthat have been initiated for a given identifier.

\n", + "itemtype": "method", + "name": "getRequestStateService", + "return": { + "description": "", + "type": "RequestStateService" + }, + "access": "public", + "tagname": "", + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 341, + "description": "

Issue a request via the configured RequestManager,\ninserting the response into the cache and handing\nback a Future which resolves to a ResponseDocument

\n

Resource data is always updated in the cache.

\n

Only GET requests have the request result and document\ncached by default when a cache key is present.

\n

The cache key used is requestConfig.cacheOptions.key\nif present, falling back to requestconfig.url.

\n

Params are not serialized as part of the cache-key, so\neither ensure they are already in the url or utilize\nrequestConfig.cacheOptions.key. For queries issued\nvia the POST method requestConfig.cacheOptions.key\nMUST be supplied for the document to be cached.

\n", + "itemtype": "method", + "name": "request", + "params": [ + { + "name": "requestConfig", + "description": "", + "type": "StoreRequestInput" + } + ], + "return": { + "description": "", + "type": "Future" + }, + "access": "public", + "tagname": "", + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 428, + "description": "

A hook which an app or addon may implement. Called when\nthe Store is attempting to create a Record Instance for\na resource.

\n

This hook can be used to select or instantiate any desired\nmechanism of presentating cache data to the ui for access\nmutation, and interaction.

\n", + "itemtype": "method", + "name": "instantiateRecord (hook)", + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "createRecordArgs", + "description": "" + }, + { + "name": "recordDataFor", + "description": "deprecated use this.cache" + }, + { + "name": "notificationManager", + "description": "deprecated use this.notifications" + } + ], + "return": { + "description": "A record instance" + }, + "access": "public", + "tagname": "", + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 446, + "description": "

A hook which an app or addon may implement. Called when\nthe Store is destroying a Record Instance. This hook should\nbe used to teardown any custom record instances instantiated\nwith instantiateRecord.

\n", + "itemtype": "method", + "name": "teardownRecord (hook)", + "access": "public", + "tagname": "", + "params": [ + { + "name": "record", + "description": "" + } + ], + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 457, + "description": "

Provides access to the SchemaDefinitionService instance\nfor this Store instance.

\n

The SchemaDefinitionService can be used to query for\ninformation about the schema of a resource.

\n", + "itemtype": "method", + "name": "getSchemaDefinitionService", + "access": "public", + "tagname": "", + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 472, + "description": "

DEPRECATED - Use registerSchema instead.

\n

Allows an app to register a custom SchemaService\nfor use when information about a resource's schema needs\nto be queried.

\n

This method can only be called more than once, but only one schema\ndefinition service may exist. Therefore if you wish to chain services\nyou must lookup the existing service and close over it with the new\nservice by accessing store.schema prior to registration.

\n

For Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n
import Store from '@ember-data/store';\n\nclass SchemaDelegator {\n  constructor(schema) {\n    this._schema = schema;\n  }\n\n  doesTypeExist(type: string): boolean {\n    if (AbstractSchemas.has(type)) {\n      return true;\n    }\n    return this._schema.doesTypeExist(type);\n  }\n\n  attributesDefinitionFor(identifier: RecordIdentifier | { type: string }): AttributesSchema {\n    return this._schema.attributesDefinitionFor(identifier);\n  }\n\n  relationshipsDefinitionFor(identifier: RecordIdentifier | { type: string }): RelationshipsSchema {\n    const schema = AbstractSchemas.get(identifier.type);\n    return schema || this._schema.relationshipsDefinitionFor(identifier);\n  }\n}\n\nexport default class extends Store {\n  constructor(...args) {\n    super(...args);\n\n    const schema = this.schema;\n    this.registerSchemaDefinitionService(new SchemaDelegator(schema));\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "registerSchemaDefinitionService", + "params": [ + { + "name": "schema", + "description": "", + "type": "SchemaService" + } + ], + "deprecated": true, + "access": "public", + "tagname": "", + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 529, + "description": "

Allows an app to register a custom SchemaService\nfor use when information about a resource's schema needs\nto be queried.

\n

This method can only be called more than once, but only one schema\ndefinition service may exist. Therefore if you wish to chain services\nyou must lookup the existing service and close over it with the new\nservice by accessing store.schema prior to registration.

\n

For Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n
import Store from '@ember-data/store';\n\nclass SchemaDelegator {\n  constructor(schema) {\n    this._schema = schema;\n  }\n\n  doesTypeExist(type: string): boolean {\n    if (AbstractSchemas.has(type)) {\n      return true;\n    }\n    return this._schema.doesTypeExist(type);\n  }\n\n  attributesDefinitionFor(identifier: RecordIdentifier | { type: string }): AttributesSchema {\n    return this._schema.attributesDefinitionFor(identifier);\n  }\n\n  relationshipsDefinitionFor(identifier: RecordIdentifier | { type: string }): RelationshipsSchema {\n    const schema = AbstractSchemas.get(identifier.type);\n    return schema || this._schema.relationshipsDefinitionFor(identifier);\n  }\n}\n\nexport default class extends Store {\n  constructor(...args) {\n    super(...args);\n\n    const schema = this.schema;\n    this.registerSchema(new SchemaDelegator(schema));\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "registerSchema", + "params": [ + { + "name": "schema", + "description": "", + "type": "SchemaService" + } + ], + "access": "public", + "tagname": "", + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 584, + "description": "

Returns the schema for a particular modelName.

\n

When used with Model from @ember-data/model the return is the model class,\nbut this is not guaranteed.

\n

If looking to query attribute or relationship information it is\nrecommended to use getSchemaDefinitionService instead. This method\nshould be considered legacy and exists primarily to continue to support\nAdapter/Serializer APIs which expect it's return value in their method\nsignatures.

\n

The class of a model might be useful if you want to get a list of all the\nrelationship names of the model, see\nrelationshipNames\nfor example.

\n", + "itemtype": "method", + "name": "modelFor", + "access": "public", + "tagname": "", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "ModelSchema" + }, + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 621, + "description": "

Create a new record in the current store. The properties passed\nto this method are set on the newly created record.

\n

To create a new instance of a Post:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
store.createRecord('post', {\n  title: 'Ember is awesome!'\n});
\n
\n
\n \n

To create a new instance of a Post that has a relationship with a User record:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let user = this.store.peekRecord('user', 1);\nstore.createRecord('post', {\n  title: 'Ember is awesome!',\n  user: user\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "createRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelName", + "description": "", + "type": "String" + }, + { + "name": "inputProperties", + "description": "a hash of properties to set on the\n newly created record.", + "type": "Object" + } + ], + "return": { + "description": "record", + "type": "Model" + }, + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 709, + "description": "

For symmetry, a record can be deleted via the store.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let post = store.createRecord('post', {\n  title: 'Ember is awesome!'\n});\n\nstore.deleteRecord(post);
\n
\n
\n \n", + "itemtype": "method", + "name": "deleteRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "record", + "description": "", + "type": "Model" + } + ], + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 743, + "description": "

For symmetry, a record can be unloaded via the store.\nThis will cause the record to be destroyed and freed up for garbage collection.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
store.findRecord('post', 1).then(function(post) {\n  store.unloadRecord(post);\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "unloadRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "record", + "description": "", + "type": "Model" + } + ], + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 769, + "description": "

This method returns a record for a given identifier or type and id combination.

\n

The findRecord method will always resolve its promise with the same\nobject for a given identifier or type and id.

\n

The findRecord method will always return a promise that will be\nresolved with the record.

\n

Example 1

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n2\n3\n4\n5\n6\n7\n
import Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n  model({ post_id }) {\n    return this.store.findRecord('post', post_id);\n  }\n}
\n
\n
\n \n

Example 2

\n

findRecord can be called with a single identifier argument instead of the combination\nof type (modelName) and id as separate arguments. You may recognize this combo as\nthe typical pairing from JSON:API

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n2\n3\n4\n5\n6\n7\n
import Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n  model({ post_id: id }) {\n    return this.store.findRecord({ type: 'post', id });\n  }\n}
\n
\n
\n \n

Example 3

\n

If you have previously received an lid via an Identifier for this record, and the record\nhas already been assigned an id, you can find the record again using just the lid.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n
store.findRecord({ lid });
\n
\n
\n \n

If the record is not yet available, the store will ask the adapter's findRecord\nmethod to retrieve and supply the necessary data. If the record is already present\nin the store, it depends on the reload behavior when the returned promise\nresolves.

\n

Preloading

\n

You can optionally preload specific attributes and relationships that you know of\nby passing them via the passed options.

\n

For example, if your Ember route looks like /posts/1/comments/2 and your API route\nfor the comment also looks like /posts/1/comments/2 if you want to fetch the comment\nwithout also fetching the post you can pass in the post to the findRecord call:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
comments.js
1\n2\n3\n4\n5\n6\n7\n
import Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n  model({ post_id, comment_id: id }) {\n    return this.store.findRecord({ type: 'comment', id, { preload: { post: post_id }} });\n  }\n}
\n
\n
\n \n

In your adapter you can then access this id without triggering a network request via the\nsnapshot:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import EmberObject from '@ember/object';\n\nexport default class Adapter extends EmberObject {\n\n  findRecord(store, schema, id, snapshot) {\n    let type = schema.modelName;\n\n    if (type === 'comment')\n      let postId = snapshot.belongsTo('post', { id: true });\n\n      return fetch(`./posts/${postId}/comments/${id}`)\n        .then(response => response.json())\n    }\n  }\n}
\n
\n
\n \n

This could also be achieved by supplying the post id to the adapter via the adapterOptions\nproperty on the options hash.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
comments.js
1\n2\n3\n4\n5\n6\n7\n
import Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n  model({ post_id, comment_id: id }) {\n    return this.store.findRecord({ type: 'comment', id, { adapterOptions: { post: post_id }} });\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import EmberObject from '@ember/object';\n\nexport default class Adapter extends EmberObject {\n\n  findRecord(store, schema, id, snapshot) {\n    let type = schema.modelName;\n\n    if (type === 'comment')\n      let postId = snapshot.adapterOptions.post;\n\n      return fetch(`./posts/${postId}/comments/${id}`)\n        .then(response => response.json())\n    }\n  }\n}
\n
\n
\n \n

If you have access to the post model you can also pass the model itself to preload:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let post = await store.findRecord('post', 1);\nlet comment = await store.findRecord('comment', 2, { post: myPostModel });
\n
\n
\n \n

Reloading

\n

The reload behavior is configured either via the passed options hash or\nthe result of the adapter's shouldReloadRecord.

\n

If { reload: true } is passed or adapter.shouldReloadRecord evaluates\nto true, then the returned promise resolves once the adapter returns\ndata, regardless if the requested record is already in the store:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
store.push({\n  data: {\n    id: 1,\n    type: 'post',\n    revision: 1\n  }\n});\n\n// adapter#findRecord resolves with\n// [\n//   {\n//     id: 1,\n//     type: 'post',\n//     revision: 2\n//   }\n// ]\nstore.findRecord('post', 1, { reload: true }).then(function(post) {\n  post.revision; // 2\n});
\n
\n
\n \n

If no reload is indicated via the above mentioned ways, then the promise\nimmediately resolves with the cached version in the store.

\n

Background Reloading

\n

Optionally, if adapter.shouldBackgroundReloadRecord evaluates to true,\nthen a background reload is started, which updates the records' data, once\nit is available:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n
// app/adapters/post.js\nimport ApplicationAdapter from "./application";\n\nexport default class PostAdapter extends ApplicationAdapter {\n  shouldReloadRecord(store, snapshot) {\n    return false;\n  },\n\n  shouldBackgroundReloadRecord(store, snapshot) {\n    return true;\n  }\n});\n\n// ...\n\nstore.push({\n  data: {\n    id: 1,\n    type: 'post',\n    revision: 1\n  }\n});\n\nlet blogPost = store.findRecord('post', 1).then(function(post) {\n  post.revision; // 1\n});\n\n// later, once adapter#findRecord resolved with\n// [\n//   {\n//     id: 1,\n//     type: 'post',\n//     revision: 2\n//   }\n// ]\n\nblogPost.revision; // 2
\n
\n
\n \n

If you would like to force or prevent background reloading, you can set a\nboolean value for backgroundReload in the options object for\nfindRecord.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post/edit.js
1\n2\n3\n4\n5\n6\n7\n
import Route from '@ember/routing/route';\n\nexport default class PostEditRoute extends Route {\n  model(params) {\n    return this.store.findRecord('post', params.post_id, { backgroundReload: false });\n  }\n}
\n
\n
\n \n

If you pass an object on the adapterOptions property of the options\nargument it will be passed to your adapter via the snapshot

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post/edit.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class PostEditRoute extends Route {\n  model(params) {\n    return this.store.findRecord('post', params.post_id, {\n      adapterOptions: { subscribe: false }\n    });\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import MyCustomAdapter from './custom-adapter';\n\nexport default class PostAdapter extends MyCustomAdapter {\n  findRecord(store, type, id, snapshot) {\n    if (snapshot.adapterOptions.subscribe) {\n      // ...\n    }\n    // ...\n  }\n}
\n
\n
\n \n

See peekRecord to get the cached version of a record.

\n\n

If you use an adapter such as Ember's default\nJSONAPIAdapter\nthat supports the JSON API specification and if your server\nendpoint supports the use of an\n'include' query parameter,\nyou can use findRecord() or findAll() to automatically retrieve additional records related to\nthe one you request by supplying an include parameter in the options object.

\n

For example, given a post model that has a hasMany relationship with a comment\nmodel, when we retrieve a specific post we can have the server also return that post's\ncomments in the same request:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n2\n3\n4\n5\n6\n7\n
import Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n  model(params) {\n    return this.store.findRecord('post', params.post_id, { include: 'comments' });\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import EmberObject from '@ember/object';\n\nexport default class Adapter extends EmberObject {\n\n  findRecord(store, schema, id, snapshot) {\n    let type = schema.modelName;\n\n    if (type === 'post')\n      let includes = snapshot.adapterOptions.include;\n\n      return fetch(`./posts/${postId}?include=${includes}`)\n        .then(response => response.json())\n    }\n  }\n}
\n
\n
\n \n

In this case, the post's comments would then be available in your template as\nmodel.comments.

\n

Multiple relationships can be requested using an include parameter consisting of a\ncomma-separated list (without white-space) while nested relationships can be specified\nusing a dot-separated sequence of relationship names. So to request both the post's\ncomments and the authors of those comments the request would look like this:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n2\n3\n4\n5\n6\n7\n
import Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n  model(params) {\n    return this.store.findRecord('post', params.post_id, { include: 'comments,comments.author' });\n  }\n}
\n
\n
\n \n

Retrieving Specific Fields by Type

\n

If your server endpoint supports the use of a 'fields' query parameter,\nyou can use pass those fields through to your server. At this point in time, this requires a few manual steps on your part.

\n
    \n
  1. Implement buildQuery in your adapter.
  2. \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
buildQuery(snapshot) {\n  let query = super.buildQuery(...arguments);\n\n  let { fields } = snapshot.adapterOptions;\n\n  if (fields) {\n    query.fields = fields;\n  }\n\n  return query;\n}
\n
\n
\n \n
    \n
  1. Then pass through the applicable fields to your findRecord request.
  2. \n
\n

Given a post model with attributes body, title, publishDate and meta, you can retrieve a filtered list of attributes.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n2\n3\n4\n5\n6\n
import Route from '@ember/routing/route';\nexport default Route.extend({\n  model(params) {\n    return this.store.findRecord('post', params.post_id, { adapterOptions: { fields: { post: 'body,title' } });\n  }\n});
\n
\n
\n \n

Moreover, you can filter attributes on related models as well. If a post has a belongsTo relationship to a user,\njust include the relationship key and attributes.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n2\n3\n4\n5\n6\n
import Route from '@ember/routing/route';\nexport default Route.extend({\n  model(params) {\n    return this.store.findRecord('post', params.post_id, { adapterOptions: { fields: { post: 'body,title', user: 'name,email' } });\n  }\n});
\n
\n
\n \n", + "since": "1.13.0", + "itemtype": "method", + "name": "findRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelName", + "description": "- either a string representing the modelName or a ResourceIdentifier object containing both the type (a string) and the id (a string) for the record or an lid (a string) of an existing record", + "type": "String|object" + }, + { + "name": "id", + "description": "- optional object with options for the request only if the first param is a ResourceIdentifier, else the string id of the record to be retrieved", + "type": "(String|Integer|Object)" + }, + { + "name": "options", + "description": "- if the first param is a string this will be the optional options for the request. See examples for available options.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 1192, + "description": "

Get the reference for the specified record.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n
let userRef = store.getReference('user', 1);\n\n// check if the user is loaded\nlet isLoaded = userRef.value() !== null;\n\n// get the record of the reference (null if not yet available)\nlet user = userRef.value();\n\n// get the identifier of the reference\nif (userRef.remoteType() === 'id') {\nlet id = userRef.id();\n}\n\n// load user (via store.find)\nuserRef.load().then(...)\n\n// or trigger a reload\nuserRef.reload().then(...)\n\n// provide data for reference\nuserRef.push({ id: 1, username: '@user' }).then(function(user) {\n  userRef.value() === user;\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "getReference", + "access": "public", + "tagname": "", + "params": [ + { + "name": "resource", + "description": "- modelName (string) or Identifier (object)", + "type": "String|object" + }, + { + "name": "id", + "description": "", + "type": "String|Integer" + } + ], + "since": "2.5.0", + "return": { + "description": "", + "type": "RecordReference" + }, + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 1255, + "description": "

Get a record by a given type and ID without triggering a fetch.

\n

This method will synchronously return the record if it is available in the store,\notherwise it will return null. A record is available if it has been fetched earlier, or\npushed manually into the store.

\n

See findRecord if you would like to request this record from the backend.

\n

Note: This is a synchronous method and does not return a promise.

\n

Example 1

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
let post = store.peekRecord('post', 1);\n\npost.id; // 1
\n
\n
\n \n

peekRecord can be called with a single identifier argument instead of the combination\nof type (modelName) and id as separate arguments. You may recognize this combo as\nthe typical pairing from JSON:API

\n

Example 2

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let post = store.peekRecord({ type: 'post', id });\npost.id; // 1
\n
\n
\n \n

If you have previously received an lid from an Identifier for this record, you can lookup the record again using\njust the lid.

\n

Example 3

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let post = store.peekRecord({ lid });\npost.id; // 1
\n
\n
\n \n", + "since": "1.13.0", + "itemtype": "method", + "name": "peekRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelName", + "description": "- either a string representing the modelName or a ResourceIdentifier object containing both the type (a string) and the id (a string) for the record or an lid (a string) of an existing record", + "type": "String|object" + }, + { + "name": "id", + "description": "- optional only if the first param is a ResourceIdentifier, else the string id of the record to be retrieved.", + "type": "String|Integer" + } + ], + "return": { + "description": "record", + "type": "Model|null" + }, + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 1335, + "description": "

This method delegates a query to the adapter. This is the one place where\nadapter-level semantics are exposed to the application.

\n

Each time this method is called a new request is made through the adapter.

\n

Exposing queries this way seems preferable to creating an abstract query\nlanguage for all server-side queries, and then require all adapters to\nimplement them.

\n
\n

If you do something like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
store.query('person', { page: 1 });
\n
\n
\n \n

The request made to the server will look something like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
GET "/api/v1/person?page=1"
\n
\n
\n
\n

If you do something like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
store.query('person', { ids: [1, 2, 3] });
\n
\n
\n \n

The request made to the server will look something like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
GET "/api/v1/person?ids%5B%5D=1&ids%5B%5D=2&ids%5B%5D=3"\ndecoded: "/api/v1/person?ids[]=1&ids[]=2&ids[]=3"
\n
\n
\n

This method returns a promise, which is resolved with a\nCollection\nonce the server returns.

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "query", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelName", + "description": "", + "type": "String" + }, + { + "name": "query", + "description": "an opaque query to be used by the adapter", + "type": "Any" + }, + { + "name": "options", + "description": "optional, may include `adapterOptions` hash which will be passed to adapter.query", + "type": "Object" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 1414, + "description": "

This method makes a request for one record, where the id is not known\nbeforehand (if the id is known, use findRecord\ninstead).

\n

This method can be used when it is certain that the server will return a\nsingle object for the primary data.

\n

Each time this method is called a new request is made through the adapter.

\n

Let's assume our API provides an endpoint for the currently logged in user\nvia:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
// GET /api/current_user\n{\n  user: {\n    id: 1234,\n    username: 'admin'\n  }\n}
\n
\n
\n

Since the specific id of the user is not known beforehand, we can use\nqueryRecord to get the user:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
store.queryRecord('user', {}).then(function(user) {\n  let username = user.username;\n  // do thing\n});
\n
\n
\n \n

The request is made through the adapters' queryRecord:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/user.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Adapter from '@ember-data/adapter';\nimport $ from 'jquery';\n\nexport default class UserAdapter extends Adapter {\n  queryRecord(modelName, query) {\n    return $.getJSON('/api/current_user');\n  }\n}
\n
\n
\n \n

Note: the primary use case for store.queryRecord is when a single record\nis queried and the id is not known beforehand. In all other cases\nstore.query and using the first item of the array is likely the preferred\nway:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
// GET /users?username=unique\n{\n  data: [{\n    id: 1234,\n    type: 'user',\n    attributes: {\n      username: "unique"\n    }\n  }]\n}
\n
\n
\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
store.query('user', { username: 'unique' }).then(function(users) {\n  return users.firstObject;\n}).then(function(user) {\n  let id = user.id;\n});
\n
\n
\n \n

This method returns a promise, which resolves with the found record.

\n

If the adapter returns no data for the primary data of the payload, then\nqueryRecord resolves with null:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
// GET /users?username=unique\n{\n  data: null\n}
\n
\n
\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
store.queryRecord('user', { username: 'unique' }).then(function(user) {\n   // user is null\n});
\n
\n
\n \n", + "since": "1.13.0", + "itemtype": "method", + "name": "queryRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelName", + "description": "", + "type": "String" + }, + { + "name": "query", + "description": "an opaque query to be used by the adapter", + "type": "Any" + }, + { + "name": "options", + "description": "optional, may include `adapterOptions` hash which will be passed to adapter.queryRecord", + "type": "Object" + } + ], + "return": { + "description": "promise which resolves with the found record or `null`", + "type": "Promise" + }, + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 1536, + "description": "

findAll asks the adapter's findAll method to find the records for the\ngiven type, and returns a promise which will resolve with all records of\nthis type present in the store, even if the adapter only returns a subset\nof them.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/authors.js
1\n2\n3\n4\n5\n6\n7\n
import Route from '@ember/routing/route';\n\nexport default class AuthorsRoute extends Route {\n  model(params) {\n    return this.store.findAll('author');\n  }\n}
\n
\n
\n \n

When the returned promise resolves depends on the reload behavior,\nconfigured via the passed options hash and the result of the adapter's\nshouldReloadAll method.

\n

Reloading

\n

If { reload: true } is passed or adapter.shouldReloadAll evaluates to\ntrue, then the returned promise resolves once the adapter returns data,\nregardless if there are already records in the store:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
store.push({\n  data: {\n    id: 'first',\n    type: 'author'\n  }\n});\n\n// adapter#findAll resolves with\n// [\n//   {\n//     id: 'second',\n//     type: 'author'\n//   }\n// ]\nstore.findAll('author', { reload: true }).then(function(authors) {\n  authors.getEach('id'); // ['first', 'second']\n});
\n
\n
\n \n

If no reload is indicated via the above mentioned ways, then the promise\nimmediately resolves with all the records currently loaded in the store.

\n

Background Reloading

\n

Optionally, if adapter.shouldBackgroundReloadAll evaluates to true,\nthen a background reload is started. Once this resolves, the array with\nwhich the promise resolves, is updated automatically so it contains all the\nrecords in the store:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n
import Adapter from '@ember-data/adapter';\n\nexport default class ApplicationAdapter extends Adapter {\n  shouldReloadAll(store, snapshotsArray) {\n    return false;\n  },\n\n  shouldBackgroundReloadAll(store, snapshotsArray) {\n    return true;\n  }\n});\n\n// ...\n\nstore.push({\n  data: {\n    id: 'first',\n    type: 'author'\n  }\n});\n\nlet allAuthors;\nstore.findAll('author').then(function(authors) {\n  authors.getEach('id'); // ['first']\n\n  allAuthors = authors;\n});\n\n// later, once adapter#findAll resolved with\n// [\n//   {\n//     id: 'second',\n//     type: 'author'\n//   }\n// ]\n\nallAuthors.getEach('id'); // ['first', 'second']
\n
\n
\n \n

If you would like to force or prevent background reloading, you can set a\nboolean value for backgroundReload in the options object for\nfindAll.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post/edit.js
1\n2\n3\n4\n5\n6\n7\n
import Route from '@ember/routing/route';\n\nexport default class PostEditRoute extends Route {\n  model() {\n    return this.store.findAll('post', { backgroundReload: false });\n  }\n}
\n
\n
\n \n

If you pass an object on the adapterOptions property of the options\nargument it will be passed to you adapter via the snapshotRecordArray

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/posts.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class PostsRoute extends Route {\n  model(params) {\n    return this.store.findAll('post', {\n      adapterOptions: { subscribe: false }\n    });\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import MyCustomAdapter from './custom-adapter';\n\nexport default class UserAdapter extends MyCustomAdapter {\n  findAll(store, type, sinceToken, snapshotRecordArray) {\n    if (snapshotRecordArray.adapterOptions.subscribe) {\n      // ...\n    }\n    // ...\n  }\n}
\n
\n
\n \n

See peekAll to get an array of current records in the\nstore, without waiting until a reload is finished.

\n\n

If you use an adapter such as Ember's default\nJSONAPIAdapter\nthat supports the JSON API specification and if your server\nendpoint supports the use of an\n'include' query parameter,\nyou can use findAll() to automatically retrieve additional records related to\nthose requested by supplying an include parameter in the options object.

\n

For example, given a post model that has a hasMany relationship with a comment\nmodel, when we retrieve all of the post records we can have the server also return\nall of the posts' comments in the same request:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/posts.js
1\n2\n3\n4\n5\n6\n7\n
import Route from '@ember/routing/route';\n\nexport default class PostsRoute extends Route {\n  model() {\n    return this.store.findAll('post', { include: 'comments' });\n  }\n}
\n
\n
\n \n

Multiple relationships can be requested using an include parameter consisting of a\ncomma-separated list (without white-space) while nested relationships can be specified\nusing a dot-separated sequence of relationship names. So to request both the posts'\ncomments and the authors of those comments the request would look like this:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/posts.js
1\n2\n3\n4\n5\n6\n7\n
import Route from '@ember/routing/route';\n\nexport default class PostsRoute extends Route {\n  model() {\n    return this.store.findAll('post', { include: 'comments,comments.author' });\n  }\n}
\n
\n
\n \n

See query to only get a subset of records from the server.

\n", + "since": "1.13.0", + "itemtype": "method", + "name": "findAll", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 1746, + "description": "

This method returns a filtered array that contains all of the\nknown records for a given type in the store.

\n

Note that because it's just a filter, the result will contain any\nlocally created records of the type, however, it will not make a\nrequest to the backend to retrieve additional records. If you\nwould like to request all the records from the backend please use\nstore.findAll.

\n

Also note that multiple calls to peekAll for a given type will always\nreturn the same RecordArray.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
let localPosts = store.peekAll('post');
\n
\n
\n \n", + "since": "1.13.0", + "itemtype": "method", + "name": "peekAll", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "RecordArray" + }, + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 1785, + "description": "

This method unloads all records in the store.\nIt schedules unloading to happen during the next run loop.

\n

Optionally you can pass a type which unload all records for a given type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
store.unloadAll();\nstore.unloadAll('post');
\n
\n
\n \n", + "itemtype": "method", + "name": "unloadAll", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelName", + "description": "", + "type": "String" + } + ], + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 1827, + "itemtype": "method", + "description": "

Push some data for a given type into the store.

\n

This method expects normalized JSON API document. This means you have to follow JSON API specification with few minor adjustments:

\n
    \n
  • record's type should always be in singular, dasherized form
  • \n
  • members (properties) should be camelCased
  • \n
\n

Your primary data should be wrapped inside data property:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
store.push({\n  data: {\n    // primary data for single record of type `Person`\n    id: '1',\n    type: 'person',\n    attributes: {\n      firstName: 'Daniel',\n      lastName: 'Kmak'\n    }\n  }\n});
\n
\n
\n \n

Demo.

\n

data property can also hold an array (of records):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
store.push({\n  data: [\n    // an array of records\n    {\n      id: '1',\n      type: 'person',\n      attributes: {\n        firstName: 'Daniel',\n        lastName: 'Kmak'\n      }\n    },\n    {\n      id: '2',\n      type: 'person',\n      attributes: {\n        firstName: 'Tom',\n        lastName: 'Dale'\n      }\n    }\n  ]\n});
\n
\n
\n \n

Demo.

\n

There are some typical properties for JSONAPI payload:

\n
    \n
  • id - mandatory, unique record's key
  • \n
  • type - mandatory string which matches model's dasherized name in singular form
  • \n
  • attributes - object which holds data for record attributes - attr's declared in model
  • \n
  • relationships - object which must contain any of the following properties under each relationships' respective key (example path is relationships.achievements.data):
      \n
    • links
    • \n
    • data - place for primary data
    • \n
    • meta - object which contains meta-information about relationship
    • \n
    \n
  • \n
\n

For this model:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/models/person.js
1\n2\n3\n4\n5\n6\n
import Model, { attr, hasMany } from '@ember-data/model';\n\nexport default class PersonRoute extends Route {\n  @attr('string') lastName;\n  @hasmany('person') children;\n}
\n
\n
\n \n

To represent the children as IDs:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n
{\n  data: {\n    id: '1',\n    type: 'person',\n    attributes: {\n      firstName: 'Tom',\n      lastName: 'Dale'\n    },\n    relationships: {\n      children: {\n        data: [\n          {\n            id: '2',\n            type: 'person'\n          },\n          {\n            id: '3',\n            type: 'person'\n          },\n          {\n            id: '4',\n            type: 'person'\n          }\n        ]\n      }\n    }\n  }\n}
\n
\n
\n \n

Demo.

\n

To represent the children relationship as a URL:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
{\n  data: {\n    id: '1',\n    type: 'person',\n    attributes: {\n      firstName: 'Tom',\n      lastName: 'Dale'\n    },\n    relationships: {\n      children: {\n        links: {\n          related: '/people/1/children'\n        }\n      }\n    }\n  }\n}
\n
\n
\n \n

If you're streaming data or implementing an adapter, make sure\nthat you have converted the incoming data into this form. The\nstore's normalize method is a convenience\nhelper for converting a json payload into the form Ember Data\nexpects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
store.push(store.normalize('person', data));
\n
\n
\n \n

This method can be used both to push in brand new\nrecords, as well as to update existing records.

\n", + "name": "push", + "access": "public", + "tagname": "", + "params": [ + { + "name": "data", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "the record(s) that was created or\n updated." + }, + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 1999, + "description": "

Push some data in the form of a json-api document into the store,\nwithout creating materialized records.

\n", + "itemtype": "method", + "name": "_push", + "access": "private", + "tagname": "", + "params": [ + { + "name": "jsonApiDoc", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "identifiers for the primary records that had data loaded", + "type": "StableRecordIdentifier|Array|null" + }, + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 2039, + "description": "

Push some raw data into the store.

\n

This method can be used both to push in brand new\nrecords, as well as to update existing records. You\ncan push in more than one type of object at once.\nAll objects should be in the format expected by the\nserializer.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/application.js
1\n2\n3\n
import RESTSerializer from '@ember-data/serializer/rest';\n\nexport default class ApplicationSerializer extends RESTSerializer;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
let pushData = {\n  posts: [\n    { id: 1, postTitle: "Great post", commentIds: [2] }\n  ],\n  comments: [\n    { id: 2, commentBody: "Insightful comment" }\n  ]\n}\n\nstore.pushPayload(pushData);
\n
\n
\n \n

By default, the data will be deserialized using a default\nserializer (the application serializer if it exists).

\n

Alternatively, pushPayload will accept a model type which\nwill determine which serializer will process the payload.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/application.js
1\n2\n3\n
import RESTSerializer from '@ember-data/serializer/rest';\n\n export default class ApplicationSerializer extends RESTSerializer;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/post.js
1\n2\n3\n
import JSONSerializer from '@ember-data/serializer/json';\n\nexport default JSONSerializer;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
store.pushPayload(pushData); // Will use the application serializer\nstore.pushPayload('post', pushData); // Will use the post serializer
\n
\n
\n \n", + "itemtype": "method", + "name": "pushPayload", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelName", + "description": "Optionally, a model type used to determine which serializer will be used", + "type": "String" + }, + { + "name": "inputPayload", + "description": "", + "type": "Object" + } + ], + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 2112, + "description": "

Trigger a save for a Record.

\n", + "itemtype": "method", + "name": "saveRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "record", + "description": "", + "type": "RecordInstance" + }, + { + "name": "options", + "description": "" + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 2169, + "description": "

Instantiation hook allowing applications or addons to configure the store\nto utilize a custom Cache implementation.

\n

This hook should not be called directly by consuming applications or libraries.\nUse Store.cache to access the Cache instance.

\n", + "itemtype": "method", + "name": "createCache (hook)", + "access": "public", + "tagname": "", + "params": [ + { + "name": "storeWrapper", + "description": "" + } + ], + "return": { + "description": "", + "type": "Cache" + }, + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 2200, + "description": "

normalize converts a json payload into the normalized form that\npush expects.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
socket.on('message', function(message) {\n  let modelName = message.model;\n  let data = message.data;\n  store.push(store.normalize(modelName, data));\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "normalize", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelName", + "description": "The name of the model type for this payload", + "type": "String" + }, + { + "name": "payload", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "The normalized payload", + "type": "Object" + }, + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 2240, + "description": "

Returns an instance of the adapter for a given type. For\nexample, adapterFor('person') will return an instance of\nthe adapter located at app/adapters/person.js

\n

If no person adapter is found, this method will look\nfor an application adapter (the default adapter for\nyour entire application).

\n", + "itemtype": "method", + "name": "adapterFor", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "Adapter" + }, + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 2298, + "description": "

Returns an instance of the serializer for a given type. For\nexample, serializerFor('person') will return an instance of\nApp.PersonSerializer.

\n

If no App.PersonSerializer is found, this method will look\nfor an App.ApplicationSerializer (the default serializer for\nyour entire application).

\n

If a serializer cannot be found on the adapter, it will fall back\nto an instance of JSONSerializer.

\n", + "itemtype": "method", + "name": "serializerFor", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelName", + "description": "the record to serialize", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Serializer" + }, + "class": "Store", + "module": "@ember-data/store" + } + ], + "events": [], + "properties": [ + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 105, + "description": "

Provides access to the NotificationManager associated\nwith this Store instance.

\n

The NotificationManager can be used to subscribe to\nchanges to the cache.

\n", + "itemtype": "property", + "name": "notifications", + "type": "NotificationManager", + "access": "public", + "tagname": "", + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 117, + "description": "

Provides access to the SchemaService instance\nfor this Store instance.

\n

The SchemaService can be used to query for\ninformation about the schema of a resource.

\n", + "itemtype": "property", + "name": "schema", + "type": "SchemaService", + "access": "public", + "tagname": "", + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 132, + "description": "

Provides access to the IdentifierCache instance\nfor this store.

\n

The IdentifierCache can be used to generate or\nretrieve a stable unique identifier for any resource.

\n", + "itemtype": "property", + "name": "identifierCache", + "type": "IdentifierCache", + "access": "public", + "tagname": "", + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 143, + "description": "

Provides access to the requestManager instance associated\nwith this Store instance.

\n

When using ember-data this property is automatically\nset to an instance of RequestManager. When not using ember-data\nyou must configure this property yourself, either by declaring\nit as a service or by initializing it.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Store, { CacheHandler } from '@ember-data/store';\nimport RequestManager from '@ember-data/request';\nimport Fetch from '@ember/data/request/fetch';\n\nclass extends Store {\n  constructor() {\n    super(...arguments);\n    this.requestManager = new RequestManager();\n    this.requestManager.use([Fetch]);\n    this.requestManager.useCache(CacheHandler);\n  }\n}
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "property", + "name": "requestManager", + "type": "RequestManager", + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 172, + "description": "

A Property which an App may set to provide a Lifetimes Service\nto control when a cached request becomes stale.

\n

Note, when defined, these methods will only be invoked if a\ncache key exists for the request, either because the request\ncontains cacheOptions.key or because the IdentifierCache\nwas able to generate a key for the request using the configured\ngeneration method.

\n

isSoftExpired will only be invoked if isHardExpired returns false.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
store.lifetimes = {\n  // make the request and ignore the current cache state\n  isHardExpired(identifier: StableDocumentIdentifier): boolean {\n    return false;\n  }\n\n  // make the request in the background if true, return cache state\n  isSoftExpired(identifier: StableDocumentIdentifier): boolean {\n    return false;\n  }\n}
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "property", + "name": "lifetimes", + "type": "LivetimesService|undefined", + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 2182, + "description": "

Returns the cache instance associated to this Store, instantiates the Cache\nif necessary via Store.createCache

\n", + "itemtype": "property", + "name": "cache", + "type": "Cache", + "access": "public", + "tagname": "", + "class": "Store", + "module": "@ember-data/store" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/store", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-StringTransform.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-StringTransform.json new file mode 100644 index 000000000..6de6e581f --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-StringTransform.json @@ -0,0 +1,45 @@ +{ + "data": { + "id": "ember-data-5.3.0-StringTransform", + "type": "class", + "attributes": { + "name": "StringTransform", + "shortname": "StringTransform", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/serializer", + "namespace": "", + "file": "../serializer/src/-private/transforms/string.js", + "line": 5, + "access": "public", + "description": "

The StringTransform class is used to serialize and deserialize\nstring attributes on Ember Data record objects. This transform is\nused when string is passed as the type parameter to the\nattr function.

\n

Usage

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/models/user.js
1\n2\n3\n4\n5\n
import Model, { attr, belongsTo } from '@ember-data/model';\n\nexport default class UserModel extends Model {\n  @attr('string') email;\n}
\n
\n
\n \n", + "tagname": "", + "methods": [], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/serializer", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-TimeoutError.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-TimeoutError.json new file mode 100644 index 000000000..cb09850f8 --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-TimeoutError.json @@ -0,0 +1,49 @@ +{ + "data": { + "id": "ember-data-5.3.0-TimeoutError", + "type": "class", + "attributes": { + "name": "TimeoutError", + "shortname": "TimeoutError", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/adapter/error", + "namespace": "", + "file": "../adapter/src/error.js", + "line": 183, + "access": "public", + "description": "

A TimeoutError is used by an adapter to signal that a request\nto the external API has timed out. I.e. no response was received from\nthe external API within an allowed time period.

\n

An example use case would be to warn the user to check their internet\nconnection if an adapter operation has timed out:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Route from '@ember/routing/route';\nimport { TimeoutError } from '@ember-data/adapter/error';\nimport { action } from '@ember/object';\n\nexport default class ApplicationRoute extends Route {\n  @action error(error, transition) {\n    if (error instanceof TimeoutError) {\n      // alert the user\n      alert('Are you still connected to the Internet?');\n      return;\n    }\n\n    // ...other error handling logic\n  }\n}
\n
\n
\n \n", + "tagname": "", + "extends": "AdapterError", + "methods": [], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-data-5.3.0-AdapterError", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/adapter/error", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-Transform.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-Transform.json new file mode 100644 index 000000000..01b58f4fe --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-Transform.json @@ -0,0 +1,94 @@ +{ + "data": { + "id": "ember-data-5.3.0-Transform", + "type": "class", + "attributes": { + "name": "Transform", + "shortname": "Transform", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/serializer", + "namespace": "", + "file": "../serializer/src/-private/transforms/transform.js", + "line": 5, + "access": "public", + "description": "

The Transform class is used to serialize and deserialize model\nattributes when they are saved or loaded from an\nadapter. Subclassing Transform is useful for creating custom\nattributes. All subclasses of Transform must implement a\nserialize and a deserialize method.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/transforms/temperature.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
// Converts centigrade in the JSON to fahrenheit in the app\nexport default class TemperatureTransform {\n  deserialize(serialized, options) {\n    return (serialized *  1.8) + 32;\n  }\n\n  serialize(deserialized, options) {\n    return (deserialized - 32) / 1.8;\n  }\n\n  static create() {\n    return new this();\n  }\n}
\n
\n
\n \n

Usage

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/models/requirement.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Model, { attr } from '@ember-data/model';\n\nexport default class RequirementModel extends Model {\n  @attr('markdown', {\n    markdown: {\n      gfm: false,\n      sanitize: true\n    }\n  })\n  markdown;\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/transforms/markdown.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
export default class MarkdownTransform {\n  serialize(deserialized, options) {\n    return deserialized.raw;\n  }\n\n  deserialize(serialized, options) {\n    let markdownOptions = options.markdown || {};\n\n    return marked(serialized, markdownOptions);\n  }\n\n  static create() {\n    return new this();\n  }\n}
\n
\n
\n \n", + "tagname": "", + "methods": [ + { + "file": "../packages/serializer/src/-private/transforms/transform.js", + "line": 82, + "description": "

When given a deserialized value from a record attribute this\nmethod must return the serialized value.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
serialize(deserialized, options) {\n  return deserialized ? null : Number(deserialized);\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "serialize", + "access": "public", + "tagname": "", + "params": [ + { + "name": "deserialized", + "description": "The deserialized value" + }, + { + "name": "options", + "description": "hash of options passed to `attr`" + } + ], + "return": { + "description": "The serialized value" + }, + "class": "Transform", + "module": "@ember-data/serializer" + }, + { + "file": "../packages/serializer/src/-private/transforms/transform.js", + "line": 100, + "description": "

When given a serialized value from a JSON object this method must\nreturn the deserialized value for the record attribute.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
deserialize(serialized, options) {\n  return empty(serialized) ? null : Number(serialized);\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "deserialize", + "access": "public", + "tagname": "", + "params": [ + { + "name": "serialized", + "description": "The serialized value" + }, + { + "name": "options", + "description": "hash of options passed to `attr`" + } + ], + "return": { + "description": "The deserialized value" + }, + "class": "Transform", + "module": "@ember-data/serializer" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/serializer", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-UnauthorizedError.json b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-UnauthorizedError.json new file mode 100644 index 000000000..271336f3e --- /dev/null +++ b/json-docs/ember-data/5.3.0/classes/ember-data-5.3.0-UnauthorizedError.json @@ -0,0 +1,49 @@ +{ + "data": { + "id": "ember-data-5.3.0-UnauthorizedError", + "type": "class", + "attributes": { + "name": "UnauthorizedError", + "shortname": "UnauthorizedError", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/adapter/error", + "namespace": "", + "file": "../adapter/src/error.js", + "line": 230, + "access": "public", + "description": "

A UnauthorizedError equates to a HTTP 401 Unauthorized response\nstatus. It is used by an adapter to signal that a request to the external\nAPI was rejected because authorization is required and has failed or has not\nyet been provided.

\n

An example use case would be to redirect the user to a login route if a\nrequest is unauthorized:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Route from '@ember/routing/route';\nimport { UnauthorizedError } from '@ember-data/adapter/error';\nimport { action } from '@ember/object';\n\nexport default class ApplicationRoute extends Route {\n  @action error(error, transition) {\n    if (error instanceof UnauthorizedError) {\n      // go to the login route\n      this.transitionTo('login');\n      return;\n    }\n\n    // ...other error handling logic\n  }\n}
\n
\n
\n \n", + "tagname": "", + "extends": "AdapterError", + "methods": [], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-data-5.3.0-AdapterError", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-data-5.3.0-@ember-data/adapter/error", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/missings/DataAdapter.json b/json-docs/ember-data/5.3.0/missings/DataAdapter.json new file mode 100644 index 000000000..b350f7009 --- /dev/null +++ b/json-docs/ember-data/5.3.0/missings/DataAdapter.json @@ -0,0 +1,9 @@ +{ + "data": { + "id": "DataAdapter", + "type": "missing", + "attributes": { + "name": "DataAdapter" + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/missings/Ember.ArrayProxy.json b/json-docs/ember-data/5.3.0/missings/Ember.ArrayProxy.json new file mode 100644 index 000000000..24d60179e --- /dev/null +++ b/json-docs/ember-data/5.3.0/missings/Ember.ArrayProxy.json @@ -0,0 +1,9 @@ +{ + "data": { + "id": "Ember.ArrayProxy", + "type": "missing", + "attributes": { + "name": "Ember.ArrayProxy" + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/missings/Ember.EmberObject.json b/json-docs/ember-data/5.3.0/missings/Ember.EmberObject.json new file mode 100644 index 000000000..6c6b54047 --- /dev/null +++ b/json-docs/ember-data/5.3.0/missings/Ember.EmberObject.json @@ -0,0 +1,9 @@ +{ + "data": { + "id": "Ember.EmberObject", + "type": "missing", + "attributes": { + "name": "Ember.EmberObject" + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/missings/Promise.json b/json-docs/ember-data/5.3.0/missings/Promise.json new file mode 100644 index 000000000..fd2d61585 --- /dev/null +++ b/json-docs/ember-data/5.3.0/missings/Promise.json @@ -0,0 +1,9 @@ +{ + "data": { + "id": "Promise", + "type": "missing", + "attributes": { + "name": "Promise" + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/missings/PromiseObject.json b/json-docs/ember-data/5.3.0/missings/PromiseObject.json new file mode 100644 index 000000000..211e1cf61 --- /dev/null +++ b/json-docs/ember-data/5.3.0/missings/PromiseObject.json @@ -0,0 +1,9 @@ +{ + "data": { + "id": "PromiseObject", + "type": "missing", + "attributes": { + "name": "PromiseObject" + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/missings/Reference.json b/json-docs/ember-data/5.3.0/missings/Reference.json new file mode 100644 index 000000000..5b519c15e --- /dev/null +++ b/json-docs/ember-data/5.3.0/missings/Reference.json @@ -0,0 +1,9 @@ +{ + "data": { + "id": "Reference", + "type": "missing", + "attributes": { + "name": "Reference" + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/active-record/request.json b/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/active-record/request.json new file mode 100644 index 000000000..7eb79faff --- /dev/null +++ b/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/active-record/request.json @@ -0,0 +1,271 @@ +{ + "data": { + "id": "ember-data-5.3.0-@ember-data/active-record/request", + "type": "module", + "attributes": { + "name": "@ember-data/active-record/request", + "submodules": {}, + "elements": {}, + "fors": { + "@ember-data/active-record/request": 1 + }, + "namespaces": {}, + "tag": "main", + "file": "../active-record/src/request.ts", + "line": 1, + "description": "

\n \"EmberData\"\n

\n\n

This package provides utilities for working with ActiveRecord APIs with Ember**Data**.

\n

Installation

\n

Install using your javascript package manager of choice. For instance with pnpm

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
pnpm add @ember-data/active-record
\n
\n
\n \n

Usage

\n

Request builders are functions that produce Fetch Options.\nThey take a few contextual inputs about the request you want to make, abstracting away the gnarlier details.

\n

For instance, to fetch a resource from your API

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import { findRecord } from '@ember-data/active-record/request';\n\nconst options = findRecord('ember-developer', '1', { include: ['pets', 'friends'] });\n\n/\\*\n => {\n   url: 'https://api.example.com/v1/ember_developers/1?include=friends,pets',\n   method: 'GET',\n   headers: <Headers>, // 'Content-Type': 'application/json; charset=utf-8'\n   op: 'findRecord';\n   records: [{ type: 'ember-developer', id: '1' }]\n }\n\\/
\n
\n
\n \n

Request builder output may be used with either requestManager.request or store.request.

\n

URLs are stable. The same query will produce the same URL every time, even if the order of keys in\nthe query or values in an array changes.

\n

URLs follow the most common ActiveRecord format (underscored pluralized resource types).

\n

Available Builders

\n\n", + "itemtype": "main", + "parent": null, + "publicclasses": [], + "privateclasses": [], + "staticfunctions": { + "@ember-data/active-record/request": [ + { + "file": "../packages/active-record/src/-private/builders/save-record.ts", + "line": 107, + "description": "Builds request options to create new record for resources,\nconfigured for the url, method and header expectations of most ActiveRecord APIs.\n\n**Basic Usage**\n\n```ts\nimport { createRecord } from '@ember-data/active-record/request';\n\nconst person = this.store.createRecord('person', { name: 'Ted' });\nconst data = await store.request(createRecord(person));\n```\n\n**Supplying Options to Modify the Request Behavior**\n\nThe following options are supported:\n\n- `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.\n- `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.\n- `resourcePath` - The resource path to use for the request, defaults to pluralizing the supplied type\n- `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to `false` if none is configured.\n- `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to `false` if none is configured.\n- `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)\n\n```ts\nimport { createRecord } from '@ember-data/active-record/request';\n\nconst person = this.store.createRecord('person', { name: 'Ted' });\nconst options = createRecord(person, { namespace: 'api/v1' });\nconst data = await store.request(options);\n```", + "itemtype": "method", + "name": "createRecord", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "record", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/active-record/request", + "module": "@ember-data/active-record/request" + }, + { + "file": "../packages/active-record/src/-private/builders/save-record.ts", + "line": 27, + "description": "Builds request options to delete record for resources,\nconfigured for the url, method and header expectations of ActiveRecord APIs.\n\n**Basic Usage**\n\n```ts\nimport { deleteRecord } from '@ember-data/active-record/request';\n\nconst person = this.store.peekRecord('person', '1');\n\n// mark record as deleted\nstore.deleteRecord(person);\n\n// persist deletion\nconst data = await store.request(deleteRecord(person));\n```\n\n**Supplying Options to Modify the Request Behavior**\n\nThe following options are supported:\n\n- `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.\n- `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.\n- `resourcePath` - The resource path to use for the request, defaults to pluralizing the supplied type\n- `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to `false` if none is configured.\n- `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to `false` if none is configured.\n- `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)\n\n```ts\nimport { deleteRecord } from '@ember-data/active-record/request';\n\nconst person = this.store.peekRecord('person', '1');\n\n// mark record as deleted\nstore.deleteRecord(person);\n\n// persist deletion\nconst options = deleteRecord(person, { namespace: 'api/v1' });\nconst data = await store.request(options);\n```", + "itemtype": "method", + "name": "deleteRecord", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "record", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/active-record/request", + "module": "@ember-data/active-record/request" + }, + { + "file": "../packages/active-record/src/-private/builders/find-record.ts", + "line": 21, + "description": "Builds request options to fetch a single resource by a known id or identifier\nconfigured for the url and header expectations of most ActiveRecord APIs.\n\n**Basic Usage**\n\n```ts\nimport { findRecord } from '@ember-data/active-record/request';\n\nconst data = await store.request(findRecord('person', '1'));\n```\n\n**With Options**\n\n```ts\nimport { findRecord } from '@ember-data/active-record/request';\n\nconst options = findRecord('person', '1', { include: ['pets', 'friends'] });\nconst data = await store.request(options);\n```\n\n**With an Identifier**\n\n```ts\nimport { findRecord } from '@ember-data/active-record/request';\n\nconst options = findRecord({ type: 'person', id: '1' }, { include: ['pets', 'friends'] });\nconst data = await store.request(options);\n```\n\n**Supplying Options to Modify the Request Behavior**\n\nThe following options are supported:\n\n- `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.\n- `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.\n- `resourcePath` - The resource path to use for the request, defaults to pluralizing and underscoring the supplied type\n- `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to `false` if none is configured.\n- `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to `false` if none is configured.\n- `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)\n\n```ts\nimport { findRecord } from '@ember-data/active-record/request';\n\nconst options = findRecord('person', '1', { include: ['pets', 'friends'] }, { namespace: 'api/v2' });\nconst data = await store.request(options);\n```", + "itemtype": "method", + "name": "findRecord", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/active-record/request", + "module": "@ember-data/active-record/request" + }, + { + "file": "../packages/active-record/src/-private/builders/query.ts", + "line": 13, + "description": "Builds request options to query for resources, usually by a primary\ntype, configured for the url and header expectations of most ActiveRecord APIs.\n\n**Basic Usage**\n\n```ts\nimport { query } from '@ember-data/active-record/request';\n\nconst data = await store.request(query('person'));\n```\n\n**With Query Params**\n\n```ts\nimport { query } from '@ember-data/active-record/request';\n\nconst options = query('person', { include: ['pets', 'friends'] });\nconst data = await store.request(options);\n```\n\n**Supplying Options to Modify the Request Behavior**\n\nThe following options are supported:\n\n- `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.\n- `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.\n- `resourcePath` - The resource path to use for the request, defaults to pluralizing and underscoring the supplied type\n- `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to `false` if none is configured.\n- `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to `false` if none is configured.\n- `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)\n\n```ts\nimport { query } from '@ember-data/active-record/request';\n\nconst options = query('person', { include: ['pets', 'friends'] }, { reload: true });\nconst data = await store.request(options);\n```", + "itemtype": "method", + "name": "query", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "query", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/active-record/request", + "module": "@ember-data/active-record/request" + }, + { + "file": "../packages/active-record/src/-private/builders/save-record.ts", + "line": 176, + "description": "Builds request options to update existing record for resources,\nconfigured for the url, method and header expectations of most ActiveRecord APIs.\n\n**Basic Usage**\n\n```ts\nimport { updateRecord } from '@ember-data/active-record/request';\n\nconst person = this.store.peekRecord('person', '1');\nperson.name = 'Chris';\nconst data = await store.request(updateRecord(person));\n```\n\n**Supplying Options to Modify the Request Behavior**\n\nThe following options are supported:\n\n- `patch` - Allows caller to specify whether to use a PATCH request instead of a PUT request, defaults to `false`.\n- `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.\n- `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.\n- `resourcePath` - The resource path to use for the request, defaults to pluralizing the supplied type\n- `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to `false` if none is configured.\n- `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to `false` if none is configured.\n- `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)\n\n```ts\nimport { updateRecord } from '@ember-data/active-record/request';\n\nconst person = this.store.peekRecord('person', '1');\nperson.name = 'Chris';\nconst options = updateRecord(person, { patch: true });\nconst data = await store.request(options);\n```", + "itemtype": "method", + "name": "updateRecord", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "record", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/active-record/request", + "module": "@ember-data/active-record/request" + } + ] + }, + "allstaticfunctions": { + "@ember-data/active-record/request": [ + { + "file": "../packages/active-record/src/-private/builders/save-record.ts", + "line": 107, + "description": "Builds request options to create new record for resources,\nconfigured for the url, method and header expectations of most ActiveRecord APIs.\n\n**Basic Usage**\n\n```ts\nimport { createRecord } from '@ember-data/active-record/request';\n\nconst person = this.store.createRecord('person', { name: 'Ted' });\nconst data = await store.request(createRecord(person));\n```\n\n**Supplying Options to Modify the Request Behavior**\n\nThe following options are supported:\n\n- `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.\n- `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.\n- `resourcePath` - The resource path to use for the request, defaults to pluralizing the supplied type\n- `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to `false` if none is configured.\n- `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to `false` if none is configured.\n- `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)\n\n```ts\nimport { createRecord } from '@ember-data/active-record/request';\n\nconst person = this.store.createRecord('person', { name: 'Ted' });\nconst options = createRecord(person, { namespace: 'api/v1' });\nconst data = await store.request(options);\n```", + "itemtype": "method", + "name": "createRecord", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "record", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/active-record/request", + "module": "@ember-data/active-record/request" + }, + { + "file": "../packages/active-record/src/-private/builders/save-record.ts", + "line": 27, + "description": "Builds request options to delete record for resources,\nconfigured for the url, method and header expectations of ActiveRecord APIs.\n\n**Basic Usage**\n\n```ts\nimport { deleteRecord } from '@ember-data/active-record/request';\n\nconst person = this.store.peekRecord('person', '1');\n\n// mark record as deleted\nstore.deleteRecord(person);\n\n// persist deletion\nconst data = await store.request(deleteRecord(person));\n```\n\n**Supplying Options to Modify the Request Behavior**\n\nThe following options are supported:\n\n- `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.\n- `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.\n- `resourcePath` - The resource path to use for the request, defaults to pluralizing the supplied type\n- `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to `false` if none is configured.\n- `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to `false` if none is configured.\n- `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)\n\n```ts\nimport { deleteRecord } from '@ember-data/active-record/request';\n\nconst person = this.store.peekRecord('person', '1');\n\n// mark record as deleted\nstore.deleteRecord(person);\n\n// persist deletion\nconst options = deleteRecord(person, { namespace: 'api/v1' });\nconst data = await store.request(options);\n```", + "itemtype": "method", + "name": "deleteRecord", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "record", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/active-record/request", + "module": "@ember-data/active-record/request" + }, + { + "file": "../packages/active-record/src/-private/builders/find-record.ts", + "line": 21, + "description": "Builds request options to fetch a single resource by a known id or identifier\nconfigured for the url and header expectations of most ActiveRecord APIs.\n\n**Basic Usage**\n\n```ts\nimport { findRecord } from '@ember-data/active-record/request';\n\nconst data = await store.request(findRecord('person', '1'));\n```\n\n**With Options**\n\n```ts\nimport { findRecord } from '@ember-data/active-record/request';\n\nconst options = findRecord('person', '1', { include: ['pets', 'friends'] });\nconst data = await store.request(options);\n```\n\n**With an Identifier**\n\n```ts\nimport { findRecord } from '@ember-data/active-record/request';\n\nconst options = findRecord({ type: 'person', id: '1' }, { include: ['pets', 'friends'] });\nconst data = await store.request(options);\n```\n\n**Supplying Options to Modify the Request Behavior**\n\nThe following options are supported:\n\n- `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.\n- `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.\n- `resourcePath` - The resource path to use for the request, defaults to pluralizing and underscoring the supplied type\n- `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to `false` if none is configured.\n- `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to `false` if none is configured.\n- `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)\n\n```ts\nimport { findRecord } from '@ember-data/active-record/request';\n\nconst options = findRecord('person', '1', { include: ['pets', 'friends'] }, { namespace: 'api/v2' });\nconst data = await store.request(options);\n```", + "itemtype": "method", + "name": "findRecord", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/active-record/request", + "module": "@ember-data/active-record/request" + }, + { + "file": "../packages/active-record/src/-private/builders/query.ts", + "line": 13, + "description": "Builds request options to query for resources, usually by a primary\ntype, configured for the url and header expectations of most ActiveRecord APIs.\n\n**Basic Usage**\n\n```ts\nimport { query } from '@ember-data/active-record/request';\n\nconst data = await store.request(query('person'));\n```\n\n**With Query Params**\n\n```ts\nimport { query } from '@ember-data/active-record/request';\n\nconst options = query('person', { include: ['pets', 'friends'] });\nconst data = await store.request(options);\n```\n\n**Supplying Options to Modify the Request Behavior**\n\nThe following options are supported:\n\n- `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.\n- `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.\n- `resourcePath` - The resource path to use for the request, defaults to pluralizing and underscoring the supplied type\n- `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to `false` if none is configured.\n- `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to `false` if none is configured.\n- `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)\n\n```ts\nimport { query } from '@ember-data/active-record/request';\n\nconst options = query('person', { include: ['pets', 'friends'] }, { reload: true });\nconst data = await store.request(options);\n```", + "itemtype": "method", + "name": "query", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "query", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/active-record/request", + "module": "@ember-data/active-record/request" + }, + { + "file": "../packages/active-record/src/-private/builders/save-record.ts", + "line": 176, + "description": "Builds request options to update existing record for resources,\nconfigured for the url, method and header expectations of most ActiveRecord APIs.\n\n**Basic Usage**\n\n```ts\nimport { updateRecord } from '@ember-data/active-record/request';\n\nconst person = this.store.peekRecord('person', '1');\nperson.name = 'Chris';\nconst data = await store.request(updateRecord(person));\n```\n\n**Supplying Options to Modify the Request Behavior**\n\nThe following options are supported:\n\n- `patch` - Allows caller to specify whether to use a PATCH request instead of a PUT request, defaults to `false`.\n- `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.\n- `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.\n- `resourcePath` - The resource path to use for the request, defaults to pluralizing the supplied type\n- `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to `false` if none is configured.\n- `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to `false` if none is configured.\n- `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)\n\n```ts\nimport { updateRecord } from '@ember-data/active-record/request';\n\nconst person = this.store.peekRecord('person', '1');\nperson.name = 'Chris';\nconst options = updateRecord(person, { patch: true });\nconst data = await store.request(options);\n```", + "itemtype": "method", + "name": "updateRecord", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "record", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/active-record/request", + "module": "@ember-data/active-record/request" + } + ] + }, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/adapter.json b/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/adapter.json new file mode 100644 index 000000000..bf30d97e3 --- /dev/null +++ b/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/adapter.json @@ -0,0 +1,38 @@ +{ + "data": { + "id": "ember-data-5.3.0-@ember-data/adapter", + "type": "module", + "attributes": { + "name": "@ember-data/adapter", + "submodules": {}, + "elements": {}, + "fors": {}, + "namespaces": {}, + "tag": "main", + "file": "../adapter/src/index.ts", + "line": 197, + "description": "

Overview

\n
\n

\n ⚠️ This is LEGACY documentation for a feature that is no longer encouraged to be used.\n If starting a new app or thinking of implementing a new adapter, consider writing a\n Handler instead to be used with the RequestManager\n

\n
\n\n

In order to properly fetch and update data, EmberData\nneeds to understand how to connect to your API.

\n

Adapters accept various kinds of requests from the store\nand manage fulfillment of the request from your API.

\n

Request Flow

\n

When the store decides it needs to issue a request it uses the\nfollowing flow to manage the request and process the data.

\n
    \n
  • find the appropriate adapter
  • \n
  • issue the request to the adapter
  • \n
  • await the adapter's response
      \n
    • if an error occurs reject with the error
    • \n
    • if no error
        \n
      • if there is response data
          \n
        • pass the response data to the appropriate serializer
        • \n
        • update the cache using the JSON:API formatted data from the serializer's response
        • \n
        \n
      • \n
      • return the primary record(s) associated with the request
      • \n
      \n
    • \n
    \n
  • \n
\n

Request Errors

\n

When a request errors and your adapter does not have the ability to recover from the error,\nyou may either reject the promise returned by your adapter method with the error or simply\nthrow the error.

\n

If the request was for a createRecord updateRecord or deleteRecord special rules\napply to how this error will affect the state of the store and additional properties on\nthe Error class may be used. See the documentation for these methods in\n Adapter for more information.

\n

Implementing an Adapter

\n

There are seven required adapter methods, one for each of\nthe primary request types that EmberData issues.

\n

They are:

\n
    \n
  • findRecord
  • \n
  • findAll
  • \n
  • queryRecord
  • \n
  • query
  • \n
  • createRecord
  • \n
  • updateRecord
  • \n
  • deleteRecord
  • \n
\n

Each of these request types has a matching store method that triggers it\nand matching requestType that is passed to the serializer's\nnormalizeResponse method.

\n

If your app only reads data but never writes data, it is not necessary\nto implement the methods for create, update, and delete. This extends to\nall of the store's find methods with the exception of findRecord (findAll,\nquery, queryRecord): if you do not use the store method in your app then\nyour Adapter does not need the method.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import EmberObject from '@ember/object';\n\nasync function fetchData(url, options = {}) {\n  let response = await fetch(url, options);\n  return response.toJSON();\n}\n\nexport default class ApplicationAdapter extends EmberObject {\n  findRecord(_, { modelName }, id) {\n    return fetchData(`./${modelName}s/${id}`);\n  }\n}
\n
\n
\n \n

Adapter Resolution

\n

store.adapterFor(name) will lookup adapters defined in app/adapters/ and\nreturn an instance.

\n

adapterFor first attempts to find an adapter with an exact match on name,\nthen falls back to checking for the presence of an adapter named application.

\n

If no adapter is found, an error will be thrown.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
store.adapterFor('author');\n\n// lookup paths (in order) =>\n//   app/adapters/author.js\n//   app/adapters/application.js
\n
\n
\n \n

Most requests in EmberData are made with respect to a particular type (or modelName)\n(e.g., "get me the full collection of books" or "get me the employee whose id is 37"). We\nrefer to this as the primary resource type.

\n

adapterFor is used by the store to find an adapter with a name matching that of the primary\nresource type for the request, which then falls back to the application adapter.

\n

It is recommended that applications define only a single application adapter and serializer\nwhere possible, only implementing an adapter specific to the type when absolutely necessary.

\n

If you need to support multiple API versions for the same type, the per-type strategy for\ndefining adapters might not be adequate.

\n

If you have multiple APIs or multiple API versions and the single application adapter and per-type\nstrategy does not suite your needs, one strategy is to write an application adapter and serializer\nthat make use of options to specify the desired format when making a request, then forwards to the\nrequest to the desired adapter or serializer as needed.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n
export default class Adapter extends EmberObject {\n  findRecord(store, schema, id, snapshot) {\n    let { apiVersion } = snapshot.adapterOptions;\n    return this.adapterFor(`-api-${apiVersion}`).findRecord(store, schema, id, snapshot);\n  }\n}
\n
\n
\n \n

Overriding Store.adapterFor

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Store from '@ember-data/store';\nimport Adapter from '@ember-data/adapter/json-api';\n\nclass extends Store {\n  #adapter = new Adapter();\n\n  adapterFor() {\n    return this.#adapter;\n  }\n}
\n
\n
\n \n

Note: If you are using Ember and would like to make use of service injections in your adapter, you will want to additionally setOwner for the Adapter.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import Store from '@ember-data/store';\nimport Adapter from '@ember-data/adapter/json-api';\nimport { getOwner, setOwner } from '@ember/application';\n\nclass extends Store {\n  #adapter = null;\n\n  adapterFor() {\n    let adapter = this.#adapter;\n    if (!adapter) {\n      const owner = getOwner(this);\n      adapter = new Adapter();\n      setOwner(adapter, owner);\n      this.#adapter = adapter;\n    }\n\n    return adapter;\n  }\n}
\n
\n
\n \n

By default when using with Ember you only need to implement this hook if you want your adapter usage to be statically analyzeable. Ember**Data** will attempt to resolve adapters using Ember's resolver. To provide a single Adapter for your application like the above you would provide it as the default export of the file app/adapters/application.{js/ts}

\n

Using an Adapter

\n

Any adapter in app/adapters/ can be looked up by name using store.adapterFor(name).

\n

Default Adapters

\n

Applications whose API's structure endpoint URLs very close to or exactly the REST\nor JSON:API convention, the @ember-data/adapter package contains implementations\nthese applications can extend.

\n

Many applications will find writing their own adapter to be allow greater flexibility,\ncustomization, and maintenance than attempting to override methods in these adapters.

\n", + "itemtype": "main", + "parent": null, + "publicclasses": [ + "BuildURLMixin", + "Adapter" + ], + "privateclasses": [], + "staticfunctions": {}, + "allstaticfunctions": {}, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/adapter/error.json b/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/adapter/error.json new file mode 100644 index 000000000..64891d7ab --- /dev/null +++ b/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/adapter/error.json @@ -0,0 +1,45 @@ +{ + "data": { + "id": "ember-data-5.3.0-@ember-data/adapter/error", + "type": "module", + "attributes": { + "name": "@ember-data/adapter/error", + "submodules": {}, + "elements": {}, + "fors": {}, + "namespaces": {}, + "tag": "main", + "file": "../adapter/src/error.js", + "line": 332, + "description": "

Overview

\n
\n

\n ⚠️ This is LEGACY documentation for a feature that is no longer encouraged to be used.\n If starting a new app or thinking of implementing a new adapter, consider writing a\n Handler instead to be used with the RequestManager\n

\n
\n\n

An AdapterError is used by an adapter to signal that an error occurred\nduring a request to an external API. It indicates a generic error, and\nsubclasses are used to indicate specific error states.

\n

To create a custom error to signal a specific error state in communicating\nwith an external API, extend the AdapterError. For example, if the\nexternal API exclusively used HTTP 503 Service Unavailable to indicate\nit was closed for maintenance:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
error.js
1\n2\n3\n
import AdapterError from '@ember-data/adapter/error';\n\nexport default AdapterError.extend({ message: "Down for maintenance." });
\n
\n
\n \n

This error would then be returned by an adapter's handleResponse method:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import JSONAPIAdapter from '@ember-data/adapter/json-api';\nimport MaintenanceError from './maintenance-error';\n\nexport default class ApplicationAdapter extends JSONAPIAdapter {\n  handleResponse(status) {\n    if (503 === status) {\n      return new MaintenanceError();\n    }\n\n    return super.handleResponse(...arguments);\n  }\n}
\n
\n
\n \n

And can then be detected in an application and used to send the user to an\nunder-maintenance route:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Route from '@ember/routing/route';\nimport MaintenanceError from '../adapters/maintenance-error';\n\nexport default class ApplicationRoute extends Route {\n  actions: {\n    error(error, transition) {\n      if (error instanceof MaintenanceError) {\n        this.transitionTo('under-maintenance');\n        return;\n      }\n\n      // ...other error handling logic\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "main", + "parent": null, + "publicclasses": [ + "AdapterError", + "InvalidError", + "TimeoutError", + "AbortError", + "UnauthorizedError", + "ForbiddenError", + "NotFoundError", + "ConflictError", + "ServerError" + ], + "privateclasses": [], + "staticfunctions": {}, + "allstaticfunctions": {}, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/adapter/json-api.json b/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/adapter/json-api.json new file mode 100644 index 000000000..fd877e016 --- /dev/null +++ b/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/adapter/json-api.json @@ -0,0 +1,38 @@ +{ + "data": { + "id": "ember-data-5.3.0-@ember-data/adapter/json-api", + "type": "module", + "attributes": { + "name": "@ember-data/adapter/json-api", + "submodules": {}, + "elements": {}, + "fors": {}, + "namespaces": {}, + "tag": "main", + "file": "../adapter/src/json-api.ts", + "line": 19, + "description": "

Overview

\n
\n

\n ⚠️ This is LEGACY documentation for a feature that is no longer encouraged to be used.\n If starting a new app or thinking of implementing a new adapter, consider writing a\n Handler instead to be used with the RequestManager\n

\n
\n\n

The JSONAPIAdapter is an adapter whichtransforms the store's\nrequests into HTTP requests that follow the JSON API format.

\n

JSON API Conventions

\n

The JSONAPIAdapter uses JSON API conventions for building the URL\nfor a record and selecting the HTTP verb to use with a request. The\nactions you can take on a record map onto the following URLs in the\nJSON API adapter:

\n\n\n \n \n \n\n\n \n \n \n\n\n \n \n \n\n\n \n \n \n\n\n \n \n \n\n\n \n \n \n\n
\n Action\n \n HTTP Verb\n \n URL\n
\n `store.findRecord('post', 123)`\n \n GET\n \n /posts/123\n
\n `store.findAll('post')`\n \n GET\n \n /posts\n
\n Update `postRecord.save()`\n \n PATCH\n \n /posts/123\n
\n Create `store.createRecord('post').save()`\n \n POST\n \n /posts\n
\n Delete `postRecord.destroyRecord()`\n \n DELETE\n \n /posts/123\n
\n\n

Success and failure

\n

The JSONAPIAdapter will consider a success any response with a\nstatus code of the 2xx family ("Success"), as well as 304 ("Not\nModified"). Any other status code will be considered a failure.

\n

On success, the request promise will be resolved with the full\nresponse payload.

\n

Failed responses with status code 422 ("Unprocessable Entity") will\nbe considered "invalid". The response will be discarded, except for\nthe errors key. The request promise will be rejected with a\nInvalidError. This error object will encapsulate the saved\nerrors value.

\n

Any other status codes will be treated as an adapter error. The\nrequest promise will be rejected, similarly to the invalid case,\nbut with an instance of AdapterError instead.

\n

Endpoint path customization

\n

Endpoint paths can be prefixed with a namespace by setting the\nnamespace property on the adapter:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n
import JSONAPIAdapter from '@ember-data/adapter/json-api';\n\nexport default class ApplicationAdapter extends JSONAPIAdapter {\n  namespace = 'api/1';\n}
\n
\n
\n \n

Requests for the person model would now target /api/1/people/1.

\n

Host customization

\n

An adapter can target other hosts by setting the host property.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n
import JSONAPIAdapter from '@ember-data/adapter/json-api';\n\nexport default class ApplicationAdapter extends JSONAPIAdapter {\n  host = 'https://api.example.com';\n}
\n
\n
\n \n

Requests for the person model would now target\nhttps://api.example.com/people/1.

\n", + "since": "1.13.0", + "itemtype": "main", + "parent": null, + "publicclasses": [ + "JSONAPIAdapter" + ], + "privateclasses": [], + "staticfunctions": {}, + "allstaticfunctions": {}, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/adapter/rest.json b/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/adapter/rest.json new file mode 100644 index 000000000..e9859f131 --- /dev/null +++ b/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/adapter/rest.json @@ -0,0 +1,39 @@ +{ + "data": { + "id": "ember-data-5.3.0-@ember-data/adapter/rest", + "type": "module", + "attributes": { + "name": "@ember-data/adapter/rest", + "submodules": {}, + "elements": {}, + "fors": { + "@ember-data/adapter/rest": 1 + }, + "namespaces": {}, + "tag": "main", + "file": "../adapter/src/rest.ts", + "line": 69, + "description": "
\n

\n ⚠️ This is LEGACY documentation for a feature that is no longer encouraged to be used.\n If starting a new app or thinking of implementing a new adapter, consider writing a\n Handler instead to be used with the RequestManager\n

\n
\n\n

The REST adapter allows your store to communicate with an HTTP server by\n transmitting JSON via XHR.

\n

This adapter is designed around the idea that the JSON exchanged with\n the server should be conventional. It builds URLs in a manner that follows\n the structure of most common REST-style web services.

\n

Success and failure

\n

The REST adapter will consider a success any response with a status code\n of the 2xx family ("Success"), as well as 304 ("Not Modified"). Any other\n status code will be considered a failure.

\n

On success, the request promise will be resolved with the full response\n payload.

\n

Failed responses with status code 422 ("Unprocessable Entity") will be\n considered "invalid". The response will be discarded, except for the\n errors key. The request promise will be rejected with a InvalidError.\n This error object will encapsulate the saved errors value.

\n

Any other status codes will be treated as an "adapter error". The request\n promise will be rejected, similarly to the "invalid" case, but with\n an instance of AdapterError instead.

\n

JSON Structure

\n

The REST adapter expects the JSON returned from your server to follow\n these conventions.

\n

Object Root

\n

The JSON payload should be an object that contains the record inside a\n root property. For example, in response to a GET request for\n /posts/1, the JSON should look like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
 {\n   "posts": {\n     "id": 1,\n     "title": "I'm Running to Reform the W3C's Tag",\n     "author": "Yehuda Katz"\n   }\n }
\n
\n
\n \n

Similarly, in response to a GET request for /posts, the JSON should\n look like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
 {\n   "posts": [\n     {\n       "id": 1,\n       "title": "I'm Running to Reform the W3C's Tag",\n       "author": "Yehuda Katz"\n     },\n     {\n       "id": 2,\n       "title": "Rails is omakase",\n       "author": "D2H"\n     }\n   ]\n }
\n
\n
\n \n

Note that the object root can be pluralized for both a single-object response\n and an array response: the REST adapter is not strict on this. Further, if the\n HTTP server responds to a GET request to /posts/1 (e.g. the response to a\n findRecord query) with more than one object in the array, Ember Data will\n only display the object with the matching ID.

\n

Conventional Names

\n

Attribute names in your JSON payload should be the camelCased versions of\n the attributes in your Ember.js models.

\n

For example, if you have a Person model:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/models/person.js
1\n2\n3\n4\n5\n6\n7\n
 import Model, { attr } from '@ember-data/model';\n\n export default Model.extend({\n   firstName: attr('string'),\n   lastName: attr('string'),\n   occupation: attr('string')\n });
\n
\n
\n \n

The JSON returned should look like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
 {\n   "people": {\n     "id": 5,\n     "firstName": "Zaphod",\n     "lastName": "Beeblebrox",\n     "occupation": "President"\n   }\n }
\n
\n
\n \n

Relationships

\n

Relationships are usually represented by ids to the record in the\n relationship. The related records can then be sideloaded in the\n response under a key for the type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
 {\n   "posts": {\n     "id": 5,\n     "title": "I'm Running to Reform the W3C's Tag",\n     "author": "Yehuda Katz",\n     "comments": [1, 2]\n   },\n   "comments": [{\n     "id": 1,\n     "author": "User 1",\n     "message": "First!",\n   }, {\n     "id": 2,\n     "author": "User 2",\n     "message": "Good Luck!",\n   }]\n }
\n
\n
\n \n

If the records in the relationship are not known when the response\n is serialized it's also possible to represent the relationship as a\n URL using the links key in the response. Ember Data will fetch\n this URL to resolve the relationship when it is accessed for the\n first time.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
 {\n   "posts": {\n     "id": 5,\n     "title": "I'm Running to Reform the W3C's Tag",\n     "author": "Yehuda Katz",\n     "links": {\n       "comments": "/posts/5/comments"\n     }\n   }\n }
\n
\n
\n \n

Errors

\n

If a response is considered a failure, the JSON payload is expected to include\n a top-level key errors, detailing any specific issues. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
 {\n   "errors": {\n     "msg": "Something went wrong"\n   }\n }
\n
\n
\n \n

This adapter does not make any assumptions as to the format of the errors\n object. It will simply be passed along as is, wrapped in an instance\n of InvalidError or AdapterError. The serializer can interpret it\n afterwards.

\n

Customization

\n

Endpoint path customization

\n

Endpoint paths can be prefixed with a namespace by setting the namespace\n property on the adapter:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n
 import RESTAdapter from '@ember-data/adapter/rest';\n\n export default class ApplicationAdapter extends RESTAdapter {\n   namespace = 'api/1';\n }
\n
\n
\n \n

Requests for the Person model would now target /api/1/people/1.

\n

Host customization

\n

An adapter can target other hosts by setting the host property.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n
 import RESTAdapter from '@ember-data/adapter/rest';\n\n export default class ApplicationAdapter extends RESTAdapter {\n   host = 'https://api.example.com';\n }
\n
\n
\n \n

Headers customization

\n

Some APIs require HTTP headers, e.g. to provide an API key. Arbitrary\n headers can be set as key/value pairs on the RESTAdapter's headers\n object and Ember Data will send them along with each ajax request.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
 import RESTAdapter from '@ember-data/adapter/rest';\n import { computed } from '@ember/object';\n\n export default class ApplicationAdapter extends RESTAdapter {\n   headers: computed(function() {\n     return {\n       'API_KEY': 'secret key',\n       'ANOTHER_HEADER': 'Some header value'\n     };\n   }\n }
\n
\n
\n \n

headers can also be used as a computed property to support dynamic\n headers. In the example below, the session object has been\n injected into an adapter by Ember's container.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
 import RESTAdapter from '@ember-data/adapter/rest';\n import { computed } from '@ember/object';\n\n export default class ApplicationAdapter extends RESTAdapter {\n   headers: computed('session.authToken', function() {\n     return {\n       'API_KEY': this.session.authToken,\n       'ANOTHER_HEADER': 'Some header value'\n     };\n   })\n }
\n
\n
\n \n

In some cases, your dynamic headers may require data from some\n object outside of Ember's observer system (for example\n document.cookie). You can use the\n volatile\n function to set the property into a non-cached mode causing the headers to\n be recomputed with every request.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/adapters/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
 import RESTAdapter from '@ember-data/adapter/rest';\n import { computed } from '@ember/object';\n\n export default class ApplicationAdapter extends RESTAdapter {\n   headers: computed(function() {\n     return {\n       'API_KEY': document.cookie.match(/apiKey\\=([^;]*)/)['1'],\n       'ANOTHER_HEADER': 'Some header value'\n     };\n   }).volatile()\n }
\n
\n
\n \n", + "itemtype": "main", + "parent": null, + "publicclasses": [ + "RESTAdapter" + ], + "privateclasses": [], + "staticfunctions": {}, + "allstaticfunctions": {}, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/canary-features.json b/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/canary-features.json new file mode 100644 index 000000000..a1eb96982 --- /dev/null +++ b/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/canary-features.json @@ -0,0 +1,37 @@ +{ + "data": { + "id": "ember-data-5.3.0-@ember-data/canary-features", + "type": "module", + "attributes": { + "name": "@ember-data/canary-features", + "submodules": {}, + "elements": {}, + "fors": {}, + "namespaces": {}, + "tag": "main", + "file": "../private-build-infra/virtual-packages/canary-features.js", + "line": 76, + "description": "

Canary Features

\n

EmberData allows users to test features that are implemented but not yet\navailable even in canary.

\n

Typically these features represent work that might introduce a new concept,\nnew API, change an API, or risk an unintended change in behavior to consuming\napplications.

\n

Such features have their implementations guarded by a "feature flag", and the\nflag is only activated once the core-data team is prepared to ship the work\nin a canary release.

\n

Installing Canary

\n

To test a feature you MUST be using a canary build. Canary builds are published\nto npm and can be installed using a precise tag (such as ember-data@3.16.0-alpha.1)\nor by installing the latest dist-tag published to the canary channel using your javascript\npackage manager of choice. For instance with pnpm

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
 pnpm add ember-data@canary
\n
\n
\n \n

Activating a Canary Feature

\n

Once you have installed canary, feature-flags can be activated at build-time

\n

by setting an environment variable:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
# Activate a single flag\nEMBER_DATA_FEATURE_OVERRIDE=SOME_FLAG ember build\n\n# Activate multiple flags by separating with commas\nEMBER_DATA_FEATURE_OVERRIDE=SOME_FLAG,OTHER_FLAG ember build\n\n# Activate all flags\nEMBER_DATA_FEATURE_OVERRIDE=ENABLE_ALL_OPTIONAL ember build
\n
\n
\n \n

or by setting the appropriate flag in your ember-cli-build file:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
let app = new EmberApp(defaults, {\n  emberData: {\n    features: {\n      SAMPLE_FEATURE_FLAG: false // utliize existing behavior, strip code for the new feature\n      OTHER_FEATURE_FLAG: true // utilize this new feature, strip code for the older behavior\n    }\n  }\n})
\n
\n
\n \n

The "off" branch of feature-flagged code is always stripped from production builds.

\n

The list of available feature-flags is located here

\n

Preparing a Project to use a Canary Feature

\n

For most projects, simple version detection should be enough.\nUsing the provided version compatibility helpers from embroider-macros\nthe following can be done:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
if (macroCondition(dependencySatisfies('@ember-data/store', '5.0'))) {\n  // do thing\n}
\n
\n
\n \n", + "itemtype": "main", + "parent": null, + "publicclasses": [ + "CanaryFeatureFlags" + ], + "privateclasses": [], + "staticfunctions": {}, + "allstaticfunctions": {}, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/debug.json b/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/debug.json new file mode 100644 index 000000000..85e7e07c8 --- /dev/null +++ b/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/debug.json @@ -0,0 +1,39 @@ +{ + "data": { + "id": "ember-data-5.3.0-@ember-data/debug", + "type": "module", + "attributes": { + "name": "@ember-data/debug", + "submodules": {}, + "elements": {}, + "fors": {}, + "namespaces": {}, + "tag": "main", + "file": "../private-build-infra/virtual-packages/debugging.js", + "line": 4, + "description": "

Overview

\n

This package provides the DataAdapter which the Ember Inspector\nuses to subscribe and retrieve information for the data tab in the inspector.

\n

This package adds roughly .6 KB when minified and compressed to your application in production; however,\nyou can opt out of shipping this addon in production via options in ember-cli-build.js

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let app = new EmberApp(defaults, {\n  emberData: {\n    includeDataAdapterInProduction: false\n  }\n});
\n
\n
\n \n

When using ember-data as a dependency of your app, the default is to ship the inspector support to production.

\n

When not using ember-data as a dependency but instead using EmberData via declaring specific @ember-data/<package>\ndependencies the default is to not ship to production.

\n", + "itemtype": "main", + "parent": null, + "publicclasses": [ + "DebugLogging" + ], + "privateclasses": [ + "InspectorDataAdapter" + ], + "staticfunctions": {}, + "allstaticfunctions": {}, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/deprecations.json b/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/deprecations.json new file mode 100644 index 000000000..359c864d2 --- /dev/null +++ b/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/deprecations.json @@ -0,0 +1,37 @@ +{ + "data": { + "id": "ember-data-5.3.0-@ember-data/deprecations", + "type": "module", + "attributes": { + "name": "@ember-data/deprecations", + "submodules": {}, + "elements": {}, + "fors": {}, + "namespaces": {}, + "tag": "main", + "file": "../private-build-infra/virtual-packages/deprecations.js", + "line": 79, + "description": "

Deprecations

\n

EmberData allows users to opt-in and remove code that exists to support deprecated\nbehaviors.

\n

If your app has resolved all deprecations present in a given version,\nyou may specify that version as your "compatibility" version to remove\nthe code that supported the deprecated behavior from your app.

\n

For instance, if a deprecation was introduced in 3.13, and the app specifies\n3.13 as its minimum version compatibility, any deprecations introduced before\nor during 3.13 would be stripped away.

\n

An app can use a different version than what it specifies as it's compatibility\nversion. For instance, an App could be using 3.16 while specifying compatibility\nwith 3.12. This would remove any deprecations that were present in or before 3.12\nbut keep support for anything deprecated in or above 3.13.

\n

Configuring Compatibility

\n

To configure your compatibility version, set the compatWith to the version you\nare compatible with on the emberData config in your ember-cli-build.js file.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let app = new EmberApp(defaults, {\n  emberData: {\n    compatWith: '3.12',\n  },\n});
\n
\n
\n \n

Alternatively, individual deprecations can be resolved (and thus have its support stripped)\nvia one of the flag names listed below. For instance, given a flag named DEPRECATE_FOO_BEHAVIOR.

\n

This capability is interopable with compatWith. You may set compatWith and then selectively resolve\nadditional deprecations, or set compatWith and selectively un-resolve specific deprecations.

\n

Note: EmberData does not test against permutations of deprecations being stripped, our tests run against\n"all deprecated code included" and "all deprecated code removed". Unspecified behavior may sometimes occur\nwhen removing code for only some deprecations associated to a version number.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
let app = new EmberApp(defaults, {\n  emberData: {\n    deprecations: {\n      DEPRECATE_FOO_BEHAVIOR: false // set to false to strip this code\n      DEPRECATE_BAR_BEHAVIOR: true // force to true to not strip this code\n    }\n  }\n})
\n
\n
\n \n

The complete list of which versions specific deprecations will be removed in\ncan be found here

\n", + "itemtype": "main", + "parent": null, + "publicclasses": [ + "CurrentDeprecations" + ], + "privateclasses": [], + "staticfunctions": {}, + "allstaticfunctions": {}, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/graph.json b/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/graph.json new file mode 100644 index 000000000..79d951440 --- /dev/null +++ b/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/graph.json @@ -0,0 +1,35 @@ +{ + "data": { + "id": "ember-data-5.3.0-@ember-data/graph", + "type": "module", + "attributes": { + "name": "@ember-data/graph", + "submodules": {}, + "elements": {}, + "fors": {}, + "namespaces": {}, + "tag": "main", + "file": "../graph/src/-private.ts", + "line": 3, + "description": "

\n \"EmberData\"\n

\n\n

Provides a performance tuned normalized graph for intelligently managing relationships between resources based on identity

\n\n

While this Graph is abstract, it currently is a private implementation required as a peer-dependency by the JSON:API Cache Implementation.

\n

We intend to make this Graph public API after some additional iteration during the 5.x timeframe, until then all APIs should be considered experimental and unstable, not fit for direct application or 3rd party library usage.

\n

Installation

\n

Install using your javascript package manager of choice. For instance with pnpm

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
pnpm add @ember-data/graph
\n
\n
\n \n", + "itemtype": "main", + "parent": null, + "publicclasses": [], + "privateclasses": [], + "staticfunctions": {}, + "allstaticfunctions": {}, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/json-api.json b/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/json-api.json new file mode 100644 index 000000000..1013018ed --- /dev/null +++ b/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/json-api.json @@ -0,0 +1,37 @@ +{ + "data": { + "id": "ember-data-5.3.0-@ember-data/json-api", + "type": "module", + "attributes": { + "name": "@ember-data/json-api", + "submodules": {}, + "elements": {}, + "fors": {}, + "namespaces": {}, + "tag": "main", + "file": "../json-api/src/-private/cache.ts", + "line": 84, + "description": "

\n \"EmberData\"\n

\n\n

This package provides an in-memory JSON:API document and resource Ember**Data** Cache implementation.

\n

Installation

\n

Install using your javascript package manager of choice. For instance with pnpm

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
pnpm add @ember-data/json-api
\n
\n
\n \n

🚀 Setup

\n
\n

Note When using ember-data the below\nconfiguration is handled for you automatically.

\n
\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import Store from '@ember-data/store';\nimport Cache from '@ember-data/json-api';\n\nexport default class extends Store {\n createCache(wrapper) {\n   return new Cache(wrapper);\n }\n}
\n
\n
\n \n

Usage

\n

Usually you will directly interact with the cache only if implementing a presentation class. Below we\ngive an example of a read-only record (mutations never written back to the cache). More typically cache\ninteractions are something that the Store coordinates as part of the request/response lifecycle.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n
import Store, { recordIdentifierFor } from '@ember-data/store';\nimport Cache from '@ember-data/json-api';\nimport { TrackedObject } from 'tracked-built-ins';\n\nclass extends Store {\n createCache(wrapper) {\n   return new Cache(wrapper);\n }\n\n instantiateRecord(identifier) {\n   const { cache, notifications } = this;\n   const { type, id } = identifier;\n\n   // create a TrackedObject with our attributes, id and type\n   const attrs = cache.peek(identifier).attributes;\n   const data = Object.assign({}, attrs, { type, id });\n   const record = new TrackedObject(data);\n\n   // update the TrackedObject whenever attributes change\n   const token = notifications.subscribe(identifier, (_, change) => {\n     if (change === 'attributes') {\n       Object.assign(record, cache.peek(identifier).attributes);\n     }\n   });\n\n   // setup the ability to teardown the subscription when the\n   // record is no longer needed\n   record.destroy = () => {\n     this.notifications.unsubscribe(token);\n   };\n\n   return record;\n }\n\n teardownRecord(record: FakeRecord) {\n   record.destroy();\n }\n}
\n
\n
\n \n

For the full list of APIs available read the code documentation for Ember**Data** Cache

\n", + "itemtype": "main", + "parent": null, + "publicclasses": [ + "Cache" + ], + "privateclasses": [], + "staticfunctions": {}, + "allstaticfunctions": {}, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/json-api/request.json b/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/json-api/request.json new file mode 100644 index 000000000..76cc9d047 --- /dev/null +++ b/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/json-api/request.json @@ -0,0 +1,383 @@ +{ + "data": { + "id": "ember-data-5.3.0-@ember-data/json-api/request", + "type": "module", + "attributes": { + "name": "@ember-data/json-api/request", + "submodules": {}, + "elements": {}, + "fors": { + "@ember-data/json-api/request": 1 + }, + "namespaces": {}, + "tag": "main", + "file": "../json-api/src/request.ts", + "line": 1, + "description": "

\n \"EmberData\"\n

\n\n

This package provides utilities for working with JSON:API APIs with Ember**Data**.

\n

Installation

\n

Install using your javascript package manager of choice. For instance with pnpm

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
pnpm add @ember-data/json-api
\n
\n
\n \n

Usage

\n

Request builders are functions that produce Fetch Options.\nThey take a few contextual inputs about the request you want to make, abstracting away the gnarlier details.

\n

For instance, to fetch a resource from your API

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import { findRecord } from '@ember-data/json-api/request';\n\nconst options = findRecord('ember-developer', '1', { include: ['pets', 'friends'] });\n\n/\\*\n => {\n   url: 'https://api.example.com/v1/ember-developers/1?include=friends,pets',\n   method: 'GET',\n   headers: <Headers>,\n     // => 'Accept': 'application/vnd.api+json'\n     // => 'Content-Type': 'application/vnd.api+json'\n   op: 'findRecord';\n   records: [{ type: 'ember-developer', id: '1' }]\n }\n\\/
\n
\n
\n \n

Request builder output may be used with either requestManager.request or store.request.

\n

URLs are stable. The same query will produce the same URL every time, even if the order of keys in\nthe query or values in an array changes.

\n

URLs follow the most common JSON:API format (dasherized pluralized resource types).

\n

Available Builders

\n\n", + "itemtype": "main", + "parent": null, + "publicclasses": [], + "privateclasses": [], + "staticfunctions": { + "@ember-data/json-api/request": [ + { + "file": "../packages/json-api/src/-private/builders/save-record.ts", + "line": 106, + "description": "Builds request options to create new record for resources,\nconfigured for the url, method and header expectations of most JSON:API APIs.\n\n**Basic Usage**\n\n```ts\nimport { createRecord } from '@ember-data/json-api/request';\n\nconst person = this.store.createRecord('person', { name: 'Ted' });\nconst data = await store.request(createRecord(person));\n```\n\n**Supplying Options to Modify the Request Behavior**\n\nThe following options are supported:\n\n- `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.\n- `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.\n- `resourcePath` - The resource path to use for the request, defaults to pluralizing the supplied type\n- `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to `false` if none is configured.\n- `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to `false` if none is configured.\n- `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)\n\n```ts\nimport { createRecord } from '@ember-data/json-api/request';\n\nconst person = this.store.createRecord('person', { name: 'Ted' });\nconst options = createRecord(person, { namespace: 'api/v1' });\nconst data = await store.request(options);\n```", + "itemtype": "method", + "name": "createRecord", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "record", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/json-api/request", + "module": "@ember-data/json-api/request" + }, + { + "file": "../packages/json-api/src/-private/builders/save-record.ts", + "line": 26, + "description": "Builds request options to delete record for resources,\nconfigured for the url, method and header expectations of most JSON:API APIs.\n\n**Basic Usage**\n\n```ts\nimport { deleteRecord } from '@ember-data/json-api/request';\n\nconst person = this.store.peekRecord('person', '1');\n\n// mark record as deleted\nstore.deleteRecord(person);\n\n// persist deletion\nconst data = await store.request(deleteRecord(person));\n```\n\n**Supplying Options to Modify the Request Behavior**\n\nThe following options are supported:\n\n- `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.\n- `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.\n- `resourcePath` - The resource path to use for the request, defaults to pluralizing the supplied type\n- `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to `false` if none is configured.\n- `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to `false` if none is configured.\n- `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)\n\n```ts\nimport { deleteRecord } from '@ember-data/json-api/request';\n\nconst person = this.store.peekRecord('person', '1');\n\n// mark record as deleted\nstore.deleteRecord(person);\n\n// persist deletion\nconst options = deleteRecord(person, { namespace: 'api/v1' });\nconst data = await store.request(options);\n```", + "itemtype": "method", + "name": "deleteRecord", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "record", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/json-api/request", + "module": "@ember-data/json-api/request" + }, + { + "file": "../packages/json-api/src/-private/builders/find-record.ts", + "line": 15, + "description": "Builds request options to fetch a single resource by a known id or identifier\nconfigured for the url and header expectations of most JSON:API APIs.\n\n**Basic Usage**\n\n```ts\nimport { findRecord } from '@ember-data/json-api/request';\n\nconst data = await store.request(findRecord('person', '1'));\n```\n\n**With Options**\n\n```ts\nimport { findRecord } from '@ember-data/json-api/request';\n\nconst options = findRecord('person', '1', { include: ['pets', 'friends'] });\nconst data = await store.request(options);\n```\n\n**With an Identifier**\n\n```ts\nimport { findRecord } from '@ember-data/json-api/request';\n\nconst options = findRecord({ type: 'person', id: '1' }, { include: ['pets', 'friends'] });\nconst data = await store.request(options);\n```\n\n**Supplying Options to Modify the Request Behavior**\n\nThe following options are supported:\n\n- `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.\n- `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.\n- `resourcePath` - The resource path to use for the request, defaults to pluralizing the supplied type\n- `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to `false` if none is configured.\n- `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to `false` if none is configured.\n- `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)\n\n```ts\nimport { findRecord } from '@ember-data/json-api/request';\n\nconst options = findRecord('person', '1', { include: ['pets', 'friends'] }, { namespace: 'api/v2' });\nconst data = await store.request(options);\n```", + "itemtype": "method", + "name": "findRecord", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/json-api/request", + "module": "@ember-data/json-api/request" + }, + { + "file": "../packages/json-api/src/-private/builders/query.ts", + "line": 11, + "description": "Builds request options to query for resources, usually by a primary\ntype, configured for the url and header expectations of most JSON:API APIs.\n\n**Basic Usage**\n\n```ts\nimport { query } from '@ember-data/json-api/request';\n\nconst data = await store.request(query('person'));\n```\n\n**With Query Params**\n\n```ts\nimport { query } from '@ember-data/json-api/request';\n\nconst options = query('person', { include: ['pets', 'friends'] });\nconst data = await store.request(options);\n```\n\n**Supplying Options to Modify the Request Behavior**\n\nThe following options are supported:\n\n- `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.\n- `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.\n- `resourcePath` - The resource path to use for the request, defaults to pluralizing the supplied type\n- `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to `false` if none is configured.\n- `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to `false` if none is configured.\n- `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)\n\n```ts\nimport { query } from '@ember-data/json-api/request';\n\nconst options = query('person', { include: ['pets', 'friends'] }, { reload: true });\nconst data = await store.request(options);\n```", + "itemtype": "method", + "name": "query", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "query", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/json-api/request", + "module": "@ember-data/json-api/request" + }, + { + "file": "../packages/json-api/src/-private/serialize.ts", + "line": 47, + "description": "Serializes changes to a resource for use with PATCH requests.\n\nOnly attributes which are changed are serialized.\nOnly relationships which are changed are serialized.\n\nCollection relationships serialize the collection as a whole.\n\nIf you would like to serialize updates to a collection more granularly\n(for instance, as operations) request the diff from the store and\nserialize as desired:\n\n```ts\nconst relationshipDiffMap = cache.changedRelationships(identifier);\n```", + "itemtype": "method", + "name": "serializePatch", + "static": 1, + "access": "public", + "tagname": "", + "params": [ + { + "name": "cache}", + "description": "", + "type": "Cache" + }, + { + "name": "identifier", + "description": "", + "type": "StableRecordIdentifier" + } + ], + "return": { + "description": "An object with a `data` property containing the serialized resource patch", + "type": "Object" + }, + "class": "@ember-data/json-api/request", + "module": "@ember-data/json-api/request" + }, + { + "file": "../packages/json-api/src/-private/serialize.ts", + "line": 10, + "description": "Serializes the current state of a resource or array of resources for use with POST or PUT requests.", + "itemtype": "method", + "name": "serializeResources", + "static": 1, + "access": "public", + "tagname": "", + "params": [ + { + "name": "cache}", + "description": "", + "type": "Cache" + }, + { + "name": "identifier", + "description": "", + "type": "StableRecordIdentifier" + } + ], + "return": { + "description": "An object with a `data` property containing the serialized resource patch", + "type": "Object" + }, + "class": "@ember-data/json-api/request", + "module": "@ember-data/json-api/request" + }, + { + "file": "../packages/json-api/src/-private/builders/save-record.ts", + "line": 175, + "description": "Builds request options to update existing record for resources,\nconfigured for the url, method and header expectations of most JSON:API APIs.\n\n**Basic Usage**\n\n```ts\nimport { updateRecord } from '@ember-data/json-api/request';\n\nconst person = this.store.peekRecord('person', '1');\nperson.name = 'Chris';\nconst data = await store.request(updateRecord(person));\n```\n\n**Supplying Options to Modify the Request Behavior**\n\nThe following options are supported:\n\n- `patch` - Allows caller to specify whether to use a PATCH request instead of a PUT request, defaults to `false`.\n- `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.\n- `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.\n- `resourcePath` - The resource path to use for the request, defaults to pluralizing the supplied type\n- `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to `false` if none is configured.\n- `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to `false` if none is configured.\n- `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)\n\n```ts\nimport { updateRecord } from '@ember-data/json-api/request';\n\nconst person = this.store.peekRecord('person', '1');\nperson.name = 'Chris';\nconst options = updateRecord(person, { patch: true });\nconst data = await store.request(options);\n```", + "itemtype": "method", + "name": "updateRecord", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "record", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/json-api/request", + "module": "@ember-data/json-api/request" + } + ] + }, + "allstaticfunctions": { + "@ember-data/json-api/request": [ + { + "file": "../packages/json-api/src/-private/builders/save-record.ts", + "line": 106, + "description": "Builds request options to create new record for resources,\nconfigured for the url, method and header expectations of most JSON:API APIs.\n\n**Basic Usage**\n\n```ts\nimport { createRecord } from '@ember-data/json-api/request';\n\nconst person = this.store.createRecord('person', { name: 'Ted' });\nconst data = await store.request(createRecord(person));\n```\n\n**Supplying Options to Modify the Request Behavior**\n\nThe following options are supported:\n\n- `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.\n- `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.\n- `resourcePath` - The resource path to use for the request, defaults to pluralizing the supplied type\n- `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to `false` if none is configured.\n- `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to `false` if none is configured.\n- `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)\n\n```ts\nimport { createRecord } from '@ember-data/json-api/request';\n\nconst person = this.store.createRecord('person', { name: 'Ted' });\nconst options = createRecord(person, { namespace: 'api/v1' });\nconst data = await store.request(options);\n```", + "itemtype": "method", + "name": "createRecord", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "record", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/json-api/request", + "module": "@ember-data/json-api/request" + }, + { + "file": "../packages/json-api/src/-private/builders/save-record.ts", + "line": 26, + "description": "Builds request options to delete record for resources,\nconfigured for the url, method and header expectations of most JSON:API APIs.\n\n**Basic Usage**\n\n```ts\nimport { deleteRecord } from '@ember-data/json-api/request';\n\nconst person = this.store.peekRecord('person', '1');\n\n// mark record as deleted\nstore.deleteRecord(person);\n\n// persist deletion\nconst data = await store.request(deleteRecord(person));\n```\n\n**Supplying Options to Modify the Request Behavior**\n\nThe following options are supported:\n\n- `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.\n- `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.\n- `resourcePath` - The resource path to use for the request, defaults to pluralizing the supplied type\n- `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to `false` if none is configured.\n- `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to `false` if none is configured.\n- `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)\n\n```ts\nimport { deleteRecord } from '@ember-data/json-api/request';\n\nconst person = this.store.peekRecord('person', '1');\n\n// mark record as deleted\nstore.deleteRecord(person);\n\n// persist deletion\nconst options = deleteRecord(person, { namespace: 'api/v1' });\nconst data = await store.request(options);\n```", + "itemtype": "method", + "name": "deleteRecord", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "record", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/json-api/request", + "module": "@ember-data/json-api/request" + }, + { + "file": "../packages/json-api/src/-private/builders/find-record.ts", + "line": 15, + "description": "Builds request options to fetch a single resource by a known id or identifier\nconfigured for the url and header expectations of most JSON:API APIs.\n\n**Basic Usage**\n\n```ts\nimport { findRecord } from '@ember-data/json-api/request';\n\nconst data = await store.request(findRecord('person', '1'));\n```\n\n**With Options**\n\n```ts\nimport { findRecord } from '@ember-data/json-api/request';\n\nconst options = findRecord('person', '1', { include: ['pets', 'friends'] });\nconst data = await store.request(options);\n```\n\n**With an Identifier**\n\n```ts\nimport { findRecord } from '@ember-data/json-api/request';\n\nconst options = findRecord({ type: 'person', id: '1' }, { include: ['pets', 'friends'] });\nconst data = await store.request(options);\n```\n\n**Supplying Options to Modify the Request Behavior**\n\nThe following options are supported:\n\n- `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.\n- `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.\n- `resourcePath` - The resource path to use for the request, defaults to pluralizing the supplied type\n- `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to `false` if none is configured.\n- `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to `false` if none is configured.\n- `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)\n\n```ts\nimport { findRecord } from '@ember-data/json-api/request';\n\nconst options = findRecord('person', '1', { include: ['pets', 'friends'] }, { namespace: 'api/v2' });\nconst data = await store.request(options);\n```", + "itemtype": "method", + "name": "findRecord", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/json-api/request", + "module": "@ember-data/json-api/request" + }, + { + "file": "../packages/json-api/src/-private/builders/query.ts", + "line": 11, + "description": "Builds request options to query for resources, usually by a primary\ntype, configured for the url and header expectations of most JSON:API APIs.\n\n**Basic Usage**\n\n```ts\nimport { query } from '@ember-data/json-api/request';\n\nconst data = await store.request(query('person'));\n```\n\n**With Query Params**\n\n```ts\nimport { query } from '@ember-data/json-api/request';\n\nconst options = query('person', { include: ['pets', 'friends'] });\nconst data = await store.request(options);\n```\n\n**Supplying Options to Modify the Request Behavior**\n\nThe following options are supported:\n\n- `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.\n- `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.\n- `resourcePath` - The resource path to use for the request, defaults to pluralizing the supplied type\n- `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to `false` if none is configured.\n- `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to `false` if none is configured.\n- `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)\n\n```ts\nimport { query } from '@ember-data/json-api/request';\n\nconst options = query('person', { include: ['pets', 'friends'] }, { reload: true });\nconst data = await store.request(options);\n```", + "itemtype": "method", + "name": "query", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "query", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/json-api/request", + "module": "@ember-data/json-api/request" + }, + { + "file": "../packages/json-api/src/-private/serialize.ts", + "line": 47, + "description": "Serializes changes to a resource for use with PATCH requests.\n\nOnly attributes which are changed are serialized.\nOnly relationships which are changed are serialized.\n\nCollection relationships serialize the collection as a whole.\n\nIf you would like to serialize updates to a collection more granularly\n(for instance, as operations) request the diff from the store and\nserialize as desired:\n\n```ts\nconst relationshipDiffMap = cache.changedRelationships(identifier);\n```", + "itemtype": "method", + "name": "serializePatch", + "static": 1, + "access": "public", + "tagname": "", + "params": [ + { + "name": "cache}", + "description": "", + "type": "Cache" + }, + { + "name": "identifier", + "description": "", + "type": "StableRecordIdentifier" + } + ], + "return": { + "description": "An object with a `data` property containing the serialized resource patch", + "type": "Object" + }, + "class": "@ember-data/json-api/request", + "module": "@ember-data/json-api/request" + }, + { + "file": "../packages/json-api/src/-private/serialize.ts", + "line": 10, + "description": "Serializes the current state of a resource or array of resources for use with POST or PUT requests.", + "itemtype": "method", + "name": "serializeResources", + "static": 1, + "access": "public", + "tagname": "", + "params": [ + { + "name": "cache}", + "description": "", + "type": "Cache" + }, + { + "name": "identifier", + "description": "", + "type": "StableRecordIdentifier" + } + ], + "return": { + "description": "An object with a `data` property containing the serialized resource patch", + "type": "Object" + }, + "class": "@ember-data/json-api/request", + "module": "@ember-data/json-api/request" + }, + { + "file": "../packages/json-api/src/-private/builders/save-record.ts", + "line": 175, + "description": "Builds request options to update existing record for resources,\nconfigured for the url, method and header expectations of most JSON:API APIs.\n\n**Basic Usage**\n\n```ts\nimport { updateRecord } from '@ember-data/json-api/request';\n\nconst person = this.store.peekRecord('person', '1');\nperson.name = 'Chris';\nconst data = await store.request(updateRecord(person));\n```\n\n**Supplying Options to Modify the Request Behavior**\n\nThe following options are supported:\n\n- `patch` - Allows caller to specify whether to use a PATCH request instead of a PUT request, defaults to `false`.\n- `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.\n- `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.\n- `resourcePath` - The resource path to use for the request, defaults to pluralizing the supplied type\n- `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to `false` if none is configured.\n- `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to `false` if none is configured.\n- `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)\n\n```ts\nimport { updateRecord } from '@ember-data/json-api/request';\n\nconst person = this.store.peekRecord('person', '1');\nperson.name = 'Chris';\nconst options = updateRecord(person, { patch: true });\nconst data = await store.request(options);\n```", + "itemtype": "method", + "name": "updateRecord", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "record", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/json-api/request", + "module": "@ember-data/json-api/request" + } + ] + }, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/legacy-compat.json b/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/legacy-compat.json new file mode 100644 index 000000000..251816eec --- /dev/null +++ b/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/legacy-compat.json @@ -0,0 +1,37 @@ +{ + "data": { + "id": "ember-data-5.3.0-@ember-data/legacy-compat", + "type": "module", + "attributes": { + "name": "@ember-data/legacy-compat", + "submodules": {}, + "elements": {}, + "fors": {}, + "namespaces": {}, + "tag": "main", + "file": "../legacy-compat/src/legacy-network-handler/snapshot-record-array.ts", + "line": 12, + "description": "

Utilities - often temporary - for maintaining backwards compatibility with\nolder parts of EmberData.

\n", + "itemtype": "main", + "parent": null, + "publicclasses": [ + "SnapshotRecordArray" + ], + "privateclasses": [], + "staticfunctions": {}, + "allstaticfunctions": {}, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/model.json b/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/model.json new file mode 100644 index 000000000..cde24a1d0 --- /dev/null +++ b/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/model.json @@ -0,0 +1,571 @@ +{ + "data": { + "id": "ember-data-5.3.0-@ember-data/model", + "type": "module", + "attributes": { + "name": "@ember-data/model", + "submodules": {}, + "elements": {}, + "fors": { + "@ember-data/model": 1, + "Model": 1 + }, + "namespaces": {}, + "tag": "main", + "file": "../model/src/-private/promise-many-array.ts", + "line": 20, + "description": "

This package provides a Presentation Model for resource data in an EmberData Cache.

\n

Models are defined as classes extending from import Model from '@ember-data/model'; and the\nattributes and relationships on these classes are parsed at runtime to supply static "schema"\nto EmberData's SchemaService.

\n

Resource data for individual resources fetched from your API is presented to the UI via instances\nof the Models you define. An instantiated Model is referred to as a record.

\n

When we refer to the ModelClass as opposed to a Model or Record we are referring\n specifically to the class definition and the static schema methods present on it.

\n

When we refer to a record we refer to a specific class instance presenting\n the resource data for a given type and id.

\n

Defining a Model

\n

```app/models/person.js\n import Model, { attr, belongsTo, hasMany } from '@ember-data/model';

\n

export default class PersonModel extends Model {

\n", + "attr": "name;", + "belongsto": "('pet', { inverse: 'owners', async: false }) dog;", + "hasmany": "('person', { inverse: 'friends', async: true }) friends;\n }\n ```\n\n ### modelName convention\n\n By convention, the name of a given model (its `type`) matches the name\n of the file in the `app/models` folder and should be lowercase, singular\n and dasherized.", + "itemtype": "main", + "parent": null, + "publicclasses": [ + "BelongsToReference", + "HasManyReference", + "Errors", + "Model", + "PromiseManyArray" + ], + "privateclasses": [ + "PromiseBelongsTo" + ], + "staticfunctions": { + "@ember-data/model": [ + { + "file": "../packages/model/src/-private/attr.js", + "line": 14, + "itemtype": "method", + "description": "`attr` defines an attribute on a [Model](/ember-data/release/classes/Model).\nBy default, attributes are passed through as-is, however you can specify an\noptional type to have the value automatically transformed.\nEmber Data ships with four basic transform types: `string`, `number`,\n`boolean` and `date`. You can define your own transforms by subclassing\n[Transform](/ember-data/release/classes/Transform).\n\nNote that you cannot use `attr` to define an attribute of `id`.\n\n`attr` takes an optional hash as a second parameter, currently\nsupported options are:\n\n- `defaultValue`: Pass a string or a function to be called to set the attribute\nto a default value if and only if the key is absent from the payload response.\n\nExample\n\n```app/models/user.js\nimport Model, { attr } from '@ember-data/model';\n\nexport default class UserModel extends Model {\n @attr('text', {\n uppercase: true\n })\n text;\n}\n```\n\n```app/transforms/text.js\nexport default class TextTransform {\n serialize(value, options) {\n if (options.uppercase) {\n return value.toUpperCase();\n }\n\n return value;\n }\n\n deserialize(value) {\n return value;\n }\n\n static create() {\n return new this();\n }\n}\n```\n", + "name": "attr", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "type", + "description": "the attribute type", + "type": "String|Object" + }, + { + "name": "options", + "description": "a hash of options", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Attribute" + }, + "class": "@ember-data/model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/belongs-to.js", + "line": 13, + "itemtype": "method", + "description": "`belongsTo` is used to define One-To-One and One-To-Many\nrelationships on a [Model](/ember-data/release/classes/Model).\n\n\n`belongsTo` takes an optional hash as a second parameter, currently\nsupported options are:\n\n- `async`: A boolean value used to explicitly declare this to be an async relationship. The default is true.\n- `inverse`: A string used to identify the inverse property on a\n related model in a One-To-Many relationship. See [Explicit Inverses](#explicit-inverses)\n- `polymorphic` A boolean value to mark the relationship as polymorphic\n\n#### One-To-One\nTo declare a one-to-one relationship between two models, use\n`belongsTo`:\n\n```app/models/user.js\nimport Model, { belongsTo } from '@ember-data/model';\n\nexport default class UserModel extends Model {\n @belongsto('post', {\n async: false,\n inverse: null\n })\n post;\n}\n```\n\nIn contrast to async relationship, accessing a sync relationship\nwill always return the record (Model instance) for the existing\nlocal resource, or null. But it will error on access when\na related resource is known to exist and it has not been loaded.\n\n```\nlet post = comment.post;\n\n```\n @hasmany('comment', { async: false, inverse: 'post' }) comments;\n}\n```\n\n```app/models/comment.js\nimport Model, { belongsTo } from '@ember-data/model';\n\nexport default class CommentModel extends Model {\n", + "name": "belongsTo", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "modelName", + "description": "(optional) type of the relationship", + "type": "String" + }, + { + "name": "options", + "description": "(optional) a hash of options", + "type": "Object" + } + ], + "return": { + "description": "relationship", + "type": "Ember.computed" + }, + "class": "@ember-data/model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/has-many.js", + "line": 41, + "itemtype": "method", + "description": "`hasMany` is used to define One-To-Many and Many-To-Many\nrelationships on a [Model](/ember-data/release/classes/Model).\n\n`hasMany` takes an optional hash as a second parameter, currently\nsupported options are:\n\n- `async`: A boolean value used to explicitly declare this to be an async relationship. The default is true.\n- `inverse`: A string used to identify the inverse property on a related model.\n- `polymorphic` A boolean value to mark the relationship as polymorphic\n\n#### One-To-Many\nTo declare a one-to-many relationship between two models, use\n`belongsTo` in combination with `hasMany`, like this:\n\n```app/models/post.js\nimport Model, { hasMany } from '@ember-data/model';\n\nexport default class PostModel extends Model {\n @hasmany('comment', {\n async: false\n })\n comments;\n}\n```\n\nIn contrast to async relationship, accessing a sync relationship\nwill always return a [ManyArray](/ember-data/release/classes/ManyArray) instance\ncontaining the existing local resources. But it will error on access\nwhen any of the known related resources have not been loaded.\n\n```\npost.comments.forEach((comment) => {\n\n});\n\n```\n\nIf you are using `links` with sync relationships, you have to use\n`ref.reload` to fetch the resources.\n @belongsto('post') bluePost;\n}\n```\n\n```app/models/post.js\nimport Model, { hasMany } from '@ember-data/model';\n\nexport default class PostModel extends Model {\n", + "name": "hasMany", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "type", + "description": "(optional) type of the relationship", + "type": "String" + }, + { + "name": "options", + "description": "(optional) a hash of options", + "type": "Object" + } + ], + "return": { + "description": "relationship", + "type": "Ember.computed" + }, + "class": "@ember-data/model", + "module": "@ember-data/model" + } + ], + "Model": [ + { + "file": "../packages/model/src/-private/model.js", + "line": 1999, + "itemtype": "method", + "description": "Iterates through the attributes of the model, calling the passed function on each\nattribute.\n\nThe callback method you provide should have the following signature (all\nparameters are optional):\n\n```javascript\nfunction(name, meta);\n```\n\n- `name` the name of the current property in the iteration\n- `meta` the meta object for the attribute property in the iteration\n\nNote that in addition to a callback, you can also pass an optional target\nobject that will be set as `this` on the context.\n\nExample\n\n```javascript\nimport Model, { attr } from '@ember-data/model';\n\nclass PersonModel extends Model {\n @attr('date') birthday;\n }\n\nPersonModel.eachAttribute(function(name, meta) {\n // do thing\n });\n\n// prints:\n// firstName {type: \"string\", isAttribute: true, options: Object, parentType: function, name: \"firstName\"}\n// lastName {type: \"string\", isAttribute: true, options: Object, parentType: function, name: \"lastName\"}\n// birthday {type: \"date\", isAttribute: true, options: Object, parentType: function, name: \"birthday\"}\n```\n", + "name": "eachAttribute", + "access": "public", + "tagname": "", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "binding", + "description": "the value to which the callback's `this` should be bound", + "type": "Object", + "optional": true + } + ], + "static": 1, + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 1826, + "description": "Given a callback, iterates over each of the types related to a model,\ninvoking the callback with the related type's class. Each type will be\nreturned just once, regardless of how many different relationships it has\nwith a model.", + "itemtype": "method", + "name": "eachRelatedType", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "callback", + "description": "the callback to invoke", + "type": "Function" + }, + { + "name": "binding", + "description": "the value to which the callback's `this` should be bound", + "type": "Any" + } + ], + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 1804, + "description": "Given a callback, iterates over each of the relationships in the model,\ninvoking the callback with the name of each relationship and its relationship\ndescriptor.", + "itemtype": "method", + "name": "eachRelationship", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "callback", + "description": "the callback to invoke", + "type": "Function" + }, + { + "name": "binding", + "description": "the value to which the callback's `this` should be bound", + "type": "Any" + } + ], + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 2054, + "description": "Iterates through the transformedAttributes of the model, calling\nthe passed function on each attribute. Note the callback will not be\ncalled for any attributes that do not have an transformation type.\n\nThe callback method you provide should have the following signature (all\nparameters are optional):\n\n```javascript\nfunction(name, type);\n```\n\n- `name` the name of the current property in the iteration\n- `type` a string containing the name of the type of transformed\napplied to the attribute\n\nNote that in addition to a callback, you can also pass an optional target\nobject that will be set as `this` on the context.\n\nExample\n\n```javascript\nimport Model, { attr } from '@ember-data/model';\n\nlet Person = Model.extend({\n firstName: attr(),\n lastName: attr('string'),\n birthday: attr('date')\n });\n\nPerson.eachTransformedAttribute(function(name, type) {\n // do thing\n });\n\n// prints:\n// lastName string\n// birthday date\n```", + "itemtype": "method", + "name": "eachTransformedAttribute", + "access": "public", + "tagname": "", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "binding", + "description": "the value to which the callback's `this` should be bound", + "type": "Object", + "optional": true + } + ], + "static": 1, + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 1289, + "itemtype": "method", + "description": "Find the relationship which is the inverse of the one asked for.\n\nFor example, if you define models like this:\n\n```app/models/post.js\nimport Model, { hasMany } from '@ember-data/model';\n\nexport default class PostModel extends Model {\n @hasmany('message') comments;\n }\n```\n\n```app/models/message.js\nimport Model, { belongsTo } from '@ember-data/model';\n\nexport default class MessageModel extends Model {\n @belongsto('post') owner;\n }\n```\n\n``` js\nstore.modelFor('post').inverseFor('comments', store) // { type: App.Message, name: 'owner', kind: 'belongsTo' }\nstore.modelFor('message').inverseFor('owner', store) // { type: App.Post, name: 'comments', kind: 'hasMany' }\n```\n", + "name": "inverseFor", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "name", + "description": "the name of the relationship", + "type": "String" + }, + { + "name": "store", + "description": "", + "type": "Store" + } + ], + "return": { + "description": "the inverse relationship, or null", + "type": "Object" + }, + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 2110, + "description": "Returns the name of the model class.", + "itemtype": "method", + "name": "toString", + "access": "public", + "tagname": "", + "static": 1, + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 1248, + "itemtype": "method", + "description": "For a given relationship name, returns the model type of the relationship.\n\nFor example, if you define a model like this:\n\n```app/models/post.js\nimport Model, { hasMany } from '@ember-data/model';\n\nexport default class PostModel extends Model {\n @hasmany('comment') comments;\n}\n```\n\nCalling `store.modelFor('post').typeForRelationship('comments', store)` will return `Comment`.\n", + "name": "typeForRelationship", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "name", + "description": "the name of the relationship", + "type": "String" + }, + { + "name": "store", + "description": "an instance of Store", + "type": "Store" + } + ], + "return": { + "description": "the type of the relationship, or undefined", + "type": "Model" + }, + "class": "Model", + "module": "@ember-data/model" + } + ] + }, + "allstaticfunctions": { + "@ember-data/model": [ + { + "file": "../packages/model/src/-private/attr.js", + "line": 14, + "itemtype": "method", + "description": "`attr` defines an attribute on a [Model](/ember-data/release/classes/Model).\nBy default, attributes are passed through as-is, however you can specify an\noptional type to have the value automatically transformed.\nEmber Data ships with four basic transform types: `string`, `number`,\n`boolean` and `date`. You can define your own transforms by subclassing\n[Transform](/ember-data/release/classes/Transform).\n\nNote that you cannot use `attr` to define an attribute of `id`.\n\n`attr` takes an optional hash as a second parameter, currently\nsupported options are:\n\n- `defaultValue`: Pass a string or a function to be called to set the attribute\nto a default value if and only if the key is absent from the payload response.\n\nExample\n\n```app/models/user.js\nimport Model, { attr } from '@ember-data/model';\n\nexport default class UserModel extends Model {\n @attr('text', {\n uppercase: true\n })\n text;\n}\n```\n\n```app/transforms/text.js\nexport default class TextTransform {\n serialize(value, options) {\n if (options.uppercase) {\n return value.toUpperCase();\n }\n\n return value;\n }\n\n deserialize(value) {\n return value;\n }\n\n static create() {\n return new this();\n }\n}\n```\n", + "name": "attr", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "type", + "description": "the attribute type", + "type": "String|Object" + }, + { + "name": "options", + "description": "a hash of options", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Attribute" + }, + "class": "@ember-data/model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/belongs-to.js", + "line": 13, + "itemtype": "method", + "description": "`belongsTo` is used to define One-To-One and One-To-Many\nrelationships on a [Model](/ember-data/release/classes/Model).\n\n\n`belongsTo` takes an optional hash as a second parameter, currently\nsupported options are:\n\n- `async`: A boolean value used to explicitly declare this to be an async relationship. The default is true.\n- `inverse`: A string used to identify the inverse property on a\n related model in a One-To-Many relationship. See [Explicit Inverses](#explicit-inverses)\n- `polymorphic` A boolean value to mark the relationship as polymorphic\n\n#### One-To-One\nTo declare a one-to-one relationship between two models, use\n`belongsTo`:\n\n```app/models/user.js\nimport Model, { belongsTo } from '@ember-data/model';\n\nexport default class UserModel extends Model {\n @belongsto('post', {\n async: false,\n inverse: null\n })\n post;\n}\n```\n\nIn contrast to async relationship, accessing a sync relationship\nwill always return the record (Model instance) for the existing\nlocal resource, or null. But it will error on access when\na related resource is known to exist and it has not been loaded.\n\n```\nlet post = comment.post;\n\n```\n @hasmany('comment', { async: false, inverse: 'post' }) comments;\n}\n```\n\n```app/models/comment.js\nimport Model, { belongsTo } from '@ember-data/model';\n\nexport default class CommentModel extends Model {\n", + "name": "belongsTo", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "modelName", + "description": "(optional) type of the relationship", + "type": "String" + }, + { + "name": "options", + "description": "(optional) a hash of options", + "type": "Object" + } + ], + "return": { + "description": "relationship", + "type": "Ember.computed" + }, + "class": "@ember-data/model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/has-many.js", + "line": 41, + "itemtype": "method", + "description": "`hasMany` is used to define One-To-Many and Many-To-Many\nrelationships on a [Model](/ember-data/release/classes/Model).\n\n`hasMany` takes an optional hash as a second parameter, currently\nsupported options are:\n\n- `async`: A boolean value used to explicitly declare this to be an async relationship. The default is true.\n- `inverse`: A string used to identify the inverse property on a related model.\n- `polymorphic` A boolean value to mark the relationship as polymorphic\n\n#### One-To-Many\nTo declare a one-to-many relationship between two models, use\n`belongsTo` in combination with `hasMany`, like this:\n\n```app/models/post.js\nimport Model, { hasMany } from '@ember-data/model';\n\nexport default class PostModel extends Model {\n @hasmany('comment', {\n async: false\n })\n comments;\n}\n```\n\nIn contrast to async relationship, accessing a sync relationship\nwill always return a [ManyArray](/ember-data/release/classes/ManyArray) instance\ncontaining the existing local resources. But it will error on access\nwhen any of the known related resources have not been loaded.\n\n```\npost.comments.forEach((comment) => {\n\n});\n\n```\n\nIf you are using `links` with sync relationships, you have to use\n`ref.reload` to fetch the resources.\n @belongsto('post') bluePost;\n}\n```\n\n```app/models/post.js\nimport Model, { hasMany } from '@ember-data/model';\n\nexport default class PostModel extends Model {\n", + "name": "hasMany", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "type", + "description": "(optional) type of the relationship", + "type": "String" + }, + { + "name": "options", + "description": "(optional) a hash of options", + "type": "Object" + } + ], + "return": { + "description": "relationship", + "type": "Ember.computed" + }, + "class": "@ember-data/model", + "module": "@ember-data/model" + } + ], + "Model": [ + { + "file": "../packages/model/src/-private/model.js", + "line": 1187, + "description": "Create should only ever be called by the store. To create an instance of a\n`Model` in a dirty state use `store.createRecord`.\n\n To create instances of `Model` in a clean state, use `store.push`", + "itemtype": "method", + "name": "create", + "access": "private", + "tagname": "", + "static": 1, + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 1999, + "itemtype": "method", + "description": "Iterates through the attributes of the model, calling the passed function on each\nattribute.\n\nThe callback method you provide should have the following signature (all\nparameters are optional):\n\n```javascript\nfunction(name, meta);\n```\n\n- `name` the name of the current property in the iteration\n- `meta` the meta object for the attribute property in the iteration\n\nNote that in addition to a callback, you can also pass an optional target\nobject that will be set as `this` on the context.\n\nExample\n\n```javascript\nimport Model, { attr } from '@ember-data/model';\n\nclass PersonModel extends Model {\n @attr('date') birthday;\n }\n\nPersonModel.eachAttribute(function(name, meta) {\n // do thing\n });\n\n// prints:\n// firstName {type: \"string\", isAttribute: true, options: Object, parentType: function, name: \"firstName\"}\n// lastName {type: \"string\", isAttribute: true, options: Object, parentType: function, name: \"lastName\"}\n// birthday {type: \"date\", isAttribute: true, options: Object, parentType: function, name: \"birthday\"}\n```\n", + "name": "eachAttribute", + "access": "public", + "tagname": "", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "binding", + "description": "the value to which the callback's `this` should be bound", + "type": "Object", + "optional": true + } + ], + "static": 1, + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 1826, + "description": "Given a callback, iterates over each of the types related to a model,\ninvoking the callback with the related type's class. Each type will be\nreturned just once, regardless of how many different relationships it has\nwith a model.", + "itemtype": "method", + "name": "eachRelatedType", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "callback", + "description": "the callback to invoke", + "type": "Function" + }, + { + "name": "binding", + "description": "the value to which the callback's `this` should be bound", + "type": "Any" + } + ], + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 1804, + "description": "Given a callback, iterates over each of the relationships in the model,\ninvoking the callback with the name of each relationship and its relationship\ndescriptor.", + "itemtype": "method", + "name": "eachRelationship", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "callback", + "description": "the callback to invoke", + "type": "Function" + }, + { + "name": "binding", + "description": "the value to which the callback's `this` should be bound", + "type": "Any" + } + ], + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 2054, + "description": "Iterates through the transformedAttributes of the model, calling\nthe passed function on each attribute. Note the callback will not be\ncalled for any attributes that do not have an transformation type.\n\nThe callback method you provide should have the following signature (all\nparameters are optional):\n\n```javascript\nfunction(name, type);\n```\n\n- `name` the name of the current property in the iteration\n- `type` a string containing the name of the type of transformed\napplied to the attribute\n\nNote that in addition to a callback, you can also pass an optional target\nobject that will be set as `this` on the context.\n\nExample\n\n```javascript\nimport Model, { attr } from '@ember-data/model';\n\nlet Person = Model.extend({\n firstName: attr(),\n lastName: attr('string'),\n birthday: attr('date')\n });\n\nPerson.eachTransformedAttribute(function(name, type) {\n // do thing\n });\n\n// prints:\n// lastName string\n// birthday date\n```", + "itemtype": "method", + "name": "eachTransformedAttribute", + "access": "public", + "tagname": "", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "binding", + "description": "the value to which the callback's `this` should be bound", + "type": "Object", + "optional": true + } + ], + "static": 1, + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 1289, + "itemtype": "method", + "description": "Find the relationship which is the inverse of the one asked for.\n\nFor example, if you define models like this:\n\n```app/models/post.js\nimport Model, { hasMany } from '@ember-data/model';\n\nexport default class PostModel extends Model {\n @hasmany('message') comments;\n }\n```\n\n```app/models/message.js\nimport Model, { belongsTo } from '@ember-data/model';\n\nexport default class MessageModel extends Model {\n @belongsto('post') owner;\n }\n```\n\n``` js\nstore.modelFor('post').inverseFor('comments', store) // { type: App.Message, name: 'owner', kind: 'belongsTo' }\nstore.modelFor('message').inverseFor('owner', store) // { type: App.Post, name: 'comments', kind: 'hasMany' }\n```\n", + "name": "inverseFor", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "name", + "description": "the name of the relationship", + "type": "String" + }, + { + "name": "store", + "description": "", + "type": "Store" + } + ], + "return": { + "description": "the inverse relationship, or null", + "type": "Object" + }, + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 2110, + "description": "Returns the name of the model class.", + "itemtype": "method", + "name": "toString", + "access": "public", + "tagname": "", + "static": 1, + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 1248, + "itemtype": "method", + "description": "For a given relationship name, returns the model type of the relationship.\n\nFor example, if you define a model like this:\n\n```app/models/post.js\nimport Model, { hasMany } from '@ember-data/model';\n\nexport default class PostModel extends Model {\n @hasmany('comment') comments;\n}\n```\n\nCalling `store.modelFor('post').typeForRelationship('comments', store)` will return `Comment`.\n", + "name": "typeForRelationship", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "name", + "description": "the name of the relationship", + "type": "String" + }, + { + "name": "store", + "description": "an instance of Store", + "type": "Store" + } + ], + "return": { + "description": "the type of the relationship, or undefined", + "type": "Model" + }, + "class": "Model", + "module": "@ember-data/model" + } + ] + }, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/request-utils.json b/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/request-utils.json new file mode 100644 index 000000000..9e8c46192 --- /dev/null +++ b/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/request-utils.json @@ -0,0 +1,337 @@ +{ + "data": { + "id": "ember-data-5.3.0-@ember-data/request-utils", + "type": "module", + "attributes": { + "name": "@ember-data/request-utils", + "submodules": {}, + "elements": {}, + "fors": { + "@ember-data/request-utils": 1 + }, + "namespaces": {}, + "tag": "main", + "file": "../request-utils/src/index.ts", + "line": 582, + "description": "

Simple utility function to assist in url building,\nquery params, and other common request operations.

\n

These primitives may be used directly or composed\nby request builders to provide a consistent interface\nfor building requests.

\n

For instance:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { buildBaseURL, buildQueryParams } from '@ember-data/request-utils';\n\nconst baseURL = buildBaseURL({\n  host: 'https://api.example.com',\n  namespace: 'api/v1',\n  resourcePath: 'emberDevelopers',\n  op: 'query',\n  identifier: { type: 'ember-developer' }\n});\nconst url = `${baseURL}?${buildQueryParams({ name: 'Chris', include:['pets'] })}`;\n// => 'https://api.example.com/api/v1/emberDevelopers?include=pets&name=Chris'
\n
\n
\n \n

This is useful, but not as useful as the REST request builder for query which is sugar\nover this (and more!):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { query } from '@ember-data/rest/request';\n\nconst options = query('ember-developer', { name: 'Chris', include:['pets'] });\n// => { url: 'https://api.example.com/api/v1/emberDevelopers?include=pets&name=Chris' }\n// Note: options will also include other request options like headers, method, etc.
\n
\n
\n \n", + "itemtype": "main", + "parent": null, + "publicclasses": [ + "LifetimesService" + ], + "privateclasses": [], + "staticfunctions": { + "@ember-data/request-utils": [ + { + "file": "../packages/request-utils/src/index.ts", + "line": 185, + "description": "Builds a URL for a request based on the provided options.\nDoes not include support for building query params (see `buildQueryParams`)\nso that it may be composed cleanly with other query-params strategies.\n\nUsage:\n\n```ts\nimport { buildBaseURL } from '@ember-data/request-utils';\n\nconst url = buildBaseURL({\n host: 'https://api.example.com',\n namespace: 'api/v1',\n resourcePath: 'emberDevelopers',\n op: 'query',\n identifier: { type: 'ember-developer' }\n});\n\n// => 'https://api.example.com/api/v1/emberDevelopers'\n```\n\nOn the surface this may seem like a lot of work to do something simple, but\nit is designed to be composable with other utilities and interfaces that the\naverage product engineer will never need to see or use.\n\nA few notes:\n\n- `resourcePath` is optional, but if it is not provided, `identifier.type` will be used.\n- `host` and `namespace` are optional, but if they are not provided, the values globally\n configured via `setBuildURLConfig` will be used.\n- `op` is required and must be one of the following:\n - 'findRecord' 'query' 'findMany' 'findRelatedCollection' 'findRelatedRecord'` 'createRecord' 'updateRecord' 'deleteRecord'\n- Depending on the value of `op`, `identifier` or `identifiers` will be required.", + "itemtype": "method", + "name": "buildBaseURL", + "static": 1, + "access": "public", + "tagname": "", + "params": [ + { + "name": "urlOptions", + "description": "" + } + ], + "return": { + "description": "string" + }, + "class": "@ember-data/request-utils", + "module": "@ember-data/request-utils" + }, + { + "file": "../packages/request-utils/src/index.ts", + "line": 338, + "description": "filter out keys of an object that have falsy values or point to empty arrays\nreturning a new object with only those keys that have truthy values / non-empty arrays", + "itemtype": "method", + "name": "filterEmpty", + "static": 1, + "access": "public", + "tagname": "", + "params": [ + { + "name": "source", + "description": "object to filter keys with empty values from", + "type": "Record" + } + ], + "return": { + "description": "A new object with the keys that contained empty values removed", + "type": "Record" + }, + "class": "@ember-data/request-utils", + "module": "@ember-data/request-utils" + }, + { + "file": "../packages/request-utils/src/index.ts", + "line": 488, + "description": "Parses a string Cache-Control header value into an object with the following structure:\n\n ```ts\n interface CacheControlValue {\n immutable?: boolean;\n 'max-age'?: number;\n 'must-revalidate'?: boolean;\n 'must-understand'?: boolean;\n 'no-cache'?: boolean;\n 'no-store'?: boolean;\n 'no-transform'?: boolean;\n 'only-if-cached'?: boolean;\n private?: boolean;\n 'proxy-revalidate'?: boolean;\n public?: boolean;\n 's-maxage'?: number;\n 'stale-if-error'?: number;\n 'stale-while-revalidate'?: number;\n }\n ```", + "itemtype": "method", + "name": "parseCacheControl", + "static": 1, + "access": "public", + "tagname": "", + "params": [ + { + "name": "header", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "CacheControlValue" + }, + "class": "@ember-data/request-utils", + "module": "@ember-data/request-utils" + }, + { + "file": "../packages/request-utils/src/index.ts", + "line": 60, + "description": "Sets the global configuration for `buildBaseURL`\nfor host and namespace values for the application.\n\nThese values may still be overridden by passing\nthem to buildBaseURL directly.\n\nThis method may be called as many times as needed\n\n```ts\ntype BuildURLConfig = {\n host: string;\n namespace: string'\n}\n```", + "itemtype": "method", + "name": "setBuildURLConfig", + "static": 1, + "access": "public", + "tagname": "", + "params": [ + { + "name": "config", + "description": "", + "type": "BuildURLConfig" + } + ], + "return": { + "description": "void" + }, + "class": "@ember-data/request-utils", + "module": "@ember-data/request-utils" + }, + { + "file": "../packages/request-utils/src/index.ts", + "line": 363, + "description": "Sorts query params by both key and value returning a new URLSearchParams\nobject with the keys inserted in sorted order.\n\nTreats `included` specially, splicing it into an array if it is a string and sorting the array.\n\nOptions:\n- arrayFormat: 'bracket' | 'indices' | 'repeat' | 'comma'\n\n'bracket': appends [] to the key for every value e.g. `&ids[]=1&ids[]=2`\n'indices': appends [i] to the key for every value e.g. `&ids[0]=1&ids[1]=2`\n'repeat': appends the key for every value e.g. `&ids=1&ids=2`\n'comma' (default): appends the key once with a comma separated list of values e.g. `&ids=1,2`", + "itemtype": "method", + "name": "sortQueryParams", + "static": 1, + "access": "public", + "tagname": "", + "params": [ + { + "name": "params", + "description": "", + "type": "URLSearchParams | object" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "A URLSearchParams with keys inserted in sorted order", + "type": "URLSearchParams" + }, + "class": "@ember-data/request-utils", + "module": "@ember-data/request-utils" + }, + { + "file": "../packages/request-utils/src/index.ts", + "line": 445, + "description": "Sorts query params by both key and value, returning a query params string\n\nTreats `included` specially, splicing it into an array if it is a string and sorting the array.\n\nOptions:\n- arrayFormat: 'bracket' | 'indices' | 'repeat' | 'comma'\n\n'bracket': appends [] to the key for every value e.g. `ids[]=1&ids[]=2`\n'indices': appends [i] to the key for every value e.g. `ids[0]=1&ids[1]=2`\n'repeat': appends the key for every value e.g. `ids=1&ids=2`\n'comma' (default): appends the key once with a comma separated list of values e.g. `ids=1,2`", + "itemtype": "method", + "name": "sortQueryParams", + "static": 1, + "access": "public", + "tagname": "", + "params": [ + { + "name": "params", + "description": "", + "type": "URLSearchParams | object" + }, + { + "name": "options", + "description": "", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A sorted query params string without the leading `?`", + "type": "String" + }, + "class": "@ember-data/request-utils", + "module": "@ember-data/request-utils" + } + ] + }, + "allstaticfunctions": { + "@ember-data/request-utils": [ + { + "file": "../packages/request-utils/src/index.ts", + "line": 185, + "description": "Builds a URL for a request based on the provided options.\nDoes not include support for building query params (see `buildQueryParams`)\nso that it may be composed cleanly with other query-params strategies.\n\nUsage:\n\n```ts\nimport { buildBaseURL } from '@ember-data/request-utils';\n\nconst url = buildBaseURL({\n host: 'https://api.example.com',\n namespace: 'api/v1',\n resourcePath: 'emberDevelopers',\n op: 'query',\n identifier: { type: 'ember-developer' }\n});\n\n// => 'https://api.example.com/api/v1/emberDevelopers'\n```\n\nOn the surface this may seem like a lot of work to do something simple, but\nit is designed to be composable with other utilities and interfaces that the\naverage product engineer will never need to see or use.\n\nA few notes:\n\n- `resourcePath` is optional, but if it is not provided, `identifier.type` will be used.\n- `host` and `namespace` are optional, but if they are not provided, the values globally\n configured via `setBuildURLConfig` will be used.\n- `op` is required and must be one of the following:\n - 'findRecord' 'query' 'findMany' 'findRelatedCollection' 'findRelatedRecord'` 'createRecord' 'updateRecord' 'deleteRecord'\n- Depending on the value of `op`, `identifier` or `identifiers` will be required.", + "itemtype": "method", + "name": "buildBaseURL", + "static": 1, + "access": "public", + "tagname": "", + "params": [ + { + "name": "urlOptions", + "description": "" + } + ], + "return": { + "description": "string" + }, + "class": "@ember-data/request-utils", + "module": "@ember-data/request-utils" + }, + { + "file": "../packages/request-utils/src/index.ts", + "line": 338, + "description": "filter out keys of an object that have falsy values or point to empty arrays\nreturning a new object with only those keys that have truthy values / non-empty arrays", + "itemtype": "method", + "name": "filterEmpty", + "static": 1, + "access": "public", + "tagname": "", + "params": [ + { + "name": "source", + "description": "object to filter keys with empty values from", + "type": "Record" + } + ], + "return": { + "description": "A new object with the keys that contained empty values removed", + "type": "Record" + }, + "class": "@ember-data/request-utils", + "module": "@ember-data/request-utils" + }, + { + "file": "../packages/request-utils/src/index.ts", + "line": 488, + "description": "Parses a string Cache-Control header value into an object with the following structure:\n\n ```ts\n interface CacheControlValue {\n immutable?: boolean;\n 'max-age'?: number;\n 'must-revalidate'?: boolean;\n 'must-understand'?: boolean;\n 'no-cache'?: boolean;\n 'no-store'?: boolean;\n 'no-transform'?: boolean;\n 'only-if-cached'?: boolean;\n private?: boolean;\n 'proxy-revalidate'?: boolean;\n public?: boolean;\n 's-maxage'?: number;\n 'stale-if-error'?: number;\n 'stale-while-revalidate'?: number;\n }\n ```", + "itemtype": "method", + "name": "parseCacheControl", + "static": 1, + "access": "public", + "tagname": "", + "params": [ + { + "name": "header", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "CacheControlValue" + }, + "class": "@ember-data/request-utils", + "module": "@ember-data/request-utils" + }, + { + "file": "../packages/request-utils/src/index.ts", + "line": 60, + "description": "Sets the global configuration for `buildBaseURL`\nfor host and namespace values for the application.\n\nThese values may still be overridden by passing\nthem to buildBaseURL directly.\n\nThis method may be called as many times as needed\n\n```ts\ntype BuildURLConfig = {\n host: string;\n namespace: string'\n}\n```", + "itemtype": "method", + "name": "setBuildURLConfig", + "static": 1, + "access": "public", + "tagname": "", + "params": [ + { + "name": "config", + "description": "", + "type": "BuildURLConfig" + } + ], + "return": { + "description": "void" + }, + "class": "@ember-data/request-utils", + "module": "@ember-data/request-utils" + }, + { + "file": "../packages/request-utils/src/index.ts", + "line": 363, + "description": "Sorts query params by both key and value returning a new URLSearchParams\nobject with the keys inserted in sorted order.\n\nTreats `included` specially, splicing it into an array if it is a string and sorting the array.\n\nOptions:\n- arrayFormat: 'bracket' | 'indices' | 'repeat' | 'comma'\n\n'bracket': appends [] to the key for every value e.g. `&ids[]=1&ids[]=2`\n'indices': appends [i] to the key for every value e.g. `&ids[0]=1&ids[1]=2`\n'repeat': appends the key for every value e.g. `&ids=1&ids=2`\n'comma' (default): appends the key once with a comma separated list of values e.g. `&ids=1,2`", + "itemtype": "method", + "name": "sortQueryParams", + "static": 1, + "access": "public", + "tagname": "", + "params": [ + { + "name": "params", + "description": "", + "type": "URLSearchParams | object" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "A URLSearchParams with keys inserted in sorted order", + "type": "URLSearchParams" + }, + "class": "@ember-data/request-utils", + "module": "@ember-data/request-utils" + }, + { + "file": "../packages/request-utils/src/index.ts", + "line": 445, + "description": "Sorts query params by both key and value, returning a query params string\n\nTreats `included` specially, splicing it into an array if it is a string and sorting the array.\n\nOptions:\n- arrayFormat: 'bracket' | 'indices' | 'repeat' | 'comma'\n\n'bracket': appends [] to the key for every value e.g. `ids[]=1&ids[]=2`\n'indices': appends [i] to the key for every value e.g. `ids[0]=1&ids[1]=2`\n'repeat': appends the key for every value e.g. `ids=1&ids=2`\n'comma' (default): appends the key once with a comma separated list of values e.g. `ids=1,2`", + "itemtype": "method", + "name": "sortQueryParams", + "static": 1, + "access": "public", + "tagname": "", + "params": [ + { + "name": "params", + "description": "", + "type": "URLSearchParams | object" + }, + { + "name": "options", + "description": "", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A sorted query params string without the leading `?`", + "type": "String" + }, + "class": "@ember-data/request-utils", + "module": "@ember-data/request-utils" + } + ] + }, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/request.json b/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/request.json new file mode 100644 index 000000000..c95c2448a --- /dev/null +++ b/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/request.json @@ -0,0 +1,39 @@ +{ + "data": { + "id": "ember-data-5.3.0-@ember-data/request", + "type": "module", + "attributes": { + "name": "@ember-data/request", + "submodules": {}, + "elements": {}, + "fors": {}, + "namespaces": {}, + "tag": "main", + "file": "../request/src/-private/types.ts", + "line": 205, + "description": "

\n \"EmberData\n

\n\n

⚡️ a simple abstraction over fetch to enable easy management of request/response flows

\n\n

This package provides EmberData's RequestManager, a framework agnostic library that can be integrated with any Javascript application to make fetch happen.

\n

Installation

\n

Install using your javascript package manager of choice. For instance with pnpm

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
pnpm add @ember-data/request
\n
\n
\n \n

🚀 Basic Usage

\n

A RequestManager provides a request/response flow in which configured handlers are successively given the opportunity to handle, modify, or pass-along a request.

\n

The RequestManager on its own does not know how to fulfill requests. For this we must register at least one handler. A basic Fetch handler is provided that will take the request options provided and execute fetch.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import RequestManager from '@ember-data/request';\nimport Fetch from '@ember-data/request/fetch';\nimport { apiUrl } from './config';\n\n// ... create manager and add our Fetch handler\nconst manager = new RequestManager();\nmanager.use([Fetch]);\n\n// ... execute a request\nconst response = await manager.request({\n  url: `${apiUrl}/users`\n});
\n
\n
\n \n

🪜 Architecture

\n

A RequestManager receives a request and manages fulfillment via configured handlers. It may be used standalone from the rest of EmberData and is not specific to any library or framework.

\n

Each handler may choose to fulfill the request using some source of data or to pass the request along to other handlers.

\n

The same or a separate instance of a RequestManager may also be used to fulfill requests issued by EmberData{Store}

\n

When the same instance is used by both this allows for simple coordination throughout the application. Requests issued by the Store will use the in-memory cache\nand return hydrated responses, requests issued directly to the RequestManager\nwill skip the in-memory cache and return raw responses.

\n

Usage

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
const userList = await manager.request({\n  url: `/api/v1/users.list`\n});\n\nconst users = userList.content;
\n
\n
\n \n
\n Making Requests\n\n

RequestManager has a single asyncronous method as it's API: request

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
class RequestManager {\n  request<T>(req: RequestInfo): Future<T>;\n}
\n
\n
\n \n

manager.request(<RequestInfo>) accepts an object containing the information\nnecessary for the request to be handled successfully.

\n

These options extend the options provided to fetch, and can accept a Request. All properties accepted by Request options and fetch options are valid.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
interface RequestInfo extends FetchOptions {\n  op?: string;\n  store?: Store;\nurl: string;\n   // data that a handler should convert into\n   // the query (GET) or body (POST)\n  data?: Record<string, unknown>;\n// options specifically intended for handlers\n  // to utilize to process the request\n  options?: Record<string, unknown>;\n}
\n
\n
\n \n
\n

note: providing a signal is unnecessary as an AbortController is automatically provided if none is present.

\n
\n
\n
\n Using the Response
\n\n

manager.request returns a Future, which allows access to limited information about the request while it is still pending and fulfills with the final state when the request completes and the response has been read.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const usersFuture = manager.request({\n  url: `/api/v1/users.list`\n});
\n
\n
\n \n

A Future is cancellable via abort.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
usersFuture.abort();
\n
\n
\n \n

Handlers may optionally expose a ReadableStream to the Future for streaming data; however, when doing so the handler should not resolve until it has fully read the response stream itself.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
interface Future<T> extends Promise<StructuredDocument<T>> {\n  abort(): void;\nasync getStream(): ReadableStream | null;\n}
\n
\n
\n \n

A Future resolves or rejects with a StructuredDocument.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
interface StructuredDocument<T> {\n  request: RequestInfo;\n  response: ResponseInfo | null;\n  content?: T;\n  error?: Error;\n}
\n
\n
\n \n

The RequestInfo specified by document.request is the same as originally provided to manager.request. If any handler fulfilled this request using different request info it is not represented here. This contract helps to ensure that retry and caching are possible since the original arguments are correctly preserved. This also allows handlers to "fork" the request or fulfill from multiple sources without the details of fulfillment muddying the original request.

\n

The ResponseInfo is a serializable fulfilled subset of a Response if set via setResponse. If no response was ever set this will be null.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
interface ResponseInfo {\n  headers?: Record<string, string>;\n  ok?: boolean;\n  redirected?: boolean;\n  status?: HTTPStatusCode;\n  statusText?: string;\n  type?: 'basic' | 'cors';\n  url?: string;\n}
\n
\n
\n \n
\n\n

Handling Requests

\n
\n { request(context, next): Promise | Future; }
\n\n

Requests are fulfilled by handlers. A handler receives the request context\nas well as a next function with which to pass along a request to the next\nhandler if it so chooses.

\n

A handler may be any object with a request method. This allows both stateful and non-stateful\nhandlers to be utilized.

\n

If a handler calls next, it receives a Future which resolves to a StructuredDocument\nthat it can then compose how it sees fit with its own response.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
\ntype NextFn<P> = (req: RequestInfo) => Future<P>;\n\ninterface Handler {\n  async request<T>(context: RequestContext, next: NextFn<P>): T;\n}
\n
\n
\n \n

RequestContext contains a readonly version of the RequestInfo as well as a few methods for building up the StructuredDocument and Future that will be part of the response.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
interface RequestContext<T> {\n  readonly request: RequestInfo;\nsetStream(stream: ReadableStream | Promise<ReadableStream>): void;\n  setResponse(response: Response | ResponseInfo): void;\n}
\n
\n
\n \n

A basic fetch handler with support for streaming content updates while\nthe download is still underway might look like the following, where we use\nresponse.clone() to tee the ReadableStream into two streams.

\n

A more efficient handler might read from the response stream, building up the\nresponse content before passing along the chunk downstream.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
const FetchHandler = {\n  async request(context) {\n    const response = await fetch(context.request);\n    context.setResponse(reponse);\n    context.setStream(response.clone().body);\n  return response.json();\n  }\n}
\n
\n
\n \n

Request handlers are registered by configuring the manager via use

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
manager.use([Handler1, Handler2])
\n
\n
\n \n

Handlers will be invoked in the order they are registered ("fifo", first-in first-out), and may only be registered up until the first request is made. It is recommended but not required to register all handlers at one time in order to ensure explicitly visible handler ordering.

\n
\n\n\n
\n Error Handling
\nEach handler in the chain can catch errors from upstream and choose to\n either handle the error, re-throw the error, or throw a new error.\n```ts\n const MAX_RETRIES = 5;\nconst Handler = {\n async request(context, next) {\n let attempts = 0;\n while (attempts < MAX_RETRIES) {\n attempts++;\n try {\n const response = await next(context.request);\n return response;\n } catch (e) {\n if (isTimeoutError(e) && attempts < MAX_RETRIES) {\n // retry request\n continue;\n }\n // rethrow if it is not a timeout error\n throw e;\n }\n }\n }\n }\n ```\n
\n\n
\n Handling Abort
\nAborting a request will reject the current handler in the chain. However,\n every handler can potentially catch this error. If your handler needs to\n separate AbortError from other Error types, it is recommended to check\n `context.request.signal.aborted` (or if a custom controller was supplied `controller.signal.aborted`).\nIn this manner it is possible for a request to recover from an abort and\n still proceed; however, as a best practice this should be used for necessary\n cleanup only and the original AbortError rethrown if the abort signal comes\n from the root controller.\n\n

AbortControllers are Always Present and Always Entangled*\nIf the initial request does not supply an AbortController, one will be generated.\nThe signal for this controller is automatically added to the request passed into the first handler.\nEach handler has the option to supply a new controller to the request when calling next. If a new controller is provided it will be automatically\n entangled with the root controller. If the root controller aborts, so will\n any entangled controllers.\nIf an entangled controller aborts, the root controller will not abort. This\n allows for advanced request-flow scenarios to abort subsections of the request tree without aborting the entire request.

\n
\n\n\n
\n Stream Currying
\n\n

RequestManager.request and next differ from fetch in one crucial detail in that the outer Promise resolves only once the response stream has been processed.

\n

For context, it helps to understand a few of the use-cases that RequestManager\nis intended to allow.

\n
    \n
  • to manage and return streaming content (such as video files)
  • \n
  • to fulfill a request from multiple sources or by splitting one request into multiple requests
      \n
    • for instance one API call for a user and another for the user's friends
    • \n
    • or e.g. fulfilling part of the request from one source (one API, in-memory, localStorage, IndexedDB\netc.) and the rest from another source (a different API, a WebWorker, etc.)
    • \n
    \n
  • \n
  • to coalesce multiple requests
  • \n
  • to decorate a request with additional info
      \n
    • e.g. an Auth handler that ensures the correct tokens or headers or cookies are attached.
    • \n
    \n
  • \n
\n

await fetch(<req>) resolves at the moment headers are received. This allows for the body of the request to be processed as a stream by application\ncode while chunks are still being received by the browser.

\n

When an app chooses to await response.json() what occurs is the browser reads the stream to completion and then returns the result. Additionally, this stream may only be read once.

\n

The RequestManager preserves this ability to subscribe to and utilize the stream by either the application or the handler – thereby delivering the full power and flexibility of native APIs – without restricting developers in ways that lead to complicated workarounds.

\n

Each handler may call setStream only once, but may do so at any time until the promise that the handler returns has resolved. The associated promise returned by calling future.getStream will resolve with the stream set by setStream if that method is called, or null if that method\nhas not been called by the time that the handler's request method has resolved.

\n

Handlers that do not create a stream of their own, but which call next, should defensively pipe the stream forward. While this is not required (see automatic currying below) it is better to do so in most cases as otherwise the stream may not become available to downstream handlers or the application until the upstream handler has fully read it.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
context.setStream(future.getStream());
\n
\n
\n \n

Handlers that either call next multiple times or otherwise have reason to create multiple fetch requests should either choose to return no stream, meaningfully combine the streams, or select a single prioritized stream.

\n

Of course, any handler may choose to read and handle the stream, and return either no stream or a different stream in the process.

\n
\n\n
\n Automatic Currying of Stream and Response
\n\n

In order to simplify the common case for handlers which decorate a request, if next is called only a single time and setResponse was never called by the handler, the response set by the next handler in the chain will be applied to that handler's outcome. For instance, this makes the following pattern possible return (await next(<req>)).content;.

\n

Similarly, if next is called only a single time and neither setStream nor getStream was called, we automatically curry the stream from the future returned by next onto the future returned by the handler.

\n

Finally, if the return value of a handler is a Future, we curry content and errors as well, thus enabling the simplest form return next(<req>).

\n

In the case of the Future being returned, Stream proxying is automatic and immediate and does not wait for the Future to resolve.

\n
\n\n

Using as a Service

\n

Most applications will desire to have a single RequestManager instance, which can be achieved using module-state patterns for singletons, or for Ember applications by exporting the manager as a service.

\n

services/request.ts*

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import RequestManager from '@ember-data/request';\nimport Fetch from '@ember-data/request/fetch';\nimport Auth from 'ember-simple-auth/ember-data-handler';\n\nexport default class extends RequestManager {\n  constructor(createArgs) {\n    super(createArgs);\n    this.use([Auth, Fetch]);\n  }\n}
\n
\n
\n \n

Using with @ember-data/store

\n

To have a request service unique to a Store:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Store, { CacheHandler } from '@ember-data/store';\nimport RequestManager from '@ember-data/request';\nimport Fetch from '@ember-data/request/fetch';\n\nclass extends Store {\n  requestManager = new RequestManager();\nconstructor(args) {\n    super(args);\n    this.requestManager.use([Fetch]);\n    this.requestManager.useCache(CacheHandler);\n  }\n}
\n
\n
\n \n

Using with ember-data

\n

If using the package ember-data, the following configuration will automatically be done in order to preserve the legacy Adapter and Serializer behavior. Additional handlers or a service injection like the above would need to be done by the consuming application in order to make broader use of RequestManager.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Store, { CacheHandler } from '@ember-data/store';\nimport RequestManager from '@ember-data/request';\nimport { LegacyNetworkHandler } from '@ember-data/legacy-compat';\n\nexport default class extends Store {\n  requestManager = new RequestManager();\nconstructor(args) {\n    super(args);\n    this.requestManager.use([LegacyNetworkHandler]);\n    this.requestManager.useCache(CacheHandler);\n  }\n}
\n
\n
\n \n

Because the application's store service (if present) will override the store supplied by ember-data, all that is required to define your own ordering and handlers is to supply a store service extending from @ember-data/store and configure as shown above.

\n

For usage of the store's requestManager via store.request(<req>) see the Store documentation.

\n", + "itemtype": "main", + "parent": null, + "publicclasses": [ + "RequestManager", + "Future", + " Handler" + ], + "privateclasses": [], + "staticfunctions": {}, + "allstaticfunctions": {}, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/request/fetch.json b/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/request/fetch.json new file mode 100644 index 000000000..917d29943 --- /dev/null +++ b/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/request/fetch.json @@ -0,0 +1,37 @@ +{ + "data": { + "id": "ember-data-5.3.0-@ember-data/request/fetch", + "type": "module", + "attributes": { + "name": "@ember-data/request/fetch", + "submodules": {}, + "elements": {}, + "fors": {}, + "namespaces": {}, + "tag": "main", + "file": "../request/src/fetch.ts", + "line": 35, + "description": "

A basic Fetch Handler which converts a request into a\nfetch call presuming the response to be json.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import Fetch from '@ember-data/request/fetch';\n\nmanager.use([Fetch]);
\n
\n
\n \n", + "itemtype": "main", + "parent": null, + "publicclasses": [ + "Fetch" + ], + "privateclasses": [], + "staticfunctions": {}, + "allstaticfunctions": {}, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/rest/request.json b/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/rest/request.json new file mode 100644 index 000000000..2229c7d31 --- /dev/null +++ b/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/rest/request.json @@ -0,0 +1,271 @@ +{ + "data": { + "id": "ember-data-5.3.0-@ember-data/rest/request", + "type": "module", + "attributes": { + "name": "@ember-data/rest/request", + "submodules": {}, + "elements": {}, + "fors": { + "@ember-data/rest/request": 1 + }, + "namespaces": {}, + "tag": "main", + "file": "../rest/src/request.ts", + "line": 1, + "description": "

\n \"EmberData\"\n

\n\n

This package provides utilities for working with RESTful APIs with Ember**Data**.

\n

Installation

\n

Install using your javascript package manager of choice. For instance with pnpm

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
pnpm add @ember-data/json-api
\n
\n
\n \n

Usage

\n

Request builders are functions that produce Fetch Options.\nThey take a few contextual inputs about the request you want to make, abstracting away the gnarlier details.

\n

For instance, to fetch a resource from your API

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import { findRecord } from '@ember-data/rest/request';\n\nconst options = findRecord('ember-developer', '1', { include: ['pets', 'friends'] });\n\n/*\n => {\n   url: 'https://api.example.com/v1/emberDevelopers/1?include=friends,pets',\n   method: 'GET',\n   headers: <Headers>, // 'Content-Type': 'application/json; charset=utf-8'\n   op: 'findRecord';\n   records: [{ type: 'ember-developer', id: '1' }]\n }\n/
\n
\n
\n \n

Request builder output is ready to go for use with store.request,\nmanager.request and most conventional REST APIs.

\n

Resource types are pluralized and camelized for the url.

\n

URLs are stable. The same query will produce the same URL every time, even if the order of keys in\nthe query or values in an array changes.

\n

URLs follow the most common REST format (camelCase pluralized resource types).

\n

Available Builders

\n\n", + "itemtype": "main", + "parent": null, + "publicclasses": [], + "privateclasses": [], + "staticfunctions": { + "@ember-data/rest/request": [ + { + "file": "../packages/rest/src/-private/builders/save-record.ts", + "line": 107, + "description": "Builds request options to create new record for resources,\nconfigured for the url, method and header expectations of most REST APIs.\n\n**Basic Usage**\n\n```ts\nimport { createRecord } from '@ember-data/rest/request';\n\nconst person = this.store.createRecord('person', { name: 'Ted' });\nconst data = await store.request(createRecord(person));\n```\n\n**Supplying Options to Modify the Request Behavior**\n\nThe following options are supported:\n\n- `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.\n- `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.\n- `resourcePath` - The resource path to use for the request, defaults to pluralizing the supplied type\n- `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to `false` if none is configured.\n- `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to `false` if none is configured.\n- `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)\n\n```ts\nimport { createRecord } from '@ember-data/rest/request';\n\nconst person = this.store.createRecord('person', { name: 'Ted' });\nconst options = createRecord(person, { namespace: 'api/v1' });\nconst data = await store.request(options);\n```", + "itemtype": "method", + "name": "createRecord", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "record", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/rest/request", + "module": "@ember-data/rest/request" + }, + { + "file": "../packages/rest/src/-private/builders/save-record.ts", + "line": 27, + "description": "Builds request options to delete record for resources,\nconfigured for the url, method and header expectations of REST APIs.\n\n**Basic Usage**\n\n```ts\nimport { deleteRecord } from '@ember-data/rest/request';\n\nconst person = this.store.peekRecord('person', '1');\n\n// mark record as deleted\nstore.deleteRecord(person);\n\n// persist deletion\nconst data = await store.request(deleteRecord(person));\n```\n\n**Supplying Options to Modify the Request Behavior**\n\nThe following options are supported:\n\n- `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.\n- `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.\n- `resourcePath` - The resource path to use for the request, defaults to pluralizing the supplied type\n- `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to `false` if none is configured.\n- `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to `false` if none is configured.\n- `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)\n\n```ts\nimport { deleteRecord } from '@ember-data/rest/request';\n\nconst person = this.store.peekRecord('person', '1');\n\n// mark record as deleted\nstore.deleteRecord(person);\n\n// persist deletion\nconst options = deleteRecord(person, { namespace: 'api/v1' });\nconst data = await store.request(options);\n```", + "itemtype": "method", + "name": "deleteRecord", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "record", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/rest/request", + "module": "@ember-data/rest/request" + }, + { + "file": "../packages/rest/src/-private/builders/find-record.ts", + "line": 21, + "description": "Builds request options to fetch a single resource by a known id or identifier\nconfigured for the url and header expectations of most REST APIs.\n\n**Basic Usage**\n\n```ts\nimport { findRecord } from '@ember-data/rest/request';\n\nconst data = await store.request(findRecord('person', '1'));\n```\n\n**With Options**\n\n```ts\nimport { findRecord } from '@ember-data/rest/request';\n\nconst options = findRecord('person', '1', { include: ['pets', 'friends'] });\nconst data = await store.request(options);\n```\n\n**With an Identifier**\n\n```ts\nimport { findRecord } from '@ember-data/rest/request';\n\nconst options = findRecord({ type: 'person', id: '1' }, { include: ['pets', 'friends'] });\nconst data = await store.request(options);\n```\n\n**Supplying Options to Modify the Request Behavior**\n\nThe following options are supported:\n\n- `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.\n- `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.\n- `resourcePath` - The resource path to use for the request, defaults to pluralizing and camelCasing the supplied type\n- `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to `false` if none is configured.\n- `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to `false` if none is configured.\n- `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)\n\n```ts\nimport { findRecord } from '@ember-data/rest/request';\n\nconst options = findRecord('person', '1', { include: ['pets', 'friends'] }, { namespace: 'api/v2' });\nconst data = await store.request(options);\n```", + "itemtype": "method", + "name": "findRecord", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/rest/request", + "module": "@ember-data/rest/request" + }, + { + "file": "../packages/rest/src/-private/builders/query.ts", + "line": 13, + "description": "Builds request options to query for resources, usually by a primary\ntype, configured for the url and header expectations of most REST APIs.\n\n**Basic Usage**\n\n```ts\nimport { query } from '@ember-data/rest/request';\n\nconst data = await store.request(query('person'));\n```\n\n**With Query Params**\n\n```ts\nimport { query } from '@ember-data/rest/request';\n\nconst options = query('person', { include: ['pets', 'friends'] });\nconst data = await store.request(options);\n```\n\n**Supplying Options to Modify the Request Behavior**\n\nThe following options are supported:\n\n- `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.\n- `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.\n- `resourcePath` - The resource path to use for the request, defaults to pluralizing and camelCasing the supplied type\n- `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to `false` if none is configured.\n- `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to `false` if none is configured.\n- `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)\n\n```ts\nimport { query } from '@ember-data/rest/request';\n\nconst options = query('person', { include: ['pets', 'friends'] }, { reload: true });\nconst data = await store.request(options);\n```", + "itemtype": "method", + "name": "query", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "query", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/rest/request", + "module": "@ember-data/rest/request" + }, + { + "file": "../packages/rest/src/-private/builders/save-record.ts", + "line": 176, + "description": "Builds request options to update existing record for resources,\nconfigured for the url, method and header expectations of most REST APIs.\n\n**Basic Usage**\n\n```ts\nimport { updateRecord } from '@ember-data/rest/request';\n\nconst person = this.store.peekRecord('person', '1');\nperson.name = 'Chris';\nconst data = await store.request(updateRecord(person));\n```\n\n**Supplying Options to Modify the Request Behavior**\n\nThe following options are supported:\n\n- `patch` - Allows caller to specify whether to use a PATCH request instead of a PUT request, defaults to `false`.\n- `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.\n- `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.\n- `resourcePath` - The resource path to use for the request, defaults to pluralizing the supplied type\n- `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to `false` if none is configured.\n- `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to `false` if none is configured.\n- `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)\n\n```ts\nimport { updateRecord } from '@ember-data/rest/request';\n\nconst person = this.store.peekRecord('person', '1');\nperson.name = 'Chris';\nconst options = updateRecord(person, { patch: true });\nconst data = await store.request(options);\n```", + "itemtype": "method", + "name": "updateRecord", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "record", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/rest/request", + "module": "@ember-data/rest/request" + } + ] + }, + "allstaticfunctions": { + "@ember-data/rest/request": [ + { + "file": "../packages/rest/src/-private/builders/save-record.ts", + "line": 107, + "description": "Builds request options to create new record for resources,\nconfigured for the url, method and header expectations of most REST APIs.\n\n**Basic Usage**\n\n```ts\nimport { createRecord } from '@ember-data/rest/request';\n\nconst person = this.store.createRecord('person', { name: 'Ted' });\nconst data = await store.request(createRecord(person));\n```\n\n**Supplying Options to Modify the Request Behavior**\n\nThe following options are supported:\n\n- `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.\n- `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.\n- `resourcePath` - The resource path to use for the request, defaults to pluralizing the supplied type\n- `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to `false` if none is configured.\n- `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to `false` if none is configured.\n- `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)\n\n```ts\nimport { createRecord } from '@ember-data/rest/request';\n\nconst person = this.store.createRecord('person', { name: 'Ted' });\nconst options = createRecord(person, { namespace: 'api/v1' });\nconst data = await store.request(options);\n```", + "itemtype": "method", + "name": "createRecord", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "record", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/rest/request", + "module": "@ember-data/rest/request" + }, + { + "file": "../packages/rest/src/-private/builders/save-record.ts", + "line": 27, + "description": "Builds request options to delete record for resources,\nconfigured for the url, method and header expectations of REST APIs.\n\n**Basic Usage**\n\n```ts\nimport { deleteRecord } from '@ember-data/rest/request';\n\nconst person = this.store.peekRecord('person', '1');\n\n// mark record as deleted\nstore.deleteRecord(person);\n\n// persist deletion\nconst data = await store.request(deleteRecord(person));\n```\n\n**Supplying Options to Modify the Request Behavior**\n\nThe following options are supported:\n\n- `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.\n- `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.\n- `resourcePath` - The resource path to use for the request, defaults to pluralizing the supplied type\n- `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to `false` if none is configured.\n- `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to `false` if none is configured.\n- `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)\n\n```ts\nimport { deleteRecord } from '@ember-data/rest/request';\n\nconst person = this.store.peekRecord('person', '1');\n\n// mark record as deleted\nstore.deleteRecord(person);\n\n// persist deletion\nconst options = deleteRecord(person, { namespace: 'api/v1' });\nconst data = await store.request(options);\n```", + "itemtype": "method", + "name": "deleteRecord", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "record", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/rest/request", + "module": "@ember-data/rest/request" + }, + { + "file": "../packages/rest/src/-private/builders/find-record.ts", + "line": 21, + "description": "Builds request options to fetch a single resource by a known id or identifier\nconfigured for the url and header expectations of most REST APIs.\n\n**Basic Usage**\n\n```ts\nimport { findRecord } from '@ember-data/rest/request';\n\nconst data = await store.request(findRecord('person', '1'));\n```\n\n**With Options**\n\n```ts\nimport { findRecord } from '@ember-data/rest/request';\n\nconst options = findRecord('person', '1', { include: ['pets', 'friends'] });\nconst data = await store.request(options);\n```\n\n**With an Identifier**\n\n```ts\nimport { findRecord } from '@ember-data/rest/request';\n\nconst options = findRecord({ type: 'person', id: '1' }, { include: ['pets', 'friends'] });\nconst data = await store.request(options);\n```\n\n**Supplying Options to Modify the Request Behavior**\n\nThe following options are supported:\n\n- `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.\n- `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.\n- `resourcePath` - The resource path to use for the request, defaults to pluralizing and camelCasing the supplied type\n- `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to `false` if none is configured.\n- `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to `false` if none is configured.\n- `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)\n\n```ts\nimport { findRecord } from '@ember-data/rest/request';\n\nconst options = findRecord('person', '1', { include: ['pets', 'friends'] }, { namespace: 'api/v2' });\nconst data = await store.request(options);\n```", + "itemtype": "method", + "name": "findRecord", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/rest/request", + "module": "@ember-data/rest/request" + }, + { + "file": "../packages/rest/src/-private/builders/query.ts", + "line": 13, + "description": "Builds request options to query for resources, usually by a primary\ntype, configured for the url and header expectations of most REST APIs.\n\n**Basic Usage**\n\n```ts\nimport { query } from '@ember-data/rest/request';\n\nconst data = await store.request(query('person'));\n```\n\n**With Query Params**\n\n```ts\nimport { query } from '@ember-data/rest/request';\n\nconst options = query('person', { include: ['pets', 'friends'] });\nconst data = await store.request(options);\n```\n\n**Supplying Options to Modify the Request Behavior**\n\nThe following options are supported:\n\n- `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.\n- `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.\n- `resourcePath` - The resource path to use for the request, defaults to pluralizing and camelCasing the supplied type\n- `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to `false` if none is configured.\n- `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to `false` if none is configured.\n- `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)\n\n```ts\nimport { query } from '@ember-data/rest/request';\n\nconst options = query('person', { include: ['pets', 'friends'] }, { reload: true });\nconst data = await store.request(options);\n```", + "itemtype": "method", + "name": "query", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "query", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/rest/request", + "module": "@ember-data/rest/request" + }, + { + "file": "../packages/rest/src/-private/builders/save-record.ts", + "line": 176, + "description": "Builds request options to update existing record for resources,\nconfigured for the url, method and header expectations of most REST APIs.\n\n**Basic Usage**\n\n```ts\nimport { updateRecord } from '@ember-data/rest/request';\n\nconst person = this.store.peekRecord('person', '1');\nperson.name = 'Chris';\nconst data = await store.request(updateRecord(person));\n```\n\n**Supplying Options to Modify the Request Behavior**\n\nThe following options are supported:\n\n- `patch` - Allows caller to specify whether to use a PATCH request instead of a PUT request, defaults to `false`.\n- `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.\n- `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.\n- `resourcePath` - The resource path to use for the request, defaults to pluralizing the supplied type\n- `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to `false` if none is configured.\n- `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to `false` if none is configured.\n- `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)\n\n```ts\nimport { updateRecord } from '@ember-data/rest/request';\n\nconst person = this.store.peekRecord('person', '1');\nperson.name = 'Chris';\nconst options = updateRecord(person, { patch: true });\nconst data = await store.request(options);\n```", + "itemtype": "method", + "name": "updateRecord", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "record", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/rest/request", + "module": "@ember-data/rest/request" + } + ] + }, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/serializer.json b/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/serializer.json new file mode 100644 index 000000000..4cdb772c2 --- /dev/null +++ b/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/serializer.json @@ -0,0 +1,42 @@ +{ + "data": { + "id": "ember-data-5.3.0-@ember-data/serializer", + "type": "module", + "attributes": { + "name": "@ember-data/serializer", + "submodules": {}, + "elements": {}, + "fors": {}, + "namespaces": {}, + "tag": "main", + "file": "../serializer/src/index.ts", + "line": 116, + "description": "

Overview

\n
\n

\n ⚠️ This is LEGACY documentation for a feature that is no longer encouraged to be used.\n If starting a new app or thinking of implementing a new serializer, consider writing a\n Handler instead to be used with the RequestManager\n

\n
\n\n

In order to properly manage and present your data, EmberData\nneeds to understand the structure of data it receives.

\n

Serializers convert data between the server's API format and\nthe format EmberData understands.

\n

Data received from an API response is normalized into\nJSON:API (the format used internally\nby EmberData), while data sent to an API is serialized\ninto the format the API expects.

\n

Implementing a Serializer

\n

There are only two required serializer methods, one for\nnormalizing data from the server API format into JSON:API, and\nanother for serializing records via Snapshots into the expected\nserver API format.

\n

To implement a serializer, export a class that conforms to the structure\ndescribed by Serializer\nfrom the app/serializers/ directory. An example is below.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import EmberObject from '@ember/object';\n\nexport default class ApplicationSerializer extends EmberObject {\n  normalizeResponse(store, schema, rawPayload) {\n    return rawPayload;\n  }\n\n  serialize(snapshot, options) {\n    const serializedResource = {\n      id: snapshot.id,\n      type: snapshot.modelName,\n      attributes: snapshot.attributes()\n    };\n\n    return serializedResource;\n  }\n}
\n
\n
\n \n

Serializer Resolution

\n

store.serializerFor(name) will lookup serializers defined in\napp/serializers/ and return an instance. If no serializer is found, an\nerror will be thrown.

\n

serializerFor first attempts to find a serializer with an exact match on name,\nthen falls back to checking for the presence of a serializer named application.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
store.serializerFor('author');\n\n// lookup paths (in order) =>\n//   app/serializers/author.js\n//   app/serializers/application.js
\n
\n
\n \n

Most requests in EmberData are made with respect to a particular type (or modelName)\n(e.g., "get me the full collection of books" or "get me the employee whose id is 37"). We\nrefer to this as the primary resource type.

\n

Typically serializerFor will be used to find a serializer with a name matching that of the primary\nresource type for the request, falling back to the application serializer for those types that\ndo not have a defined serializer. This is often described as a per-model or per-type strategy\nfor defining serializers. However, because APIs rarely format payloads per-type but rather\nper-API-version, this may not be a desired strategy.

\n

It is recommended that applications define only a single application adapter and serializer\nwhere possible.

\n

If you have multiple API formats and the per-type strategy is not viable, one strategy is to\nwrite an application adapter and serializer that make use of options to specify the desired\nformat when making a request.

\n

Using a Serializer

\n

Any serializer in app/serializers/ can be looked up by name using store.serializerFor(name).

\n

Default Serializers

\n

For applications whose APIs are very close to or exactly the REST format or JSON:API\nformat the @ember-data/serializer package contains implementations these applications can\nextend. It also contains a simple JSONSerializer for serializing to/from very basic JSON objects.

\n

Many applications will find writing their own serializer to be more performant and less\ncomplex than extending these classes even when their API format is very close to that expected\nby these serializers.

\n

It is recommended that apps write their own serializer to best suit the needs of their API and\napplication.

\n", + "itemtype": "main", + "parent": null, + "publicclasses": [ + "BooleanTransform", + "DateTransform", + "NumberTransform", + "StringTransform", + "Transform", + "Serializer" + ], + "privateclasses": [], + "staticfunctions": {}, + "allstaticfunctions": {}, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/serializer/json-api.json b/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/serializer/json-api.json new file mode 100644 index 000000000..a01707e58 --- /dev/null +++ b/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/serializer/json-api.json @@ -0,0 +1,40 @@ +{ + "data": { + "id": "ember-data-5.3.0-@ember-data/serializer/json-api", + "type": "module", + "attributes": { + "name": "@ember-data/serializer/json-api", + "submodules": {}, + "elements": {}, + "fors": {}, + "namespaces": {}, + "tag": "main", + "file": "../serializer/src/json-api.js", + "line": 13, + "description": "
\n

\n ⚠️ This is LEGACY documentation for a feature that is no longer encouraged to be used.\n If starting a new app or thinking of implementing a new adapter, consider writing a\n Handler instead to be used with the RequestManager\n

\n
\n\n

In EmberData a Serializer is used to serialize and deserialize\n records when they are transferred in and out of an external source.\n This process involves normalizing property names, transforming\n attribute values and serializing relationships.

\n

JSONAPISerializer supports the http://jsonapi.org/ spec and is the\n serializer recommended by Ember Data.

\n

This serializer normalizes a JSON API payload that looks like:

\n

```app/models/player.js\n import Model, { attr, belongsTo } from '@ember-data/model';

\n

export default class Player extends Model {

\n", + "attr": "('string') location;", + "belongsto": "('club') club;\n }\n ```\n\n ```app/models/club.js\n import Model, { attr, hasMany } from '@ember-data/model';\n\n export default class Club extends Model {", + "hasmany": "('player') players;\n }\n ```\n\n ```js\n {\n \"data\": [\n {\n \"attributes\": {\n \"name\": \"Benfica\",\n \"location\": \"Portugal\"\n },\n \"id\": \"1\",\n \"relationships\": {\n \"players\": {\n \"data\": [\n {\n \"id\": \"3\",\n \"type\": \"players\"\n }\n ]\n }\n },\n \"type\": \"clubs\"\n }\n ],\n \"included\": [\n {\n \"attributes\": {\n \"name\": \"Eusebio Silva Ferreira\",\n \"skill\": \"Rocket shot\",\n \"games-played\": 431\n },\n \"id\": \"3\",\n \"relationships\": {\n \"club\": {\n \"data\": {\n \"id\": \"1\",\n \"type\": \"clubs\"\n }\n }\n },\n \"type\": \"players\"\n }\n ]\n }\n ```\n\n to the format that the Ember Data store expects.\n\n ### Customizing meta\n\n Since a JSON API Document can have meta defined in multiple locations you can\n use the specific serializer hooks if you need to customize the meta.\n\n One scenario would be to camelCase the meta keys of your payload. The example\n below shows how this could be done using `normalizeArrayResponse` and\n `extractRelationship`.\n\n ```app/serializers/application.js\n import JSONAPISerializer from '@ember-data/serializer/json-api';\n\n export default class ApplicationSerializer extends JSONAPISerializer {\n normalizeArrayResponse(store, primaryModelClass, payload, id, requestType) {\n let normalizedDocument = super.normalizeArrayResponse(...arguments);\n\n // Customize document meta\n normalizedDocument.meta = camelCaseKeys(normalizedDocument.meta);\n\n return normalizedDocument;\n }\n\n extractRelationship(relationshipHash) {\n let normalizedRelationship = super.extractRelationship(...arguments);\n\n // Customize relationship meta\n normalizedRelationship.meta = camelCaseKeys(normalizedRelationship.meta);\n\n return normalizedRelationship;\n }\n }\n ```", + "itemtype": "main", + "parent": null, + "publicclasses": [ + "JSONAPISerializer" + ], + "privateclasses": [], + "staticfunctions": {}, + "allstaticfunctions": {}, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/serializer/json.json b/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/serializer/json.json new file mode 100644 index 000000000..488ddd42f --- /dev/null +++ b/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/serializer/json.json @@ -0,0 +1,40 @@ +{ + "data": { + "id": "ember-data-5.3.0-@ember-data/serializer/json", + "type": "module", + "attributes": { + "name": "@ember-data/serializer/json", + "submodules": {}, + "elements": {}, + "fors": {}, + "namespaces": {}, + "tag": "main", + "file": "../serializer/src/json.js", + "line": 17, + "description": "
\n

\n ⚠️ This is LEGACY documentation for a feature that is no longer encouraged to be used.\n If starting a new app or thinking of implementing a new adapter, consider writing a\n Handler instead to be used with the RequestManager\n

\n
\n\n

In EmberData a Serializer is used to serialize and deserialize\n records when they are transferred in and out of an external source.\n This process involves normalizing property names, transforming\n attribute values and serializing relationships.

\n

By default, EmberData uses and recommends the JSONAPISerializer.

\n

JSONSerializer is useful for simpler or legacy backends that may\n not support the http://jsonapi.org/ spec.

\n

For example, given the following User model and JSON payload:

\n

```app/models/user.js\n import Model, { attr, belongsTo, hasMany } from '@ember-data/model';

\n

export default class UserModel extends Model {

\n", + "hasmany": "('user') friends;", + "belongsto": "('location') house;", + "attr": "('string') name;\n }\n ```\n\n ```js\n {\n id: 1,\n name: 'Sebastian',\n friends: [3, 4],\n links: {\n house: '/houses/lefkada'\n }\n }\n ```\n\n `JSONSerializer` will normalize the JSON payload to the JSON API format that the\n Ember Data store expects.\n\n You can customize how JSONSerializer processes its payload by passing options in\n the `attrs` hash or by subclassing the `JSONSerializer` and overriding hooks:\n\n - To customize how a single record is normalized, use the `normalize` hook.\n - To customize how `JSONSerializer` normalizes the whole server response, use the\n `normalizeResponse` hook.\n - To customize how `JSONSerializer` normalizes a specific response from the server,\n use one of the many specific `normalizeResponse` hooks.\n - To customize how `JSONSerializer` normalizes your id, attributes or relationships,\n use the `extractId`, `extractAttributes` and `extractRelationships` hooks.\n\n The `JSONSerializer` normalization process follows these steps:\n\n 1. `normalizeResponse`\n - entry method to the serializer.\n 2. `normalizeCreateRecordResponse`\n - a `normalizeResponse` for a specific operation is called.\n 3. `normalizeSingleResponse`|`normalizeArrayResponse`\n - for methods like `createRecord` we expect a single record back, while for methods like `findAll` we expect multiple records back.\n 4. `normalize`\n - `normalizeArrayResponse` iterates and calls `normalize` for each of its records while `normalizeSingle`\n calls it once. This is the method you most likely want to subclass.\n 5. `extractId` | `extractAttributes` | `extractRelationships`\n - `normalize` delegates to these methods to\n turn the record payload into the JSON API format.", + "itemtype": "main", + "parent": null, + "publicclasses": [ + "JSONSerializer" + ], + "privateclasses": [], + "staticfunctions": {}, + "allstaticfunctions": {}, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/serializer/rest.json b/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/serializer/rest.json new file mode 100644 index 000000000..b8b1796df --- /dev/null +++ b/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/serializer/rest.json @@ -0,0 +1,38 @@ +{ + "data": { + "id": "ember-data-5.3.0-@ember-data/serializer/rest", + "type": "module", + "attributes": { + "name": "@ember-data/serializer/rest", + "submodules": {}, + "elements": {}, + "fors": {}, + "namespaces": {}, + "tag": "main", + "file": "../serializer/src/rest.js", + "line": 18, + "description": "
\n

\n ⚠️ This is LEGACY documentation for a feature that is no longer encouraged to be used.\n If starting a new app or thinking of implementing a new adapter, consider writing a\n Handler instead to be used with the RequestManager\n

\n
\n\n

Normally, applications will use the RESTSerializer by implementing\n the normalize method.

\n

This allows you to do whatever kind of munging you need and is\n especially useful if your server is inconsistent and you need to\n do munging differently for many different kinds of responses.

\n

See the normalize documentation for more information.

\n

Across the Board Normalization

\n

There are also a number of hooks that you might find useful to define\n across-the-board rules for your payload. These rules will be useful\n if your server is consistent, or if you're building an adapter for\n an infrastructure service, like Firebase, and want to encode service\n conventions.

\n

For example, if all of your keys are underscored and all-caps, but\n otherwise consistent with the names you use in your models, you\n can implement across-the-board rules for how to convert an attribute\n name in your model to a key in your JSON.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/serializers/application.js
1\n2\n3\n4\n5\n6\n7\n8\n
 import RESTSerializer from '@ember-data/serializer/rest';\n import { underscore } from '<app-name>/utils/string-utils';\n\n export default class ApplicationSerializer extends RESTSerializer {\n   keyForAttribute(attr, method) {\n     return underscore(attr).toUpperCase();\n   }\n }
\n
\n
\n \n

You can also implement keyForRelationship, which takes the name\n of the relationship as the first parameter, the kind of\n relationship (hasMany or belongsTo) as the second parameter, and\n the method (serialize or deserialize) as the third parameter.

\n", + "itemtype": "main", + "parent": null, + "publicclasses": [ + "EmbeddedRecordsMixin", + "RESTSerializer" + ], + "privateclasses": [], + "staticfunctions": {}, + "allstaticfunctions": {}, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/store.json b/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/store.json new file mode 100644 index 000000000..89f2002b1 --- /dev/null +++ b/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/store.json @@ -0,0 +1,247 @@ +{ + "data": { + "id": "ember-data-5.3.0-@ember-data/store", + "type": "module", + "attributes": { + "name": "@ember-data/store", + "submodules": {}, + "elements": {}, + "fors": { + "@ember-data/store": 1 + }, + "namespaces": {}, + "tag": "main", + "file": "../store/src/-private/store-service.ts", + "line": 71, + "description": "

\n \"EmberData\n

\n\n

This package provides Ember**Data**'s Store class.

\n

A Store coordinates interaction between your application, a Cache,\nand sources of data (such as your API or a local persistence layer) accessed via a RequestManager.

\n

Optionally, a Store can be configured to hydrate the response data into rich presentation classes.

\n

Installation

\n

If you have installed ember-data then you already have this package installed.\nOtherwise you can install it using your javascript package manager of choice.\nFor instance with pnpm

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
pnpm add @ember-data/store
\n
\n
\n

After installing you will want to configure your first Store. Read more below\nfor how to create and configure stores for your application.

\n

🔨 Creating A Store

\n

To use a Store we will need to do few things: add a Cache\nto store data in-memory, add a Handler to fetch data from a source,\nand implement instantiateRecord to tell the store how to display the data for individual resources.

\n
\n

Note If you are using the package ember-data then a JSON:API cache, RequestManager, LegacyNetworkHandler,\nand instantiateRecord are configured for you by default.

\n
\n

Configuring A Cache

\n

To start, let's install a JSON:API cache. If your app uses GraphQL or REST other\ncaches may better fit your data. You can author your own cache by creating one that\nconforms to the spec.

\n

The package @ember-data/json-api provides a JSON:API cache we can use.\nAfter installing it, we can configure the store to use this cache.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import Store from '@ember-data/store';\nimport Cache from '@ember-data/json-api';\n\nclass extends Store {\n  createCache(storeWrapper) {\n    return new Cache(storeWrapper);\n  }\n}
\n
\n
\n \n

Now that we have a cache let's setup something to handle fetching\nand saving data via our API.

\n
\n

Note The ember-data package automatically includes and configures\nthe @ember-data/json-api cache for you.

\n
\n

Handling Requests

\n

When Ember**Data** needs to fetch or save data it will pass that request to your application's RequestManager for fulfillment. How this fulfillment occurs (in-memory, device storage, via single or multiple API requests, etc.) is then up to the registered request handlers.

\n

To start, let's install the RequestManager from @ember-data/request and the basic Fetch handler from ``@ember-data/request/fetch`.

\n
\n

Note If your app uses GraphQL, REST or different conventions for JSON:API than your cache expects, other handlers may better fit your data. You can author your own handler by creating one that conforms to the handler interface.

\n
\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Store from '@ember-data/store';\nimport RequestManager from '@ember-data/request';\nimport Fetch from '@ember-data/request/fetch';\n\nexport default class extends Store {\n  constructor() {\n    super(...arguments);\n    this.requestManager = new RequestManager();\n    this.requestManager.use([Fetch]);\n  }\n}
\n
\n
\n \n

Using RequestManager as a Service

\n

Alternatively if you have configured the RequestManager to be a service you may re-use it.

\n

app/services/request.js

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import RequestManager from '@ember-data/request';\nimport Fetch from '@ember-data/request/fetch';\n\nexport default class extends RequestManager {\n  constructor(createArgs) {\n    super(createArgs);\n    this.use([Fetch]);\n  }\n}
\n
\n
\n \n

app/services/store.js

\n

```ts\nimport Store from '@ember-data/store';\nimport { service } from '@ember/service';

\n

export default class extends Store {

\n", + "service": "('request') requestManager\n}\n```\n\n\n### Presenting Data from the Cache\n\nNow that we have a source and a cach for our data, we need to configure how\nthe Store delivers that data back to our application. We do this via the hook\n[instantiateRecord](https://api.emberjs.com/ember-data/release/classes/Store/methods/instantiateRecord%20(hook)?anchor=instantiateRecord%20(hook)),\nwhich allows us to transform the data for a resource before handing it to the application.\n\nA naive way to present the data would be to return it as JSON. Typically instead\nthis hook will be used to add reactivity and make each unique resource a singleton,\nensuring that if the cache updates our presented data will reflect the new state.\n\nBelow is an example of using the hooks `instantiateRecord` and a `teardownRecord`\nto provide minimal read-only reactive state for simple resources.\n\n```ts\nimport Store, { recordIdentifierFor } from '@ember-data/store';\nimport { TrackedObject } from 'tracked-built-ins';\n\nclass extends Store {\n instantiateRecord(identifier) {\n const { cache, notifications } = this;\n\n // create a TrackedObject with our attributes, id and type\n const record = new TrackedObject(Object.assign({}, cache.peek(identifier)));\n record.type = identifier.type;\n record.id = identifier.id;\n\n notifications.subscribe(identifier, (_, change) => {\n if (change === 'attributes') {\n Object.assign(record, cache.peek(identifier));\n }\n });\n\n return record;\n }\n}\n```\n\nBecause `instantiateRecord` is opaque to the nature of the record, an implementation\ncan be anything from a fairly simple object to a robust proxy that intelligently links\ntogether associated records through relationships.\n\nThis also enables creating a record that separates `edit` flows from `create` flows\nentirely. A record class might choose to implement a `checkout`method that gives access\nto an editable instance while the primary record continues to be read-only and reflect\nonly persisted (non-mutated) state.\n\nTypically you will choose an existing record implementation such as `@ember-data/model`\nfor your application.\n\nBecause of the boundaries around instantiation and the cache, record implementations\nshould be capable of interop both with each other and with any `Cache`. Due to this,\nif needed an application can utilize multiple record implementations and multiple cache\nimplementations either to support enhanced features for only a subset of records or to\nbe able to incrementally migrate from one record/cache to another record or cache.\n\n> **Note:** The `ember-data` package automatically includes the `@ember-data/model`\n> package and configures it for you.", + "itemtype": "main", + "parent": null, + "publicclasses": [ + "CacheCapabilitiesManager", + "StableRecordIdentifier", + "SchemaService", + "Snapshot", + "ManyArray", + "IdentifierCache", + "RecordReference", + "CacheManager", + "NotificationManager", + "RequestStateService", + "RecordArray", + "Store" + ], + "privateclasses": [], + "staticfunctions": { + "@ember-data/store": [ + { + "file": "../packages/store/src/-private/caches/instance-cache.ts", + "line": 34, + "description": "Retrieves the unique referentially-stable [RecordIdentifier](/ember-data/release/classes/StableRecordIdentifier)\nassigned to the given record instance.\n```js\nimport { recordIdentifierFor } from \"@ember-data/store\";\n// ... gain access to a record, for instance with peekRecord or findRecord\nconst record = store.peekRecord(\"user\", \"1\");\n// get the identifier for the record (see docs for StableRecordIdentifier)\nconst identifier = recordIdentifierFor(record);\n// access the identifier's properties.\nconst { id, type, lid } = identifier;\n```", + "itemtype": "method", + "name": "recordIdentifierFor", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "record", + "description": "a record instance previously obstained from the store.", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "StableRecordIdentifier" + }, + "class": "@ember-data/store", + "module": "@ember-data/store" + }, + { + "file": "../ember-data-types/q/identifier.ts", + "line": 245, + "description": "Configure a callback for when the identifier cache is going to release an identifier.\n\nThis configuration MUST occur prior to the store instance being created.\n\n```js\nimport { setIdentifierForgetMethod } from '@ember-data/store';\n```\n\nTakes method which can expect to receive an existing `Identifier` that should be eliminated\nfrom any secondary lookup tables or caches that the user has populated for it.", + "itemtype": "method", + "name": "setIdentifierForgetMethod", + "params": [ + { + "name": "method", + "description": "" + } + ], + "access": "public", + "tagname": "", + "static": 1, + "class": "@ember-data/store", + "module": "@ember-data/store" + }, + { + "file": "../ember-data-types/q/identifier.ts", + "line": 123, + "description": "Configures how unique identifier lid strings are generated by @ember-data/store.\n\nThis configuration MUST occur prior to the store instance being created.\n\nTakes a method which can expect to receive various data as its first argument\nand the name of a bucket as its second argument.\n\nCurrently there are two buckets, 'record' and 'document'.\n\n### Resource (`Record`) Identity\n\nIf the bucket is `record` the method must return a unique (to at-least\nthe given bucket) string identifier for the given data as a string to be\nused as the `lid` of an `Identifier` token.\n\nThis method will only be called by either `getOrCreateRecordIdentifier` or\n`createIdentifierForNewRecord` when an identifier for the supplied data\nis not already known via `lid` or `type + id` combo and one needs to be\ngenerated or retrieved from a proprietary cache.\n\n`data` will be the same data argument provided to `getOrCreateRecordIdentifier`\nand in the `createIdentifierForNewRecord` case will be an object with\nonly `type` as a key.\n\n```ts\nimport { setIdentifierGenerationMethod } from '@ember-data/store';\n\nexport function initialize(applicationInstance) {\n // note how `count` here is now scoped to the application instance\n // for our generation method by being inside the closure provided\n // by the initialize function\n let count = 0;\n\n setIdentifierGenerationMethod((resource, bucket) => {\n return resource.lid || `my-key-${count++}`;\n });\n}\n\nexport default {\n name: 'configure-ember-data-identifiers',\n initialize\n};\n```\n\n### Document Identity\n\nIf the bucket is `document` the method will receive the associated\nimmutable `request` passed to `store.request` as its first argument\nand should return a unique string for the given request if the document\nshould be cached, and `null` if it should not be cached.\n\nNote, the request result will still be passed to the cache via `Cache.put`,\nbut caches should take this as a signal that the document should not itself\nbe cached, while its contents may still be used to update other cache state.\n\nThe presence of `cacheOptions.key` on the request will take precedence\nfor the document cache key, and this method will not be called if it is\npresent.\n\nThe default method implementation for this bucket is to return `null`\nfor all requests whose method is not `GET`, and to return the `url` for\nthose where it is.\n\nThis means that queries via `POST` MUST provide `cacheOptions.key` or\nimplement this hook.\n\n⚠️ Caution: Requests that do not have a `method` assigned are assumed to be `GET`", + "itemtype": "method", + "name": "setIdentifierGenerationMethod", + "params": [ + { + "name": "method", + "description": "" + } + ], + "access": "public", + "tagname": "", + "static": 1, + "class": "@ember-data/store", + "module": "@ember-data/store" + }, + { + "file": "../ember-data-types/q/identifier.ts", + "line": 265, + "description": "Configure a callback for when the identifier cache is being torn down.\n\nThis configuration MUST occur prior to the store instance being created.\n\n```js\nimport { setIdentifierResetMethod } from '@ember-data/store';\n```\n\nTakes a method which can expect to be called when the parent application is destroyed.\n\nIf you have properly used a WeakMap to encapsulate the state of your customization\nto the application instance, you may not need to implement the `resetMethod`.", + "itemtype": "method", + "name": "setIdentifierResetMethod", + "params": [ + { + "name": "method", + "description": "" + } + ], + "access": "public", + "tagname": "", + "static": 1, + "class": "@ember-data/store", + "module": "@ember-data/store" + }, + { + "file": "../ember-data-types/q/identifier.ts", + "line": 204, + "description": "Configure a callback for when the identifier cache encounters new resource\ndata for an existing resource.\n\nThis configuration MUST occur prior to the store instance being created.\n\n```js\nimport { setIdentifierUpdateMethod } from '@ember-data/store';\n```\n\nTakes a method which can expect to receive an existing `Identifier` alongside\nsome new data to consider as a second argument. This is an opportunity\nfor secondary lookup tables and caches associated with the identifier\nto be amended.\n\nThis method is called everytime `updateRecordIdentifier` is called and\n with the same arguments. It provides the opportunity to update secondary\n lookup tables for existing identifiers.\n\nIt will always be called after an identifier created with `createIdentifierForNewRecord`\n has been committed, or after an update to the `record` a `RecordIdentifier`\n is assigned to has been committed. Committed here meaning that the server\n has acknowledged the update (for instance after a call to `.save()`)\n\nIf `id` has not previously existed, it will be assigned to the `Identifier`\n prior to this `UpdateMethod` being called; however, calls to the parent method\n `updateRecordIdentifier` that attempt to change the `id` or calling update\n without providing an `id` when one is missing will throw an error.", + "itemtype": "method", + "name": "setIdentifierUpdateMethod", + "params": [ + { + "name": "method", + "description": "" + } + ], + "access": "public", + "tagname": "", + "static": 1, + "class": "@ember-data/store", + "module": "@ember-data/store" + } + ] + }, + "allstaticfunctions": { + "@ember-data/store": [ + { + "file": "../packages/store/src/-private/caches/instance-cache.ts", + "line": 34, + "description": "Retrieves the unique referentially-stable [RecordIdentifier](/ember-data/release/classes/StableRecordIdentifier)\nassigned to the given record instance.\n```js\nimport { recordIdentifierFor } from \"@ember-data/store\";\n// ... gain access to a record, for instance with peekRecord or findRecord\nconst record = store.peekRecord(\"user\", \"1\");\n// get the identifier for the record (see docs for StableRecordIdentifier)\nconst identifier = recordIdentifierFor(record);\n// access the identifier's properties.\nconst { id, type, lid } = identifier;\n```", + "itemtype": "method", + "name": "recordIdentifierFor", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "record", + "description": "a record instance previously obstained from the store.", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "StableRecordIdentifier" + }, + "class": "@ember-data/store", + "module": "@ember-data/store" + }, + { + "file": "../ember-data-types/q/identifier.ts", + "line": 245, + "description": "Configure a callback for when the identifier cache is going to release an identifier.\n\nThis configuration MUST occur prior to the store instance being created.\n\n```js\nimport { setIdentifierForgetMethod } from '@ember-data/store';\n```\n\nTakes method which can expect to receive an existing `Identifier` that should be eliminated\nfrom any secondary lookup tables or caches that the user has populated for it.", + "itemtype": "method", + "name": "setIdentifierForgetMethod", + "params": [ + { + "name": "method", + "description": "" + } + ], + "access": "public", + "tagname": "", + "static": 1, + "class": "@ember-data/store", + "module": "@ember-data/store" + }, + { + "file": "../ember-data-types/q/identifier.ts", + "line": 123, + "description": "Configures how unique identifier lid strings are generated by @ember-data/store.\n\nThis configuration MUST occur prior to the store instance being created.\n\nTakes a method which can expect to receive various data as its first argument\nand the name of a bucket as its second argument.\n\nCurrently there are two buckets, 'record' and 'document'.\n\n### Resource (`Record`) Identity\n\nIf the bucket is `record` the method must return a unique (to at-least\nthe given bucket) string identifier for the given data as a string to be\nused as the `lid` of an `Identifier` token.\n\nThis method will only be called by either `getOrCreateRecordIdentifier` or\n`createIdentifierForNewRecord` when an identifier for the supplied data\nis not already known via `lid` or `type + id` combo and one needs to be\ngenerated or retrieved from a proprietary cache.\n\n`data` will be the same data argument provided to `getOrCreateRecordIdentifier`\nand in the `createIdentifierForNewRecord` case will be an object with\nonly `type` as a key.\n\n```ts\nimport { setIdentifierGenerationMethod } from '@ember-data/store';\n\nexport function initialize(applicationInstance) {\n // note how `count` here is now scoped to the application instance\n // for our generation method by being inside the closure provided\n // by the initialize function\n let count = 0;\n\n setIdentifierGenerationMethod((resource, bucket) => {\n return resource.lid || `my-key-${count++}`;\n });\n}\n\nexport default {\n name: 'configure-ember-data-identifiers',\n initialize\n};\n```\n\n### Document Identity\n\nIf the bucket is `document` the method will receive the associated\nimmutable `request` passed to `store.request` as its first argument\nand should return a unique string for the given request if the document\nshould be cached, and `null` if it should not be cached.\n\nNote, the request result will still be passed to the cache via `Cache.put`,\nbut caches should take this as a signal that the document should not itself\nbe cached, while its contents may still be used to update other cache state.\n\nThe presence of `cacheOptions.key` on the request will take precedence\nfor the document cache key, and this method will not be called if it is\npresent.\n\nThe default method implementation for this bucket is to return `null`\nfor all requests whose method is not `GET`, and to return the `url` for\nthose where it is.\n\nThis means that queries via `POST` MUST provide `cacheOptions.key` or\nimplement this hook.\n\n⚠️ Caution: Requests that do not have a `method` assigned are assumed to be `GET`", + "itemtype": "method", + "name": "setIdentifierGenerationMethod", + "params": [ + { + "name": "method", + "description": "" + } + ], + "access": "public", + "tagname": "", + "static": 1, + "class": "@ember-data/store", + "module": "@ember-data/store" + }, + { + "file": "../ember-data-types/q/identifier.ts", + "line": 265, + "description": "Configure a callback for when the identifier cache is being torn down.\n\nThis configuration MUST occur prior to the store instance being created.\n\n```js\nimport { setIdentifierResetMethod } from '@ember-data/store';\n```\n\nTakes a method which can expect to be called when the parent application is destroyed.\n\nIf you have properly used a WeakMap to encapsulate the state of your customization\nto the application instance, you may not need to implement the `resetMethod`.", + "itemtype": "method", + "name": "setIdentifierResetMethod", + "params": [ + { + "name": "method", + "description": "" + } + ], + "access": "public", + "tagname": "", + "static": 1, + "class": "@ember-data/store", + "module": "@ember-data/store" + }, + { + "file": "../ember-data-types/q/identifier.ts", + "line": 204, + "description": "Configure a callback for when the identifier cache encounters new resource\ndata for an existing resource.\n\nThis configuration MUST occur prior to the store instance being created.\n\n```js\nimport { setIdentifierUpdateMethod } from '@ember-data/store';\n```\n\nTakes a method which can expect to receive an existing `Identifier` alongside\nsome new data to consider as a second argument. This is an opportunity\nfor secondary lookup tables and caches associated with the identifier\nto be amended.\n\nThis method is called everytime `updateRecordIdentifier` is called and\n with the same arguments. It provides the opportunity to update secondary\n lookup tables for existing identifiers.\n\nIt will always be called after an identifier created with `createIdentifierForNewRecord`\n has been committed, or after an update to the `record` a `RecordIdentifier`\n is assigned to has been committed. Committed here meaning that the server\n has acknowledged the update (for instance after a call to `.save()`)\n\nIf `id` has not previously existed, it will be assigned to the `Identifier`\n prior to this `UpdateMethod` being called; however, calls to the parent method\n `updateRecordIdentifier` that attempt to change the `id` or calling update\n without providing an `id` when one is missing will throw an error.", + "itemtype": "method", + "name": "setIdentifierUpdateMethod", + "params": [ + { + "name": "method", + "description": "" + } + ], + "access": "public", + "tagname": "", + "static": 1, + "class": "@ember-data/store", + "module": "@ember-data/store" + } + ] + }, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/tracking.json b/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/tracking.json new file mode 100644 index 000000000..4967afdf6 --- /dev/null +++ b/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-@ember-data/tracking.json @@ -0,0 +1,169 @@ +{ + "data": { + "id": "ember-data-5.3.0-@ember-data/tracking", + "type": "module", + "attributes": { + "name": "@ember-data/tracking", + "submodules": {}, + "elements": {}, + "fors": { + "@ember-data/tracking": 1 + }, + "namespaces": {}, + "tag": "main", + "file": "../tracking/src/-private.ts", + "line": 3, + "description": "

This package provides primitives that allow powerful low-level\nadjustments to change tracking notification behaviors.

\n

Typically you want to use these primitives when you want to divorce\nproperty accesses on EmberData provided objects from the current\ntracking context. Typically this sort of thing occurs when serializing\ntracked data to send in a request: the data itself is often ancillary\nto the thing which triggered the request in the first place and you\nwould not want to re-trigger the request for any update to the data.

\n", + "itemtype": "main", + "parent": null, + "publicclasses": [], + "privateclasses": [], + "staticfunctions": { + "@ember-data/tracking": [ + { + "file": "../packages/tracking/src/-private.ts", + "line": 196, + "description": "A helpful utility for creating a new function that\nalways runs in a transaction. E.G. this \"memoizes\"\ncalling `transact(fn)`, currying args as necessary.", + "itemtype": "method", + "name": "memoTransact", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "method", + "description": "" + } + ], + "return": { + "description": "a function that will invoke method in a transaction with any provided args and return its result" + }, + "class": "@ember-data/tracking", + "module": "@ember-data/tracking" + }, + { + "file": "../packages/tracking/src/-private.ts", + "line": 173, + "description": "Run the method, subscribing to any tracked properties\nmanaged by EmberData that were accessed or written during\nthe method's execution as per-normal but while allowing\ninterleaving of reads and writes.\n\nThis is useful when for instance you want to perform\na mutation based on existing state that must be read first.", + "itemtype": "method", + "name": "transact", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "method", + "description": "" + } + ], + "return": { + "description": "result of invoking method" + }, + "class": "@ember-data/tracking", + "module": "@ember-data/tracking" + }, + { + "file": "../packages/tracking/src/-private.ts", + "line": 150, + "description": "Run `method` without subscribing to any tracked properties\ncontrolled by EmberData.\n\nThis should rarely be used except by libraries that really\nknow what they are doing. It is most useful for wrapping\ncertain kinds of fetch/query logic from within a `Resource`\n`hook` or other similar pattern.", + "itemtype": "method", + "name": "untracked", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "method", + "description": "" + } + ], + "return": { + "description": "result of invoking method" + }, + "class": "@ember-data/tracking", + "module": "@ember-data/tracking" + } + ] + }, + "allstaticfunctions": { + "@ember-data/tracking": [ + { + "file": "../packages/tracking/src/-private.ts", + "line": 196, + "description": "A helpful utility for creating a new function that\nalways runs in a transaction. E.G. this \"memoizes\"\ncalling `transact(fn)`, currying args as necessary.", + "itemtype": "method", + "name": "memoTransact", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "method", + "description": "" + } + ], + "return": { + "description": "a function that will invoke method in a transaction with any provided args and return its result" + }, + "class": "@ember-data/tracking", + "module": "@ember-data/tracking" + }, + { + "file": "../packages/tracking/src/-private.ts", + "line": 173, + "description": "Run the method, subscribing to any tracked properties\nmanaged by EmberData that were accessed or written during\nthe method's execution as per-normal but while allowing\ninterleaving of reads and writes.\n\nThis is useful when for instance you want to perform\na mutation based on existing state that must be read first.", + "itemtype": "method", + "name": "transact", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "method", + "description": "" + } + ], + "return": { + "description": "result of invoking method" + }, + "class": "@ember-data/tracking", + "module": "@ember-data/tracking" + }, + { + "file": "../packages/tracking/src/-private.ts", + "line": 150, + "description": "Run `method` without subscribing to any tracked properties\ncontrolled by EmberData.\n\nThis should rarely be used except by libraries that really\nknow what they are doing. It is most useful for wrapping\ncertain kinds of fetch/query logic from within a `Resource`\n`hook` or other similar pattern.", + "itemtype": "method", + "name": "untracked", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "method", + "description": "" + } + ], + "return": { + "description": "result of invoking method" + }, + "class": "@ember-data/tracking", + "module": "@ember-data/tracking" + } + ] + }, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-ember-data-overview.json b/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-ember-data-overview.json new file mode 100644 index 000000000..b2ccf5ac5 --- /dev/null +++ b/json-docs/ember-data/5.3.0/modules/ember-data-5.3.0-ember-data-overview.json @@ -0,0 +1,35 @@ +{ + "data": { + "id": "ember-data-5.3.0-ember-data-overview", + "type": "module", + "attributes": { + "name": "ember-data-overview", + "submodules": {}, + "elements": {}, + "fors": {}, + "namespaces": {}, + "tag": "main", + "file": "../-ember-data/addon/index.js", + "line": 1, + "description": "

\n \"EmberData\"\n

\n\n

The lightweight reactive data library for JavaScript applications

\n\n
\n

Wrangle your application's data management with scalable patterns for developer productivity.

\n
    \n
  • ⚡️ Committed to Best-In-Class Performance
  • \n
  • 🌲 Focused on being as svelte as possible
  • \n
  • 🚀 SSR Ready
  • \n
  • 🔜 Typescript Support
  • \n
  • 🐹 Built with ♥️ by Ember
  • \n
  • ⚛️ Supports any API: GraphQL JSON:API REST tRPC ...bespoke or a mix
  • \n
\n

📖 On This Page

\n\n

Overview

\n

EmberData is a lightweight reactive data library for JavaScript applications that provides composable primitives for ordering query/mutation/peek flows, managing network and cache, and reducing data for presentation.

\n

🪜 Architecture

\n

The core of EmberData is the Store, which coordinates interaction between your application, the Cache, and sources of data (such as your API or a local persistence layer).\nOptionally, the Store can be configured to hydrate the response data into rich presentation classes.

\n

EmberData is both resource centric and document centric in it's approach to caching, requesting and presenting data. Your application's configuration and usage drives which is important and when.

\n

The Store is a coordinator. When using a Store you configure what cache to use, how cache data should be presented to the UI, and where it should look for requested data when it is not available in the cache.

\n

This coordination is handled opaquely to the nature of the requests issued and the format of the data being handled. This approach gives applications broad flexibility to configure EmberData to best suite their needs. This makes EmberData a powerful solution for applications regardless of their size and complexity.

\n

EmberData is designed to scale, with a religious focus on performance and asset-size to keep its footprint small but speedy while still being able to handle large complex APIs in huge data-driven applications with no additional code and no added application complexity. It's goal is to prevent applications from writing code to manage data that is difficult to maintain or reason about.

\n

EmberData's power comes not from specific features, data formats, or adherence to specific API specs such as JSON:API trpc or GraphQL, but from solid conventions around requesting and mutating data developed over decades of experience scaling developer productivity.

\n

Basic Installation

\n

Install using your javascript package manager of choice. For instance with pnpm

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
pnpm add ember-data
\n
\n
\n \n

ember-data is installed by default for new applications generated with ember-cli. You can check what version is installed by looking in the devDependencies hash of your project's package.json file.

\n

If you have generated a new Ember application using ember-cli but do\nnot wish to use ember-data, remove ember-data from your project's package.json file and run your package manager's install command to update your lockfile.

\n

Advanced Installation

\n

EmberData is organized into primitives that compose together via public APIs.

\n
    \n
  • @ember-data/store is the core and handles coordination
  • \n
  • @ember-data/json-api provides a resource cache for JSON:API structured data. It integrates with the store via the hook createCache
  • \n
  • @ember-data/model is a presentation layer, it integrates with the store via the hooks instantiateRecord and teardownRecord.
  • \n
  • @ember-data/adapter provides various network API integrations for APIS built over specific REST or JSON:API conventions.
  • \n
  • @ember-data/serializer pairs with @ember-data/adapter to normalize and serialize data to and from an API format into the JSON:API format understood by @ember-data/json-api.
  • \n
  • @ember-data/debug provides debugging support for the ember-inspector.
  • \n
  • ember-data is a "meta" package which bundles all of these together for convenience
  • \n
\n

The packages interop with each other through well defined public API boundaries. The core\nof the library is the store provided by @ember-data/store, while each of the other libraries plugs into the store when installed. Because these packages interop via fully\npublic APIs, other libraries or applications may provide their own implementations. For instance, ember-m3 is a commonly used presentation and cache implementation suitable for complex resource objects and graphs.

\n

Configuration

\n

Deprecation Stripping

\n

EmberData allows users to opt-in and remove code that exists to support deprecated behaviors.

\n

If your app has resolved all deprecations present in a given version, you may specify that version as your "compatibility" version to remove the code that supported the deprecated behavior from your app.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let app = new EmberApp(defaults, {\n emberData: {\n   compatWith: '4.8',\n },\n});
\n
\n
\n \n\n

randomUUID polyfill

\n

EmberData uses UUID V4 by default to generate identifiers for new data created on the client. Identifier generation is configurable, but we also for convenience will polyfill\nthe necessary feature if your browser support or deployment environment demands it. To\nactivate this polyfill:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let app = new EmberApp(defaults, {\n '@embroider/macros': {\n   setConfig: {\n     '@ember-data/store': {\n       polyfillUUID: true\n     },\n   },\n },\n});
\n
\n
\n \n

removing inspector support in production

\n

If you do not with to ship inspector support in your production application, you can specify\nthat all support for it should be stripped from the build.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let app = new EmberApp(defaults, {\n emberData: {\n   includeDataAdapterInProduction: false\n }\n});
\n
\n
\n \n\n

Debugging

\n

Many portions of the internals are helpfully instrumented with logging that can be activated\nat build time. This instrumentation is always removed from production builds or any builds\nthat has not explicitly activated it. To activate it set the appropriate flag to true.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
 let app = new EmberApp(defaults, {\n   emberData: {\n     debug: {\n         LOG_PAYLOADS: false, // data store received to update cache with\n         LOG_OPERATIONS: false, // updates to cache remote state\n         LOG_MUTATIONS: false, // updates to cache local state\n         LOG_NOTIFICATIONS: false,\n         LOG_REQUESTS: false, // log Requests issued via the request manager\n         LOG_REQUEST_STATUS: false,\n         LOG_IDENTIFIERS: false,\n         LOG_GRAPH: false,\n         LOG_INSTANCE_CACHE: false,\n     }\n   }\n });
\n
\n
\n \n", + "itemtype": "main", + "parent": null, + "publicclasses": [], + "privateclasses": [], + "staticfunctions": {}, + "allstaticfunctions": {}, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-data-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/5.3.0/project-versions/ember-data-5.3.0.json b/json-docs/ember-data/5.3.0/project-versions/ember-data-5.3.0.json new file mode 100644 index 000000000..988f6b695 --- /dev/null +++ b/json-docs/ember-data/5.3.0/project-versions/ember-data-5.3.0.json @@ -0,0 +1,689 @@ +{ + "data": { + "id": "ember-data-5.3.0", + "type": "project-version", + "attributes": { + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [ + { + "id": "ember-data-5.3.0- Cache", + "type": "class" + }, + { + "id": "ember-data-5.3.0-CacheCapabilitiesManager", + "type": "class" + }, + { + "id": "ember-data-5.3.0-StableRecordIdentifier", + "type": "class" + }, + { + "id": "ember-data-5.3.0- Adapter", + "type": "class" + }, + { + "id": "ember-data-5.3.0- Serializer", + "type": "class" + }, + { + "id": "ember-data-5.3.0-SchemaService", + "type": "class" + }, + { + "id": "ember-data-5.3.0-BuildURLMixin", + "type": "class" + }, + { + "id": "ember-data-5.3.0-AdapterError", + "type": "class" + }, + { + "id": "ember-data-5.3.0-InvalidError", + "type": "class" + }, + { + "id": "ember-data-5.3.0-TimeoutError", + "type": "class" + }, + { + "id": "ember-data-5.3.0-AbortError", + "type": "class" + }, + { + "id": "ember-data-5.3.0-UnauthorizedError", + "type": "class" + }, + { + "id": "ember-data-5.3.0-ForbiddenError", + "type": "class" + }, + { + "id": "ember-data-5.3.0-NotFoundError", + "type": "class" + }, + { + "id": "ember-data-5.3.0-ConflictError", + "type": "class" + }, + { + "id": "ember-data-5.3.0-ServerError", + "type": "class" + }, + { + "id": "ember-data-5.3.0-Adapter", + "type": "class" + }, + { + "id": "ember-data-5.3.0-JSONAPIAdapter", + "type": "class" + }, + { + "id": "ember-data-5.3.0-RESTAdapter", + "type": "class" + }, + { + "id": "ember-data-5.3.0-InspectorDataAdapter", + "type": "class" + }, + { + "id": "ember-data-5.3.0-Cache", + "type": "class" + }, + { + "id": "ember-data-5.3.0-SnapshotRecordArray", + "type": "class" + }, + { + "id": "ember-data-5.3.0-Snapshot", + "type": "class" + }, + { + "id": "ember-data-5.3.0-BelongsToReference", + "type": "class" + }, + { + "id": "ember-data-5.3.0-HasManyReference", + "type": "class" + }, + { + "id": "ember-data-5.3.0-Errors", + "type": "class" + }, + { + "id": "ember-data-5.3.0-ManyArray", + "type": "class" + }, + { + "id": "ember-data-5.3.0-Model", + "type": "class" + }, + { + "id": "ember-data-5.3.0-PromiseBelongsTo", + "type": "class" + }, + { + "id": "ember-data-5.3.0-PromiseManyArray", + "type": "class" + }, + { + "id": "ember-data-5.3.0-CanaryFeatureFlags", + "type": "class" + }, + { + "id": "ember-data-5.3.0-DebugLogging", + "type": "class" + }, + { + "id": "ember-data-5.3.0-CurrentDeprecations", + "type": "class" + }, + { + "id": "ember-data-5.3.0-LifetimesService", + "type": "class" + }, + { + "id": "ember-data-5.3.0-RequestManager", + "type": "class" + }, + { + "id": "ember-data-5.3.0-Future", + "type": "class" + }, + { + "id": "ember-data-5.3.0- Handler", + "type": "class" + }, + { + "id": "ember-data-5.3.0-Fetch", + "type": "class" + }, + { + "id": "ember-data-5.3.0-BooleanTransform", + "type": "class" + }, + { + "id": "ember-data-5.3.0-DateTransform", + "type": "class" + }, + { + "id": "ember-data-5.3.0-NumberTransform", + "type": "class" + }, + { + "id": "ember-data-5.3.0-StringTransform", + "type": "class" + }, + { + "id": "ember-data-5.3.0-Transform", + "type": "class" + }, + { + "id": "ember-data-5.3.0-EmbeddedRecordsMixin", + "type": "class" + }, + { + "id": "ember-data-5.3.0-Serializer", + "type": "class" + }, + { + "id": "ember-data-5.3.0-JSONAPISerializer", + "type": "class" + }, + { + "id": "ember-data-5.3.0-JSONSerializer", + "type": "class" + }, + { + "id": "ember-data-5.3.0-RESTSerializer", + "type": "class" + }, + { + "id": "ember-data-5.3.0-IdentifierCache", + "type": "class" + }, + { + "id": "ember-data-5.3.0-RecordReference", + "type": "class" + }, + { + "id": "ember-data-5.3.0-CacheManager", + "type": "class" + }, + { + "id": "ember-data-5.3.0-NotificationManager", + "type": "class" + }, + { + "id": "ember-data-5.3.0-RequestStateService", + "type": "class" + }, + { + "id": "ember-data-5.3.0-RecordArray", + "type": "class" + }, + { + "id": "ember-data-5.3.0-Store", + "type": "class" + } + ] + }, + "namespaces": { + "data": [] + }, + "modules": { + "data": [ + { + "id": "ember-data-5.3.0-@ember-data/experimental-preview-types", + "type": "module" + }, + { + "id": "ember-data-5.3.0-@ember-data/store", + "type": "module" + }, + { + "id": "ember-data-5.3.0-ember-data-overview", + "type": "module" + }, + { + "id": "ember-data-5.3.0-@ember-data/active-record/request", + "type": "module" + }, + { + "id": "ember-data-5.3.0-@ember-data/adapter", + "type": "module" + }, + { + "id": "ember-data-5.3.0-@ember-data/adapter/error", + "type": "module" + }, + { + "id": "ember-data-5.3.0-@ember-data/adapter/json-api", + "type": "module" + }, + { + "id": "ember-data-5.3.0-@ember-data/adapter/rest", + "type": "module" + }, + { + "id": "ember-data-5.3.0-@ember-data/debug", + "type": "module" + }, + { + "id": "ember-data-5.3.0-@ember-data/graph", + "type": "module" + }, + { + "id": "ember-data-5.3.0-@ember-data/json-api/request", + "type": "module" + }, + { + "id": "ember-data-5.3.0-@ember-data/json-api", + "type": "module" + }, + { + "id": "ember-data-5.3.0-@ember-data/legacy-compat", + "type": "module" + }, + { + "id": "ember-data-5.3.0-@ember-data/model", + "type": "module" + }, + { + "id": "ember-data-5.3.0-@ember-data/canary-features", + "type": "module" + }, + { + "id": "ember-data-5.3.0-@ember-data/deprecations", + "type": "module" + }, + { + "id": "ember-data-5.3.0-@ember-data/request-utils", + "type": "module" + }, + { + "id": "ember-data-5.3.0-@ember-data/request", + "type": "module" + }, + { + "id": "ember-data-5.3.0-@ember-data/request/fetch", + "type": "module" + }, + { + "id": "ember-data-5.3.0-@ember-data/rest/request", + "type": "module" + }, + { + "id": "ember-data-5.3.0-@ember-data/serializer", + "type": "module" + }, + { + "id": "ember-data-5.3.0-@ember-data/serializer/rest", + "type": "module" + }, + { + "id": "ember-data-5.3.0-@ember-data/serializer/json-api", + "type": "module" + }, + { + "id": "ember-data-5.3.0-@ember-data/serializer/json", + "type": "module" + }, + { + "id": "ember-data-5.3.0-@ember-data/tracking", + "type": "module" + } + ] + }, + "project": { + "data": { + "id": "ember-data", + "type": "project" + } + }, + "private-classes": { + "data": [ + { + "id": "ember-data-5.3.0-InspectorDataAdapter", + "type": "class" + }, + { + "id": "ember-data-5.3.0-PromiseBelongsTo", + "type": "class" + } + ] + }, + "public-classes": { + "data": [ + { + "id": "ember-data-5.3.0- Cache", + "type": "class" + }, + { + "id": "ember-data-5.3.0-CacheCapabilitiesManager", + "type": "class" + }, + { + "id": "ember-data-5.3.0-StableRecordIdentifier", + "type": "class" + }, + { + "id": "ember-data-5.3.0- Adapter", + "type": "class" + }, + { + "id": "ember-data-5.3.0- Serializer", + "type": "class" + }, + { + "id": "ember-data-5.3.0-SchemaService", + "type": "class" + }, + { + "id": "ember-data-5.3.0-BuildURLMixin", + "type": "class" + }, + { + "id": "ember-data-5.3.0-AdapterError", + "type": "class" + }, + { + "id": "ember-data-5.3.0-InvalidError", + "type": "class" + }, + { + "id": "ember-data-5.3.0-TimeoutError", + "type": "class" + }, + { + "id": "ember-data-5.3.0-AbortError", + "type": "class" + }, + { + "id": "ember-data-5.3.0-UnauthorizedError", + "type": "class" + }, + { + "id": "ember-data-5.3.0-ForbiddenError", + "type": "class" + }, + { + "id": "ember-data-5.3.0-NotFoundError", + "type": "class" + }, + { + "id": "ember-data-5.3.0-ConflictError", + "type": "class" + }, + { + "id": "ember-data-5.3.0-ServerError", + "type": "class" + }, + { + "id": "ember-data-5.3.0-Adapter", + "type": "class" + }, + { + "id": "ember-data-5.3.0-JSONAPIAdapter", + "type": "class" + }, + { + "id": "ember-data-5.3.0-RESTAdapter", + "type": "class" + }, + { + "id": "ember-data-5.3.0-Cache", + "type": "class" + }, + { + "id": "ember-data-5.3.0-SnapshotRecordArray", + "type": "class" + }, + { + "id": "ember-data-5.3.0-Snapshot", + "type": "class" + }, + { + "id": "ember-data-5.3.0-BelongsToReference", + "type": "class" + }, + { + "id": "ember-data-5.3.0-HasManyReference", + "type": "class" + }, + { + "id": "ember-data-5.3.0-Errors", + "type": "class" + }, + { + "id": "ember-data-5.3.0-ManyArray", + "type": "class" + }, + { + "id": "ember-data-5.3.0-Model", + "type": "class" + }, + { + "id": "ember-data-5.3.0-PromiseManyArray", + "type": "class" + }, + { + "id": "ember-data-5.3.0-CanaryFeatureFlags", + "type": "class" + }, + { + "id": "ember-data-5.3.0-DebugLogging", + "type": "class" + }, + { + "id": "ember-data-5.3.0-CurrentDeprecations", + "type": "class" + }, + { + "id": "ember-data-5.3.0-LifetimesService", + "type": "class" + }, + { + "id": "ember-data-5.3.0-RequestManager", + "type": "class" + }, + { + "id": "ember-data-5.3.0-Future", + "type": "class" + }, + { + "id": "ember-data-5.3.0- Handler", + "type": "class" + }, + { + "id": "ember-data-5.3.0-Fetch", + "type": "class" + }, + { + "id": "ember-data-5.3.0-BooleanTransform", + "type": "class" + }, + { + "id": "ember-data-5.3.0-DateTransform", + "type": "class" + }, + { + "id": "ember-data-5.3.0-NumberTransform", + "type": "class" + }, + { + "id": "ember-data-5.3.0-StringTransform", + "type": "class" + }, + { + "id": "ember-data-5.3.0-Transform", + "type": "class" + }, + { + "id": "ember-data-5.3.0-EmbeddedRecordsMixin", + "type": "class" + }, + { + "id": "ember-data-5.3.0-Serializer", + "type": "class" + }, + { + "id": "ember-data-5.3.0-JSONAPISerializer", + "type": "class" + }, + { + "id": "ember-data-5.3.0-JSONSerializer", + "type": "class" + }, + { + "id": "ember-data-5.3.0-RESTSerializer", + "type": "class" + }, + { + "id": "ember-data-5.3.0-IdentifierCache", + "type": "class" + }, + { + "id": "ember-data-5.3.0-RecordReference", + "type": "class" + }, + { + "id": "ember-data-5.3.0-CacheManager", + "type": "class" + }, + { + "id": "ember-data-5.3.0-NotificationManager", + "type": "class" + }, + { + "id": "ember-data-5.3.0-RequestStateService", + "type": "class" + }, + { + "id": "ember-data-5.3.0-RecordArray", + "type": "class" + }, + { + "id": "ember-data-5.3.0-Store", + "type": "class" + } + ] + }, + "private-namespaces": { + "data": [] + }, + "public-namespaces": { + "data": [] + }, + "private-modules": { + "data": [] + }, + "public-modules": { + "data": [ + { + "id": "ember-data-5.3.0-@ember-data/experimental-preview-types", + "type": "module" + }, + { + "id": "ember-data-5.3.0-@ember-data/store", + "type": "module" + }, + { + "id": "ember-data-5.3.0-ember-data-overview", + "type": "module" + }, + { + "id": "ember-data-5.3.0-@ember-data/active-record/request", + "type": "module" + }, + { + "id": "ember-data-5.3.0-@ember-data/adapter", + "type": "module" + }, + { + "id": "ember-data-5.3.0-@ember-data/adapter/error", + "type": "module" + }, + { + "id": "ember-data-5.3.0-@ember-data/adapter/json-api", + "type": "module" + }, + { + "id": "ember-data-5.3.0-@ember-data/adapter/rest", + "type": "module" + }, + { + "id": "ember-data-5.3.0-@ember-data/debug", + "type": "module" + }, + { + "id": "ember-data-5.3.0-@ember-data/graph", + "type": "module" + }, + { + "id": "ember-data-5.3.0-@ember-data/json-api/request", + "type": "module" + }, + { + "id": "ember-data-5.3.0-@ember-data/json-api", + "type": "module" + }, + { + "id": "ember-data-5.3.0-@ember-data/legacy-compat", + "type": "module" + }, + { + "id": "ember-data-5.3.0-@ember-data/model", + "type": "module" + }, + { + "id": "ember-data-5.3.0-@ember-data/canary-features", + "type": "module" + }, + { + "id": "ember-data-5.3.0-@ember-data/deprecations", + "type": "module" + }, + { + "id": "ember-data-5.3.0-@ember-data/request-utils", + "type": "module" + }, + { + "id": "ember-data-5.3.0-@ember-data/request", + "type": "module" + }, + { + "id": "ember-data-5.3.0-@ember-data/request/fetch", + "type": "module" + }, + { + "id": "ember-data-5.3.0-@ember-data/rest/request", + "type": "module" + }, + { + "id": "ember-data-5.3.0-@ember-data/serializer", + "type": "module" + }, + { + "id": "ember-data-5.3.0-@ember-data/serializer/rest", + "type": "module" + }, + { + "id": "ember-data-5.3.0-@ember-data/serializer/json-api", + "type": "module" + }, + { + "id": "ember-data-5.3.0-@ember-data/serializer/json", + "type": "module" + }, + { + "id": "ember-data-5.3.0-@ember-data/tracking", + "type": "module" + } + ] + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember-data/projects/ember-data.json b/json-docs/ember-data/projects/ember-data.json index 9970170d0..1544ae833 100644 --- a/json-docs/ember-data/projects/ember-data.json +++ b/json-docs/ember-data/projects/ember-data.json @@ -8,6 +8,10 @@ "relationships": { "project-versions": { "data": [ + { + "id": "ember-data-5.3.0", + "type": "project-version" + }, { "id": "ember-data-5.2.0", "type": "project-version" diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/application.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/application.json new file mode 100644 index 000000000..47d227604 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/application.json @@ -0,0 +1,89 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/application", + "type": "class", + "attributes": { + "name": "@ember/application", + "shortname": "@ember/application", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/application", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/application/lib/lazy_load.ts", + "line": 14, + "description": "

Detects when a specific package of Ember (e.g. 'Application')\nhas fully loaded and is available for extension.

\n

The provided callback will be called with the name passed\nresolved from a string into the object:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { onLoad } from '@ember/application';\n\nonLoad('Ember.Application' function(hbars) {\n  hbars.registerHelper(...);\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "onLoad", + "static": 1, + "params": [ + { + "name": "name", + "description": "name of hook", + "type": "String" + }, + { + "name": "callback", + "description": "callback to be called", + "type": "Function" + } + ], + "access": "private", + "tagname": "", + "class": "@ember/application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/lazy_load.ts", + "line": 47, + "description": "

Called when an Ember.js package (e.g Application) has finished\nloading. Triggers any callbacks registered for this event.

\n", + "itemtype": "method", + "name": "runLoadHooks", + "static": 1, + "params": [ + { + "name": "name", + "description": "name of hook", + "type": "String" + }, + { + "name": "object", + "description": "object to pass to callbacks", + "type": "Object" + } + ], + "access": "private", + "tagname": "", + "class": "@ember/application", + "module": "@ember/application" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/application", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/array.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/array.json new file mode 100644 index 000000000..782529a38 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/array.json @@ -0,0 +1,189 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/array", + "type": "class", + "attributes": { + "name": "@ember/array", + "shortname": "@ember/array", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/array/lib/make-array.ts", + "line": 5, + "description": "

Forces the passed object to be part of an array. If the object is already\nan array, it will return the object. Otherwise, it will add the object to\nan array. If object is null or undefined, it will return an empty array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import { makeArray } from '@ember/array';\nimport ArrayProxy from '@ember/array/proxy';\n\nmakeArray();            // []\nmakeArray(null);        // []\nmakeArray(undefined);   // []\nmakeArray('lindsay');   // ['lindsay']\nmakeArray([1, 2, 42]);  // [1, 2, 42]\n\nlet proxy = ArrayProxy.create({ content: [] });\n\nmakeArray(proxy) === proxy;  // false
\n
\n
\n \n", + "itemtype": "method", + "name": "makeArray", + "static": 1, + "params": [ + { + "name": "obj", + "description": "the object", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Array" + }, + "access": "private", + "tagname": "", + "class": "@ember/array", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 140, + "description": "

Returns true if the passed object is an array or Array-like.

\n

Objects are considered Array-like if any of the following are true:

\n
    \n
  • the object is a native Array
  • \n
  • the object has an objectAt property
  • \n
  • the object is an Object, and has a length property
  • \n
\n

Unlike typeOf this method returns true even if the passed object is\nnot formally an array but appears to be array-like (i.e. implements Array)

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import { isArray } from '@ember/array';\nimport ArrayProxy from '@ember/array/proxy';\n\nisArray();                                      // false\nisArray([]);                                    // true\nisArray(ArrayProxy.create({ content: [] }));    // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isArray", + "static": 1, + "params": [ + { + "name": "obj", + "description": "The object to test", + "type": "Object" + } + ], + "return": { + "description": "true if the passed object is an array or Array-like", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/array", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1859, + "description": "

Creates an Ember.NativeArray from an Array-like object.\nDoes not modify the original object's contents. A() is not needed if\nEmberENV.EXTEND_PROTOTYPES is true (the default value). However,\nit is recommended that you use A() when creating addons for\nember or when you can not guarantee that EmberENV.EXTEND_PROTOTYPES\nwill be true.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Component from '@ember/component';\nimport { A } from '@ember/array';\n\nexport default Component.extend({\n  tagName: 'ul',\n  classNames: ['pagination'],\n\n  init() {\n    this._super(...arguments);\n\n    if (!this.get('content')) {\n      this.set('content', A());\n      this.set('otherContent', A([1,2,3]));\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "A", + "static": 1, + "return": { + "description": "", + "type": "Ember.NativeArray" + }, + "access": "public", + "tagname": "", + "class": "@ember/array", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1978, + "description": "

Remove all occurrences of an object in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let cities = ['Chicago', 'Berlin', 'Lima', 'Chicago'];\n\ncities.removeObject('Chicago');  // ['Berlin', 'Lima']\ncities.removeObject('Lima');     // ['Berlin']\ncities.removeObject('Tokyo')     // ['Berlin']
\n
\n
\n \n", + "itemtype": "method", + "name": "removeObject", + "params": [ + { + "name": "obj", + "description": "object to remove", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "@ember/array", + "module": "ember" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1999, + "description": "

Push the object onto the end of the array if it is not already\npresent in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let cities = ['Chicago', 'Berlin'];\n\ncities.addObject('Lima');    // ['Chicago', 'Berlin', 'Lima']\ncities.addObject('Berlin');  // ['Chicago', 'Berlin', 'Lima']
\n
\n
\n \n", + "itemtype": "method", + "name": "addObject", + "params": [ + { + "name": "obj", + "description": "object to add, if not already present", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "@ember/array", + "module": "ember" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 2020, + "description": "

Sets the value on the named property for each member. This is more\nergonomic than using other methods defined on this helper. If the object\nimplements Observable, the value will be changed to set(), otherwise\nit will be set directly. null objects are skipped.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.setEach('zipCode', '10011');\n// [{name: 'Joe', zipCode: '10011'}, {name: 'Matt', zipCode: '10011'}];
\n
\n
\n \n", + "itemtype": "method", + "name": "setEach", + "params": [ + { + "name": "key", + "description": "The key to set", + "type": "String" + }, + { + "name": "value", + "description": "The object to set", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/array", + "module": "ember" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/array/index.ts", + "line": 2040, + "description": "

This is the handler for the special array content property. If you get\nthis property, it will return this. If you set this property to a new\narray, it will replace the current content.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let peopleToMoon = ['Armstrong', 'Aldrin'];\n\npeopleToMoon.get('[]'); // ['Armstrong', 'Aldrin']\n\npeopleToMoon.set('[]', ['Collins']); // ['Collins']\npeopleToMoon.get('[]'); // ['Collins']
\n
\n
\n \n", + "itemtype": "property", + "name": "[]", + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "@ember/array", + "module": "ember" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/component.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/component.json new file mode 100644 index 000000000..970c143f5 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/component.json @@ -0,0 +1,69 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/component", + "type": "class", + "attributes": { + "name": "@ember/component", + "shortname": "@ember/component", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/component", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/components/input.ts", + "line": 55, + "description": "

An opaque interface which can be imported and used in strict-mode\ntemplates to call .

\n

See Ember.Templates.components.Input.

\n", + "itemtype": "method", + "name": "Input", + "see": [ + "{Ember.Templates.components.Input}" + ], + "access": "public", + "tagname": "", + "class": "@ember/component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/components/textarea.ts", + "line": 132, + "description": "

An opaque interface which can be imported and used in strict-mode\ntemplates to call

", + "itemtype": "method", + "name": "Textarea", + "see": [ + "{Ember.Templates.components.Textarea}" + ], + "access": "public", + "tagname": "", + "class": "@ember/component", + "module": "@ember/component" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/component", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/component/helper.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/component/helper.json new file mode 100644 index 000000000..5e103e551 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/component/helper.json @@ -0,0 +1,61 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/component/helper", + "type": "class", + "attributes": { + "name": "@ember/component/helper", + "shortname": "@ember/component/helper", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/component", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 333, + "description": "

In many cases it is not necessary to use the full Helper class.\nThe helper method create pure-function helpers without instances.\nFor example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
currency.js
1\n2\n3\n4\n5\n
import { helper } from '@ember/component/helper';\n\nexport default helper(function([cents], {currency}) {\n  return `${currency}${cents * 0.01}`;\n});
\n
\n
\n \n", + "static": 1, + "params": [ + { + "name": "helper", + "description": "The helper function", + "type": "Function" + } + ], + "itemtype": "method", + "name": "helper", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "@ember/component/helper", + "module": "@ember/component" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/component", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/component/template-only.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/component/template-only.json new file mode 100644 index 000000000..f602922b3 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/component/template-only.json @@ -0,0 +1,66 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/component/template-only", + "type": "class", + "attributes": { + "name": "@ember/component/template-only", + "shortname": "@ember/component/template-only", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/component/template-only", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/component/template-only.ts", + "line": 6, + "description": "

This utility function is used to declare a given component has no backing class. When the rendering engine detects this it\nis able to perform a number of optimizations. Templates that are associated with templateOnly() will be rendered as is\nwithout adding a wrapping <div> (or any of the other element customization behaviors of @ember/component).\nSpecifically, this means that the template will be rendered as "outer HTML".

\n

In general, this method will be used by build time tooling and would not be directly written in an application. However,\nat times it may be useful to use directly to leverage the "outer HTML" semantics mentioned above. For example, if an addon would like\nto use these semantics for its templates but cannot be certain it will only be consumed by applications that have enabled the\ntemplate-only-glimmer-components optional feature.

\n", + "example": [ + "\n\n```js\nimport templateOnly from '@ember/component/template-only';\n\nexport default templateOnly();\n```" + ], + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "templateOnly", + "params": [ + { + "name": "moduleName", + "description": "the module name that the template only component represents, this will be used for debugging purposes", + "type": "String" + } + ], + "category": [ + "EMBER_GLIMMER_SET_COMPONENT_TEMPLATE" + ], + "class": "@ember/component/template-only", + "module": "@ember/component/template-only" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/component/template-only", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/debug.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/debug.json new file mode 100644 index 000000000..33b2ccf90 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/debug.json @@ -0,0 +1,334 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/debug", + "type": "class", + "attributes": { + "name": "@ember/debug", + "shortname": "@ember/debug", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/debug", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/computed.ts", + "line": 919, + "description": "

Allows checking if a given property on an object is a computed property. For the most part,\nthis doesn't matter (you would normally just access the property directly and use its value),\nbut for some tooling specific scenarios (e.g. the ember-inspector) it is important to\ndifferentiate if a property is a computed property or a "normal" property.

\n

This will work on either a class's prototype or an instance itself.

\n", + "static": 1, + "itemtype": "method", + "name": "isComputed", + "access": "private", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/object" + }, + { + "file": "packages/@ember/debug/lib/capture-render-tree.ts", + "line": 9, + "description": "

Ember Inspector calls this function to capture the current render tree.

\n

In production mode, this requires turning on ENV._DEBUG_RENDER_TREE\nbefore loading Ember.

\n", + "access": "private", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "captureRenderTree", + "params": [ + { + "name": "app", + "description": "An `ApplicationInstance`.", + "type": "ApplicationInstance" + } + ], + "since": "3.14.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/lib/deprecate.ts", + "line": 39, + "description": "

Allows for runtime registration of handler functions that override the default deprecation behavior.\nDeprecations are invoked by calls to @ember/debug/deprecate.\nThe following example demonstrates its usage by registering a handler that throws an error if the\nmessage contains the word "should", otherwise defers to the default handler.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { registerDeprecationHandler } from '@ember/debug';\n\nregisterDeprecationHandler((message, options, next) => {\n  if (message.indexOf('should') !== -1) {\n    throw new Error(`Deprecation message with should: ${message}`);\n  } else {\n    // defer to whatever handler was registered before this one\n    next(message, options);\n  }\n});
\n
\n
\n \n

The handler function takes the following arguments:

\n
    \n
  • message - The message received from the deprecation call.
  • \n
  • options - An object passed in with the deprecation call containing additional information including:
  • \n
      \n
    • id - An id of the deprecation in the form of package-name.specific-deprecation.
    • \n
    • until - The Ember version number the feature and deprecation will be removed in.
    • \n
    \n
  • next - A function that calls into the previously registered handler.
  • \n
", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "registerDeprecationHandler", + "params": [ + { + "name": "handler", + "description": "A function to handle deprecation calls.", + "type": "Function" + } + ], + "since": "2.1.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/lib/deprecate.ts", + "line": 185, + "description": "

Display a deprecation warning with the provided message and a stack trace\n(Chrome and Firefox only).

\n

Ember itself leverages Semantic Versioning to aid\nprojects in keeping up with changes to the framework. Before any\nfunctionality or API is removed, it first flows linearly through a\ndeprecation staging process. The staging process currently contains two\nstages: available and enabled.

\n

Deprecations are initially released into the 'available' stage.\nDeprecations will stay in this stage until the replacement API has been\nmarked as a recommended practice via the RFC process and the addon\necosystem has generally adopted the change.

\n

Once a deprecation meets the above criteria, it will move into the\n'enabled' stage where it will remain until the functionality or API is\neventually removed.

\n

For application and addon developers, "available" deprecations are not\nurgent and "enabled" deprecations require action.

\n
    \n
  • In a production build, this method is defined as an empty function (NOP).\nUses of this method in Ember itself are stripped from the ember.prod.js build.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { deprecate } from '@ember/debug';\n\ndeprecate(\n  'Use of `assign` has been deprecated. Please use `Object.assign` or the spread operator instead.',\n  false,\n  {\n    id: 'ember-polyfills.deprecate-assign',\n    until: '5.0.0',\n    url: 'https://deprecations.emberjs.com/v4.x/#toc_ember-polyfills-deprecate-assign',\n    for: 'ember-source',\n    since: {\n      available: '4.0.0',\n      enabled: '4.0.0',\n    },\n  }\n);
\n
\n
\n \n", + "itemtype": "method", + "name": "deprecate", + "params": [ + { + "name": "message", + "description": "A description of the deprecation.", + "type": "String" + }, + { + "name": "test", + "description": "A boolean. If falsy, the deprecation will be displayed.", + "type": "Boolean" + }, + { + "name": "options", + "description": "", + "type": "Object", + "props": [ + { + "name": "id", + "description": "A unique id for this deprecation. The id can be\n used by Ember debugging tools to change the behavior (raise, log or silence)\n for that specific deprecation. The id should be namespaced by dots, e.g.\n \"view.helper.select\".", + "type": "String" + }, + { + "name": "until", + "description": "The version of Ember when this deprecation\n warning will be removed.", + "type": "String" + }, + { + "name": "for", + "description": "A namespace for the deprecation, usually the package name", + "type": "String" + }, + { + "name": "since", + "description": "Describes when the deprecation became available and enabled.", + "type": "Object" + }, + { + "name": "url", + "description": "An optional url to the transition guide on the\n emberjs.com website.", + "type": "String", + "optional": true + } + ] + } + ], + "static": 1, + "access": "public", + "tagname": "", + "since": "1.0.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/lib/inspect.ts", + "line": 15, + "description": "

Convenience method to inspect an object. This method will attempt to\nconvert the object into a useful string description.

\n

It is a pretty simple implementation. If you want something more robust,\nuse something like JSDump: https://github.com/NV/jsDump

\n", + "itemtype": "method", + "name": "inspect", + "static": 1, + "params": [ + { + "name": "obj", + "description": "The object you want to inspect.", + "type": "Object" + } + ], + "return": { + "description": "A description of the object", + "type": "String" + }, + "since": "1.4.0", + "access": "private", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/lib/warn.ts", + "line": 29, + "description": "

Allows for runtime registration of handler functions that override the default warning behavior.\nWarnings are invoked by calls made to @ember/debug/warn.\nThe following example demonstrates its usage by registering a handler that does nothing overriding Ember's\ndefault warning behavior.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { registerWarnHandler } from '@ember/debug';\n\n// next is not called, so no warnings get the default behavior\nregisterWarnHandler(() => {});
\n
\n
\n \n

The handler function takes the following arguments:

\n
    \n
  • message - The message received from the warn call.
  • \n
  • options - An object passed in with the warn call containing additional information including:
  • \n
      \n
    • id - An id of the warning in the form of package-name.specific-warning.
    • \n
    \n
  • next - A function that calls into the previously registered handler.
  • \n
", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "registerWarnHandler", + "params": [ + { + "name": "handler", + "description": "A function to handle warnings.", + "type": "Function" + } + ], + "since": "2.1.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/lib/warn.ts", + "line": 76, + "description": "

Display a warning with the provided message.

\n
    \n
  • In a production build, this method is defined as an empty function (NOP).\nUses of this method in Ember itself are stripped from the ember.prod.js build.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { warn } from '@ember/debug';\nimport tomsterCount from './tomster-counter'; // a module in my project\n\n// Log a warning if we have more than 3 tomsters\nwarn('Too many tomsters!', tomsterCount <= 3, {\n  id: 'ember-debug.too-many-tomsters'\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "warn", + "static": 1, + "params": [ + { + "name": "message", + "description": "A warning to display.", + "type": "String" + }, + { + "name": "test", + "description": "An optional boolean. If falsy, the warning\n will be displayed.", + "type": "Boolean" + }, + { + "name": "options", + "description": "An object that can be used to pass a unique\n `id` for this warning. The `id` can be used by Ember debugging tools\n to change the behavior (raise, log, or silence) for that specific warning.\n The `id` should be namespaced by dots, e.g. \"ember-debug.feature-flag-with-features-stripped\"", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "since": "1.0.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/index.ts", + "line": 139, + "description": "

Verify that a certain expectation is met, or throw a exception otherwise.

\n

This is useful for communicating assumptions in the code to other human\nreaders as well as catching bugs that accidentally violates these\nexpectations.

\n

Assertions are removed from production builds, so they can be freely added\nfor documentation and debugging purposes without worries of incuring any\nperformance penalty. However, because of that, they should not be used for\nchecks that could reasonably fail during normal usage. Furthermore, care\nshould be taken to avoid accidentally relying on side-effects produced from\nevaluating the condition itself, since the code will not run in production.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { assert } from '@ember/debug';\n\n// Test for truthiness\nassert('Must pass a string', typeof str === 'string');\n\n// Fail unconditionally\nassert('This code path should never be run');
\n
\n
\n \n", + "itemtype": "method", + "name": "assert", + "static": 1, + "params": [ + { + "name": "description", + "description": "Describes the expectation. This will become the\n text of the Error thrown if the assertion fails.", + "type": "String" + }, + { + "name": "condition", + "description": "Must be truthy for the assertion to pass. If\n falsy, an exception will be thrown.", + "type": "Any" + } + ], + "access": "public", + "tagname": "", + "since": "1.0.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/index.ts", + "line": 184, + "description": "

Display a debug notice.

\n

Calls to this function are not invoked in production builds.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import { debug } from '@ember/debug';\n\ndebug('I\\'m a debug notice!');
\n
\n
\n \n", + "itemtype": "method", + "name": "debug", + "static": 1, + "params": [ + { + "name": "message", + "description": "A debug message to display.", + "type": "String" + } + ], + "access": "public", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/index.ts", + "line": 205, + "description": "

Display an info notice.

\n

Calls to this function are removed from production builds, so they can be\nfreely added for documentation and debugging purposes without worries of\nincuring any performance penalty.

\n", + "itemtype": "method", + "name": "info", + "access": "private", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/index.ts", + "line": 224, + "description": "

Alias an old, deprecated method with its new counterpart.

\n

Display a deprecation warning with the provided message and a stack trace\n(Chrome and Firefox only) when the assigned method is called.

\n

Calls to this function are removed from production builds, so they can be\nfreely added for documentation and debugging purposes without worries of\nincuring any performance penalty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import { deprecateFunc } from '@ember/debug';\n\nEmber.oldMethod = deprecateFunc('Please use the new, updated method', options, Ember.newMethod);
\n
\n
\n \n", + "itemtype": "method", + "name": "deprecateFunc", + "static": 1, + "params": [ + { + "name": "message", + "description": "A description of the deprecation.", + "type": "String" + }, + { + "name": "options", + "description": "The options object for `deprecate`.", + "type": "Object", + "optional": true + }, + { + "name": "func", + "description": "The new function called to replace its deprecated counterpart.", + "type": "Function" + } + ], + "return": { + "description": "A new function that wraps the original function with a deprecation warning", + "type": "Function" + }, + "access": "private", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/index.ts", + "line": 269, + "description": "

Run a function meant for debugging.

\n

Calls to this function are removed from production builds, so they can be\nfreely added for documentation and debugging purposes without worries of\nincuring any performance penalty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Component from '@ember/component';\nimport { runInDebug } from '@ember/debug';\n\nrunInDebug(() => {\n  Component.reopen({\n    didInsertElement() {\n      console.log("I'm happy");\n    }\n  });\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "runInDebug", + "static": 1, + "params": [ + { + "name": "func", + "description": "The function to be executed.", + "type": "Function" + } + ], + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/debug" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/debug", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/destroyable.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/destroyable.json new file mode 100644 index 000000000..427443e79 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/destroyable.json @@ -0,0 +1,206 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/destroyable", + "type": "class", + "attributes": { + "name": "@ember/destroyable", + "shortname": "@ember/destroyable", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/destroyable", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/destroyable/index.ts", + "line": 31, + "description": "

This function is used to associate a destroyable object with a parent. When the parent\nis destroyed, all registered children will also be destroyed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
class CustomSelect extends Component {\n  constructor(...args) {\n    super(...args);\n\n    // obj is now a child of the component. When the component is destroyed,\n    // obj will also be destroyed, and have all of its destructors triggered.\n    this.obj = associateDestroyableChild(this, {});\n  }\n}
\n
\n
\n \n

Returns the associated child for convenience.

\n", + "itemtype": "method", + "name": "associateDestroyableChild", + "params": [ + { + "name": "parent", + "description": "the destroyable to entangle the child destroyables lifetime with", + "type": "Object|Function" + }, + { + "name": "child", + "description": "the destroyable to be entangled with the parents lifetime", + "type": "Object|Function" + } + ], + "return": { + "description": "the child argument", + "type": "Object|Function" + }, + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 58, + "description": "

Receives a destroyable, and returns true if the destroyable has begun destroying. Otherwise returns\nfalse.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
 let obj = {};\n isDestroying(obj); // false\n destroy(obj);\n isDestroying(obj); // true\n // ...sometime later, after scheduled destruction\n isDestroyed(obj); // true\n isDestroying(obj); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isDestroying", + "params": [ + { + "name": "destroyable", + "description": "the object to check", + "type": "Object|Function" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 80, + "description": "

Receives a destroyable, and returns true if the destroyable has finished destroying. Otherwise\nreturns false.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
let obj = {};\n\nisDestroyed(obj); // false\ndestroy(obj);\n\n// ...sometime later, after scheduled destruction\n\nisDestroyed(obj); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isDestroyed", + "params": [ + { + "name": "destroyable", + "description": "the object to check", + "type": "Object|Function" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 103, + "description": "

Initiates the destruction of a destroyable object. It runs all associated destructors, and then\ndestroys all children recursively.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let obj = {};\n\nregisterDestructor(obj, () => console.log('destroyed!'));\n\ndestroy(obj); // this will schedule the destructor to be called\n\n// ...some time later, during scheduled destruction\n\n// destroyed!
\n
\n
\n \n

Destruction via destroy() follows these steps:

\n

1, Mark the destroyable such that isDestroying(destroyable) returns true\n2, Call destroy() on each of the destroyable's associated children\n3, Schedule calling the destroyable's destructors\n4, Schedule setting destroyable such that isDestroyed(destroyable) returns true

\n

This results in the entire tree of destroyables being first marked as destroying,\nthen having all of their destructors called, and finally all being marked as isDestroyed.\nThere won't be any in between states where some items are marked as isDestroying while\ndestroying, while others are not.

\n", + "itemtype": "method", + "name": "destroy", + "params": [ + { + "name": "destroyable", + "description": "the object to destroy", + "type": "Object|Function" + } + ], + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 138, + "description": "

This function asserts that all objects which have associated destructors or associated children\nhave been destroyed at the time it is called. It is meant to be a low level hook that testing\nframeworks can use to hook into and validate that all destroyables have in fact been destroyed.

\n

This function requires that enableDestroyableTracking was called previously, and is only\navailable in non-production builds.

\n", + "itemtype": "method", + "name": "assertDestroyablesDestroyed", + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 152, + "description": "

This function instructs the destroyable system to keep track of all destroyables (their\nchildren, destructors, etc). This enables a future usage of assertDestroyablesDestroyed\nto be used to ensure that all destroyable tasks (registered destructors and associated children)\nhave completed when assertDestroyablesDestroyed is called.

\n", + "itemtype": "method", + "name": "enableDestroyableTracking", + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 164, + "description": "

Receives a destroyable object and a destructor function, and associates the\nfunction with it. When the destroyable is destroyed with destroy, or when its\nparent is destroyed, the destructor function will be called.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Component from '@glimmer/component';\nimport { registerDestructor } from '@ember/destroyable';\n\nclass Modal extends Component {\n  @service resize;\n\n  constructor(...args) {\n    super(...args);\n\n    this.resize.register(this, this.layout);\n\n    registerDestructor(this, () => this.resize.unregister(this));\n  }\n}
\n
\n
\n \n

Multiple destructors can be associated with a given destroyable, and they can be\nassociated over time, allowing libraries to dynamically add destructors as needed.\nregisterDestructor also returns the associated destructor function, for convenience.

\n

The destructor function is passed a single argument, which is the destroyable itself.\nThis allows the function to be reused multiple times for many destroyables, rather\nthan creating a closure function per destroyable.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import Component from '@glimmer/component';\nimport { registerDestructor } from '@ember/destroyable';\n\nfunction unregisterResize(instance) {\n  instance.resize.unregister(instance);\n}\n\nclass Modal extends Component {\n  @service resize;\n\n  constructor(...args) {\n    super(...args);\n\n    this.resize.register(this, this.layout);\n\n    registerDestructor(this, unregisterResize);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "registerDestructor", + "params": [ + { + "name": "destroyable", + "description": "the destroyable to register the destructor function with", + "type": "Object|Function" + }, + { + "name": "destructor", + "description": "the destructor to run when the destroyable object is destroyed", + "type": "Function" + } + ], + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 229, + "description": "

Receives a destroyable and a destructor function, and de-associates the destructor\nfrom the destroyable.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import Component from '@glimmer/component';\nimport { registerDestructor, unregisterDestructor } from '@ember/destroyable';\n\nclass Modal extends Component {\n  @service modals;\n\n  constructor(...args) {\n    super(...args);\n\n    this.modals.add(this);\n\n    this.modalDestructor = registerDestructor(this, () => this.modals.remove(this));\n  }\n\n  @action pinModal() {\n    unregisterDestructor(this, this.modalDestructor);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "unregisterDestructor", + "params": [ + { + "name": "destroyable", + "description": "the destroyable to unregister the destructor function from", + "type": "Object|Function" + }, + { + "name": "destructor", + "description": "the destructor to remove from the destroyable", + "type": "Function" + } + ], + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/destroyable", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/engine.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/engine.json new file mode 100644 index 000000000..34c9c5bbf --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/engine.json @@ -0,0 +1,87 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/engine", + "type": "class", + "attributes": { + "name": "@ember/engine", + "shortname": "@ember/engine", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/engine", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/engine/lib/engine-parent.ts", + "line": 8, + "description": "

getEngineParent retrieves an engine instance's parent instance.

\n", + "itemtype": "method", + "name": "getEngineParent", + "params": [ + { + "name": "engine", + "description": "An engine instance.", + "type": "EngineInstance" + } + ], + "return": { + "description": "The parent engine instance.", + "type": "EngineInstance" + }, + "static": 1, + "access": "private", + "tagname": "", + "class": "@ember/engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/lib/engine-parent.ts", + "line": 22, + "description": "

setEngineParent sets an engine instance's parent instance.

\n", + "itemtype": "method", + "name": "setEngineParent", + "params": [ + { + "name": "engine", + "description": "An engine instance.", + "type": "EngineInstance" + }, + { + "name": "parent", + "description": "The parent engine instance.", + "type": "EngineInstance" + } + ], + "access": "private", + "tagname": "", + "class": "@ember/engine", + "module": "@ember/engine" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/engine", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/helper.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/helper.json new file mode 100644 index 000000000..ac9fe41ba --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/helper.json @@ -0,0 +1,210 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/helper", + "type": "class", + "attributes": { + "name": "@ember/helper", + "shortname": "@ember/helper", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/array.ts", + "line": 5, + "description": "

Use the {{array}} helper to create an array to pass as an option to your\ncomponents.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<MyComponent @people={{array\n  'Tom Dale'\n  'Yehuda Katz'\n  this.myOtherPerson}}\n/>
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
{{my-component people=(array\n  'Tom Dale'\n  'Yehuda Katz'\n  this.myOtherPerson)\n}}
\n
\n
\n \n

Would result in an object such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
['Tom Dale', 'Yehuda Katz', this.get('myOtherPerson')]
\n
\n
\n \n

Where the 3rd item in the array is bound to updates of the myOtherPerson property.

\n", + "itemtype": "method", + "name": "array", + "params": [ + { + "name": "options", + "description": "", + "type": "Array" + } + ], + "return": { + "description": "Array", + "type": "Array" + }, + "since": "3.8.0", + "access": "public", + "tagname": "", + "class": "@ember/helper", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/concat.ts", + "line": 5, + "description": "

Concatenates the given arguments into a string.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{some-component name=(concat firstName " " lastName)}}\n\n{{! would pass name="<first name value> <last name value>" to the component}}
\n
\n
\n \n

or for angle bracket invocation, you actually don't need concat at all.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<SomeComponent @name="{{firstName}} {{lastName}}" />
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "concat", + "since": "1.13.0", + "class": "@ember/helper", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/fn.ts", + "line": 5, + "description": "

The fn helper allows you to ensure a function that you are passing off\nto another component, helper, or modifier has access to arguments that are\navailable in the template.

\n

For example, if you have an each helper looping over a number of items, you\nmay need to pass a function that expects to receive the item as an argument\nto a component invoked within the loop. Here's how you could use the fn\nhelper to pass both the function and its arguments together:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
listing.hbs
1\n2\n3\n
{{#each @items as |item|}}\n  <DisplayItem @item=item @select={{fn this.handleSelected item}} />\n{{/each}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
list.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\n\nexport default class ItemsList extends Component {\n  @action\n  handleSelected(item) {\n    // ...snip...\n  }\n}
\n
\n
\n \n

In this case the display-item component will receive a normal function\nthat it can invoke. When it invokes the function, the handleSelected\nfunction will receive the item and any arguments passed, thanks to the\nfn helper.

\n

Let's take look at what that means in a couple circumstances:

\n
    \n
  • When invoked as this.args.select() the handleSelected function will\nreceive the item from the loop as its first and only argument.
  • \n
  • When invoked as this.args.select('foo') the handleSelected function\nwill receive the item from the loop as its first argument and the\nstring 'foo' as its second argument.
  • \n
\n

In the example above, we used @action to ensure that handleSelected is\nproperly bound to the items-list, but let's explore what happens if we\nleft out @action:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
list.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@glimmer/component';\n\nexport default class ItemsList extends Component {\n  handleSelected(item) {\n    // ...snip...\n  }\n}
\n
\n
\n \n

In this example, when handleSelected is invoked inside the display-item\ncomponent, it will not have access to the component instance. In other\nwords, it will have no this context, so please make sure your functions\nare bound (via @action or other means) before passing into fn!

\n

See also partial application.

\n", + "itemtype": "method", + "name": "fn", + "access": "public", + "tagname": "", + "since": "3.11.0", + "class": "@ember/helper", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/get.ts", + "line": 5, + "description": "

Dynamically look up a property on an object or an element in an array.\nThe second argument to {{get}} should have a string or number value,\nalthough it can be bound.

\n

For example, these two usages are equivalent:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
detail.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class extends Component {\n  @tracked developer = {\n    name: "Sandi Metz",\n    language: "Ruby"\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
{{this.developer.name}}\n{{get this.developer "name"}}
\n
\n
\n \n

If there were several facts about a person, the {{get}} helper can dynamically\npick one:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<DeveloperDetail @factName="language" />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{get this.developer @factName}}
\n
\n
\n \n

For a more complex example, this template would allow the user to switch\nbetween showing the user's name and preferred coding language with a click:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
detail.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class extends Component {\n  @tracked developer = {\n    name: "Sandi Metz",\n    language: "Ruby"\n  }\n\n  @tracked currentFact = 'name'\n\n  @action\n  showFact(fact) {\n    this.currentFact = fact;\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
detail.js
1\n2\n3\n4\n
{{get this.developer this.currentFact}}\n\n<button {{on 'click' (fn this.showFact "name")}}>Show name</button>\n<button {{on 'click' (fn this.showFact "language")}}>Show language</button>
\n
\n
\n \n

The {{get}} helper can also respect mutable values itself. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
detail.js
1\n2\n3\n4\n
<Input @value={{mut (get this.person this.currentFact)}} />\n\n<button {{on 'click' (fn this.showFact "name")}}>Show name</button>\n<button {{on 'click' (fn this.showFact "language")}}>Show language</button>
\n
\n
\n \n

Would allow the user to swap what fact is being displayed, and also edit\nthat fact via a two-way mutable binding.

\n

The {{get}} helper can also be used for array element access via index.\nThis would display the value of the first element in the array this.names:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{get this.names 0}}
\n
\n
\n \n

Array element access also works with a dynamic second argument:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{get this.names @index}}
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "get", + "since": "2.1.0", + "class": "@ember/helper", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/hash.ts", + "line": 5, + "description": "

Use the {{hash}} helper to create a hash to pass as an option to your\ncomponents. This is specially useful for contextual components where you can\njust yield a hash:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
{{yield (hash\n   name='Sarah'\n   title=office\n)}}
\n
\n
\n \n

Would result in an object such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{ name: 'Sarah', title: this.get('office') }
\n
\n
\n \n

Where the title is bound to updates of the office property.

\n

Note that the hash is an empty object with no prototype chain, therefore\ncommon methods like toString are not available in the resulting hash.\nIf you need to use such a method, you can use the call or apply\napproach:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
function toString(obj) {\n  return Object.prototype.toString.apply(obj);\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "hash", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "Hash", + "type": "Object" + }, + "since": "2.3.0", + "access": "public", + "tagname": "", + "class": "@ember/helper", + "module": "ember" + }, + { + "file": "packages/@ember/helper/index.ts", + "line": 17, + "description": "

capabilities returns a capabilities configuration which can be used to modify\nthe behavior of the manager. Manager capabilities must be provided using the\ncapabilities function, as the underlying implementation can change over time.

\n

The first argument to capabilities is a version string, which is the version of\nEmber that the capabilities were defined in. Ember can add new versions at any\ntime, and these may have entirely different behaviors, but it will not remove\nold versions until the next major version.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
capabilities('3.23');
\n
\n
\n \n

The second argument is an object of capabilities and boolean values indicating\nwhether they are enabled or disabled.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
capabilities('3.23', {\n  hasValue: true,\n  hasDestructor: true,\n});
\n
\n
\n \n

If no value is specified, then the default value will be used.

\n

3.23 capabilities

\n

hasDestroyable

\n
    \n
  • Default value: false
  • \n
\n

Determines if the helper has a destroyable to include in the destructor\nhierarchy. If enabled, the getDestroyable hook will be called, and its result\nwill be associated with the destroyable parent block.

\n

hasValue

\n
    \n
  • Default value: false
  • \n
\n

Determines if the helper has a value which can be used externally. The helper's\ngetValue hook will be run whenever the value of the helper is accessed if this\ncapability is enabled.

\n", + "itemtype": "method", + "name": "capabilities", + "static": 1, + "params": [ + { + "name": "managerApiVersion", + "description": "The version of capabilities that are being used", + "type": "String" + }, + { + "name": "options", + "description": "The capabilities values" + } + ], + "return": { + "description": "The capabilities object instance", + "type": "Capabilities" + }, + "access": "public", + "tagname": "", + "class": "@ember/helper", + "module": "@ember/helper" + }, + { + "file": "packages/@ember/helper/index.ts", + "line": 71, + "description": "

Sets the helper manager for an object or function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
setHelperManager((owner) => new ClassHelperManager(owner), Helper)
\n
\n
\n \n

When a value is used as a helper in a template, the helper manager is looked up\non the object by walking up its prototype chain and finding the first helper\nmanager. This manager then receives the value and can create and manage an\ninstance of a helper from it. This provides a layer of indirection that allows\nusers to design high-level helper APIs, without Ember needing to worry about the\ndetails. High-level APIs can be experimented with and iterated on while the\ncore of Ember helpers remains stable, and new APIs can be introduced gradually\nover time to existing code bases.

\n

setHelperManager receives two arguments:

\n
    \n
  1. A factory function, which receives the owner and returns an instance of a\nhelper manager.
  2. \n
  3. A helper definition, which is the object or function to associate the factory function with.
  4. \n
\n

The first time the object is looked up, the factory function will be called to\ncreate the helper manager. It will be cached, and in subsequent lookups the\ncached helper manager will be used instead.

\n

Only one helper manager is guaranteed to exist per owner and per usage of\nsetHelperManager, so many helpers will end up using the same instance of the\nhelper manager. As such, you should only store state that is related to the\nmanager itself. If you want to store state specific to a particular helper\ndefinition, you should assign a unique helper manager to that helper. In\ngeneral, most managers should either be stateless, or only have the owner they\nwere created with as state.

\n

Helper managers must fulfill the following interface (This example uses\nTypeScript interfaces\nfor precision, you do not need to write helper managers using TypeScript):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
interface HelperManager<HelperStateBucket> {\n  capabilities: HelperCapabilities;\n\n  createHelper(definition: HelperDefinition, args: TemplateArgs): HelperStateBucket;\n\n  getValue?(bucket: HelperStateBucket): unknown;\n\n  runEffect?(bucket: HelperStateBucket): void;\n\n  getDestroyable?(bucket: HelperStateBucket): object;\n}
\n
\n
\n \n

The capabilities property must be provided using the capabilities() function\nimported from the same module as setHelperManager:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { capabilities } from '@ember/helper';\n\nclass MyHelperManager {\n  capabilities = capabilities('3.21.0', { hasValue: true });\n\n  // ...snip...\n}
\n
\n
\n \n

Below is a description of each of the methods on the interface and their\nfunctions.

\n

createHelper

\n

createHelper is a required hook on the HelperManager interface. The hook is\npassed the definition of the helper that is currently being created, and is\nexpected to return a state bucket. This state bucket is what represents the\ncurrent state of the helper, and will be passed to the other lifecycle hooks at\nappropriate times. It is not necessarily related to the definition of the\nhelper itself - for instance, you could return an object containing an\ninstance of the helper:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
class MyManager {\n  createHelper(Definition, args) {\n    return {\n      instance: new Definition(args);\n    };\n  }\n}
\n
\n
\n \n

This allows the manager to store metadata that it doesn't want to expose to the\nuser.

\n

This hook is not autotracked - changes to tracked values used within this hook\nwill not result in a call to any of the other lifecycle hooks. This is because\nit is unclear what should happen if it invalidates, and rather than make a\ndecision at this point, the initial API is aiming to allow as much expressivity\nas possible. This could change in the future with changes to capabilities and\ntheir behaviors.

\n

If users do want to autotrack some values used during construction, they can\neither create the instance of the helper in runEffect or getValue, or they\ncan use the cache API to autotrack the createHelper hook themselves. This\nprovides maximum flexibility and expressiveness to manager authors.

\n

This hook has the following timing semantics:

\n

Always

\n
    \n
  • called as discovered during DOM construction
  • \n
  • called in definition order in the template
  • \n
\n

getValue

\n

getValue is an optional hook that should return the value of the helper. This\nis the value that is returned from the helper and passed into the template.

\n

This hook is called when the value is requested from the helper (e.g. when the\ntemplate is rendering and the helper value is needed). The hook is autotracked,\nand will rerun whenever any tracked values used inside of it are updated.\nOtherwise it does not rerun.

\n
\n

Note: This means that arguments which are not consumed within the hook will\nnot trigger updates.

\n
\n

This hook is only called for helpers with the hasValue capability enabled.\nThis hook has the following timing semantics:

\n

Always

\n
    \n
  • called the first time the helper value is requested
  • \n
  • called after autotracked state has changed
  • \n
\n

Never

\n
    \n
  • called if the hasValue capability is disabled
  • \n
\n

runEffect

\n

runEffect is an optional hook that should run the effect that the helper is\napplying, setting it up or updating it.

\n

This hook is scheduled to be called some time after render and prior to paint.\nThere is not a guaranteed, 1-to-1 relationship between a render pass and this\nhook firing. For instance, multiple render passes could occur, and the hook may\nonly trigger once. It may also never trigger if it was dirtied in one render\npass and then destroyed in the next.

\n

The hook is autotracked, and will rerun whenever any tracked values used inside\nof it are updated. Otherwise it does not rerun.

\n

The hook is also run during a time period where state mutations are disabled\nin Ember. Any tracked state mutation will throw an error during this time,\nincluding changes to tracked properties, changes made using Ember.set, updates\nto computed properties, etc. This is meant to prevent infinite rerenders and\nother antipatterns.

\n

This hook is only called for helpers with the hasScheduledEffect capability\nenabled. This hook is also not called in SSR currently, though this could be\nadded as a capability in the future. It has the following timing semantics:

\n

Always

\n
    \n
  • called after the helper was first created, if the helper has not been\ndestroyed since creation
  • \n
  • called after autotracked state has changed, if the helper has not been\ndestroyed during render
  • \n
\n

Never

\n
    \n
  • called if the hasScheduledEffect capability is disabled
  • \n
  • called in SSR
  • \n
\n

getDestroyable

\n

getDestroyable is an optional hook that users can use to register a\ndestroyable object for the helper. This destroyable will be registered to the\ncontaining block or template parent, and will be destroyed when it is destroyed.\nSee the Destroyables RFC\nfor more details.

\n

getDestroyable is only called if the hasDestroyable capability is enabled.

\n

This hook has the following timing semantics:

\n

Always

\n
    \n
  • called immediately after the createHelper hook is called
  • \n
\n

Never

\n
    \n
  • called if the hasDestroyable capability is disabled
  • \n
\n", + "itemtype": "method", + "name": "setHelperManager", + "static": 1, + "params": [ + { + "name": "factory", + "description": "A factory function which receives an optional owner, and returns a helper manager", + "type": "Function" + }, + { + "name": "definition", + "description": "The definition to associate the manager factory with", + "type": "Object" + } + ], + "return": { + "description": "The definition passed into setHelperManager", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/helper", + "module": "@ember/helper" + }, + { + "file": "packages/@ember/helper/index.ts", + "line": 265, + "description": "

The invokeHelper function can be used to create a helper instance in\nJavaScript.

\n

To access a helper's value you have to use getValue from\n@glimmer/tracking/primitives/cache.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n
// app/components/data-loader.js\nimport Component from '@glimmer/component';\nimport { getValue } from '@glimmer/tracking/primitives/cache';\nimport Helper from '@ember/component/helper';\nimport { invokeHelper } from '@ember/helper';\n\nclass PlusOne extends Helper {\n  compute([number]) {\n    return number + 1;\n  }\n}\n\nexport default class PlusOneComponent extends Component {\n  plusOne = invokeHelper(this, PlusOne, () => {\n    return {\n      positional: [this.args.number],\n    };\n  });\n\n  get value() {\n    return getValue(this.plusOne);\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{this.value}}
\n
\n
\n \n

It receives three arguments:

\n
    \n
  • context: The parent context of the helper. When the parent is torn down and\nremoved, the helper will be as well.
  • \n
  • definition: The definition of the helper.
  • \n
  • computeArgs: An optional function that produces the arguments to the helper.\nThe function receives the parent context as an argument, and must return an\nobject with a positional property that is an array and/or a named\nproperty that is an object.
  • \n
\n

And it returns a Cache instance that contains the most recent value of the\nhelper. You can access the helper using getValue() like any other cache. The\ncache is also destroyable, and using the destroy() function on it will cause\nthe helper to be torn down.

\n

Note that using getValue() on helpers that have scheduled effects will not\ntrigger the effect early. Effects will continue to run at their scheduled time.

\n", + "itemtype": "method", + "name": "invokeHelper", + "static": 1, + "params": [ + { + "name": "context", + "description": "The parent context of the helper", + "type": "Object" + }, + { + "name": "definition", + "description": "The helper definition", + "type": "Object" + }, + { + "name": "computeArgs", + "description": "An optional function that produces args", + "type": "Function" + } + ], + "return": { + "description": "" + }, + "access": "public", + "tagname": "", + "class": "@ember/helper", + "module": "@ember/helper" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/instrumentation.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/instrumentation.json new file mode 100644 index 000000000..a5e58451d --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/instrumentation.json @@ -0,0 +1,138 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/instrumentation", + "type": "class", + "attributes": { + "name": "@ember/instrumentation", + "shortname": "@ember/instrumentation", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/instrumentation", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/instrumentation/index.ts", + "line": 120, + "description": "

Notifies event's subscribers, calls before and after hooks.

\n", + "itemtype": "method", + "name": "instrument", + "static": 1, + "params": [ + { + "name": "name", + "description": "Namespaced event name.", + "type": "String", + "optional": true + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "callback", + "description": "Function that you're instrumenting.", + "type": "Function" + }, + { + "name": "binding", + "description": "Context that instrument function is called with.", + "type": "Object" + } + ], + "access": "private", + "tagname": "", + "class": "@ember/instrumentation", + "module": "@ember/instrumentation" + }, + { + "file": "packages/@ember/instrumentation/index.ts", + "line": 273, + "description": "

Subscribes to a particular event or instrumented block of code.

\n", + "itemtype": "method", + "name": "subscribe", + "static": 1, + "params": [ + { + "name": "pattern", + "description": "Namespaced event name.", + "type": "String", + "optional": true + }, + { + "name": "object", + "description": "Before and After hooks.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "", + "type": "Subscriber" + }, + "access": "private", + "tagname": "", + "class": "@ember/instrumentation", + "module": "@ember/instrumentation" + }, + { + "file": "packages/@ember/instrumentation/index.ts", + "line": 313, + "description": "

Unsubscribes from a particular event or instrumented block of code.

\n", + "itemtype": "method", + "name": "unsubscribe", + "static": 1, + "params": [ + { + "name": "subscriber", + "description": "", + "type": "Object", + "optional": true + } + ], + "access": "private", + "tagname": "", + "class": "@ember/instrumentation", + "module": "@ember/instrumentation" + }, + { + "file": "packages/@ember/instrumentation/index.ts", + "line": 336, + "description": "

Resets Instrumentation by flushing list of subscribers.

\n", + "itemtype": "method", + "name": "reset", + "static": 1, + "access": "private", + "tagname": "", + "class": "@ember/instrumentation", + "module": "@ember/instrumentation" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/instrumentation", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/object.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/object.json new file mode 100644 index 000000000..3482c433d --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/object.json @@ -0,0 +1,521 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/object", + "type": "class", + "attributes": { + "name": "@ember/object", + "shortname": "@ember/object", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/computed.ts", + "line": 731, + "description": "

This helper returns a new property descriptor that wraps the passed\ncomputed property function. You can use this helper to define properties with\nnative decorator syntax, mixins, or via defineProperty().

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  constructor() {\n    this.firstName = 'Betty';\n    this.lastName = 'Jones';\n  },\n\n  @computed('firstName', 'lastName')\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n}\n\nlet client = new Person();\n\nclient.fullName; // 'Betty Jones'\n\nset(client, 'lastName', 'Fuller');\nclient.fullName; // 'Betty Fuller'
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import EmberObject, { computed } from '@ember/object';\n\nlet Person = EmberObject.extend({\n  init() {\n    this._super(...arguments);\n\n    this.firstName = 'Betty';\n    this.lastName = 'Jones';\n  },\n\n  fullName: computed('firstName', 'lastName', function() {\n    return `${this.get('firstName')} ${this.get('lastName')}`;\n  })\n});\n\nlet client = Person.create();\n\nclient.get('fullName'); // 'Betty Jones'\n\nclient.set('lastName', 'Fuller');\nclient.get('fullName'); // 'Betty Fuller'
\n
\n
\n \n

You can also provide a setter, either directly on the class using native class\nsyntax, or by passing a hash with get and set functions.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  constructor() {\n    this.firstName = 'Betty';\n    this.lastName = 'Jones';\n  },\n\n  @computed('firstName', 'lastName')\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n\n  set fullName(value) {\n    let [firstName, lastName] = value.split(/\\s+/);\n\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n\n    return value;\n  }\n}\n\nlet client = new Person();\n\nclient.fullName; // 'Betty Jones'\n\nset(client, 'lastName', 'Fuller');\nclient.fullName; // 'Betty Fuller'
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n
import EmberObject, { computed } from '@ember/object';\n\nlet Person = EmberObject.extend({\n  init() {\n    this._super(...arguments);\n\n    this.firstName = 'Betty';\n    this.lastName = 'Jones';\n  },\n\n  fullName: computed('firstName', 'lastName', {\n    get(key) {\n      return `${this.get('firstName')} ${this.get('lastName')}`;\n    },\n    set(key, value) {\n      let [firstName, lastName] = value.split(/\\s+/);\n      this.setProperties({ firstName, lastName });\n      return value;\n    }\n  })\n});\n\nlet client = Person.create();\nclient.get('firstName'); // 'Betty'\n\nclient.set('fullName', 'Carroll Fuller');\nclient.get('firstName'); // 'Carroll'
\n
\n
\n \n

When passed as an argument, the set function should accept two parameters,\nkey and value. The value returned from set will be the new value of the\nproperty.

\n

Note: This is the preferred way to define computed properties when writing third-party\nlibraries that depend on or use Ember, since there is no guarantee that the user\nwill have prototype Extensions enabled.

\n", + "itemtype": "method", + "name": "computed", + "static": 1, + "params": [ + { + "name": "dependentKeys*", + "description": "Optional dependent keys that trigger this computed property.", + "type": "String", + "optional": true + }, + { + "name": "func", + "description": "The computed property function.", + "type": "Function" + } + ], + "return": { + "description": "property decorator instance", + "type": "ComputedDecorator" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/get_properties.ts", + "line": 6, + "description": "

To get multiple properties at once, call getProperties\nwith an object followed by a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { getProperties } from '@ember/object';\n\ngetProperties(record, 'firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { getProperties } from '@ember/object';\n\ngetProperties(record, ['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "static": 1, + "params": [ + { + "name": "obj", + "description": "", + "type": "Object" + }, + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/properties.ts", + "line": 13, + "description": "

NOTE: This is a low-level method used by other parts of the API. You almost\nnever want to call this method directly. Instead you should use\nmixin() to define new properties.

\n

Defines a property on an object. This method works much like the ES5\nObject.defineProperty() method except that it can also accept computed\nproperties and other special descriptors.

\n

Normally this method takes only three parameters. However if you pass an\ninstance of Descriptor as the third param then you can pass an\noptional value as the fourth parameter. This is often more efficient than\ncreating new descriptor hashes for each property.

\n

Examples

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { defineProperty, computed } from '@ember/object';\n\n// ES5 compatible mode\ndefineProperty(contact, 'firstName', {\n  writable: true,\n  configurable: false,\n  enumerable: true,\n  value: 'Charles'\n});\n\n// define a simple property\ndefineProperty(contact, 'lastName', undefined, 'Jolley');\n\n// define a computed property\ndefineProperty(contact, 'fullName', computed('firstName', 'lastName', function() {\n  return this.firstName+' '+this.lastName;\n}));
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "defineProperty", + "static": 1, + "params": [ + { + "name": "obj", + "description": "the object to define this property on. This may be a prototype.", + "type": "Object" + }, + { + "name": "keyName", + "description": "the name of the property", + "type": "String" + }, + { + "name": "desc", + "description": "an instance of `Descriptor` (typically a\n computed property) or an ES5 descriptor.\n You must provide this or `data` but not both.", + "type": "Descriptor", + "optional": true + }, + { + "name": "data", + "description": "something other than a descriptor, that will\n become the explicit value of this property.", + "type": "*", + "optional": true + } + ], + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_events.ts", + "line": 32, + "description": "

This function is called just after an object property has changed.\nIt will notify any observers and clear caches among other things.

\n

Normally you will not need to call this method directly but if for some\nreason you can't directly watch a property you can invoke this method\nmanually.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "obj", + "description": "The object with the property that will change", + "type": "Object" + }, + { + "name": "keyName", + "description": "The property key (or path) that will change.", + "type": "String" + }, + { + "name": "_meta", + "description": "The objects meta.", + "type": "Meta", + "optional": true + }, + { + "name": "value", + "description": "The new value to set for the property", + "type": "Unknown", + "optional": true + } + ], + "return": { + "description": "", + "type": "Void" + }, + "since": "3.1.0", + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_events.ts", + "line": 83, + "itemtype": "method", + "name": "beginPropertyChanges", + "chainable": 1, + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_events.ts", + "line": 93, + "itemtype": "method", + "name": "endPropertyChanges", + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_events.ts", + "line": 105, + "description": "

Make a series of property changes together in an\nexception-safe way.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
Ember.changeProperties(function() {\n  obj1.set('foo', mayBlowUpWhenSet);\n  obj2.set('bar', baz);\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "changeProperties", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_get.ts", + "line": 51, + "description": "

Gets the value of a property on an object. If the property is computed,\nthe function will be invoked. If the property is not defined but the\nobject implements the unknownProperty method then that will be invoked.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
import { get } from '@ember/object';\nget(obj, "name");
\n
\n
\n \n

If you plan to run on IE8 and older browsers then you should use this\nmethod anytime you want to retrieve a property on an object that you don't\nknow for sure is private. (Properties beginning with an underscore '_'\nare considered private.)

\n

On all newer browsers, you only need to use this method to retrieve\nproperties if the property might not be defined on the object and you want\nto respect the unknownProperty handler. Otherwise you can ignore this\nmethod.

\n

Note that if the object itself is undefined, this method will throw\nan error.

\n", + "itemtype": "method", + "name": "get", + "static": 1, + "params": [ + { + "name": "obj", + "description": "The object to retrieve from.", + "type": "Object" + }, + { + "name": "keyName", + "description": "The property key to retrieve", + "type": "String" + } + ], + "return": { + "description": "the property value or `null`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_set.ts", + "line": 17, + "description": "

Sets the value of a property on an object, respecting computed properties\nand notifying observers and other listeners of the change.\nIf the specified property is not defined on the object and the object\nimplements the setUnknownProperty method, then instead of setting the\nvalue of the property on the object, its setUnknownProperty handler\nwill be invoked with the two parameters keyName and value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
import { set } from '@ember/object';\nset(obj, "name", value);
\n
\n
\n \n", + "itemtype": "method", + "name": "set", + "static": 1, + "params": [ + { + "name": "obj", + "description": "The object to modify.", + "type": "Object" + }, + { + "name": "keyName", + "description": "The property key to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set", + "type": "Object" + } + ], + "return": { + "description": "the passed value.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_set.ts", + "line": 121, + "description": "

Error-tolerant form of set. Will not blow up if any part of the\nchain is undefined, null, or destroyed.

\n

This is primarily used when syncing bindings, which may try to update after\nan object has been destroyed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { trySet } from '@ember/object';\n\nlet obj = { name: "Zoey" };\ntrySet(obj, "contacts.twitter", "@emberjs");
\n
\n
\n \n", + "itemtype": "method", + "name": "trySet", + "static": 1, + "params": [ + { + "name": "root", + "description": "The object to modify.", + "type": "Object" + }, + { + "name": "path", + "description": "The property path to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/set_properties.ts", + "line": 6, + "description": "

Set a list of properties on an object. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import EmberObject from '@ember/object';\nlet anObject = EmberObject.create();\n\nanObject.setProperties({\n  firstName: 'Stanley',\n  lastName: 'Stuart',\n  age: 21\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "static": 1, + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "properties", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "properties" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 621, + "description": "

Creates a new subclass.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  say(thing) {\n    alert(thing);\n   }\n});
\n
\n
\n \n

This defines a new subclass of EmberObject: Person. It contains one method: say().

\n

You can also create a subclass from any existing class by calling its extend() method.\nFor example, you might want to create a subclass of Ember's built-in Component class:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nconst PersonComponent = Component.extend({\n  tagName: 'li',\n  classNameBindings: ['isAdministrator']\n});
\n
\n
\n \n

When defining a subclass, you can override methods but still access the\nimplementation of your parent class by calling the special _super() method:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  say(thing) {\n    let name = this.get('name');\n    alert(`${name} says: ${thing}`);\n  }\n});\n\nconst Soldier = Person.extend({\n  say(thing) {\n    this._super(`${thing}, sir!`);\n  },\n  march(numberOfHours) {\n    alert(`${this.get('name')} marches for ${numberOfHours} hours.`);\n  }\n});\n\nlet yehuda = Soldier.create({\n  name: 'Yehuda Katz'\n});\n\nyehuda.say('Yes');  // alerts "Yehuda Katz says: Yes, sir!"
\n
\n
\n \n

The create() on line #17 creates an instance of the Soldier class.\nThe extend() on line #8 creates a subclass of Person. Any instance\nof the Person class will not have the march() method.

\n

You can also pass Mixin classes to add additional properties to the subclass.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import EmberObject from '@ember/object';\nimport Mixin from '@ember/object/mixin';\n\nconst Person = EmberObject.extend({\n  say(thing) {\n    alert(`${this.get('name')} says: ${thing}`);\n  }\n});\n\nconst SingingMixin = Mixin.create({\n  sing(thing) {\n    alert(`${this.get('name')} sings: la la la ${thing}`);\n  }\n});\n\nconst BroadwayStar = Person.extend(SingingMixin, {\n  dance() {\n    alert(`${this.get('name')} dances: tap tap tap tap `);\n  }\n});
\n
\n
\n \n

The BroadwayStar class contains three methods: say(), sing(), and dance().

\n", + "itemtype": "method", + "name": "extend", + "static": 1, + "params": [ + { + "name": "mixins", + "description": "One or more Mixin classes", + "type": "Mixin", + "optional": true, + "multiple": true + }, + { + "name": "arguments", + "description": "Object containing values to use within the new class", + "type": "Object", + "optional": true, + "multiple": true + } + ], + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 725, + "description": "

Creates an instance of a class. Accepts either no arguments, or an object\ncontaining values to initialize the newly instantiated object with.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  helloWorld() {\n    alert(`Hi, my name is ${this.get('name')}`);\n  }\n});\n\nlet tom = Person.create({\n  name: 'Tom Dale'\n});\n\ntom.helloWorld(); // alerts "Hi, my name is Tom Dale".
\n
\n
\n \n

create will call the init function if defined during\nAnyObject.extend

\n

If no arguments are passed to create, it will not set values to the new\ninstance during initialization:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let noName = Person.create();\nnoName.helloWorld(); // alerts undefined
\n
\n
\n \n

NOTE: For performance reasons, you cannot declare methods or computed\nproperties during create. You should instead declare methods and computed\nproperties when using extend.

\n", + "itemtype": "method", + "name": "create", + "static": 1, + "params": [ + { + "name": "arguments", + "description": "", + "optional": true, + "multiple": true + } + ], + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 810, + "description": "

Augments a constructor's prototype with additional\nproperties and functions:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import EmberObject from '@ember/object';\n\nconst MyObject = EmberObject.extend({\n  name: 'an object'\n});\n\no = MyObject.create();\no.get('name'); // 'an object'\n\nMyObject.reopen({\n  say(msg) {\n    console.log(msg);\n  }\n});\n\no2 = MyObject.create();\no2.say('hello'); // logs "hello"\n\no.say('goodbye'); // logs "goodbye"
\n
\n
\n \n

To add functions and properties to the constructor itself,\nsee reopenClass

\n", + "itemtype": "method", + "name": "reopen", + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 864, + "description": "

Augments a constructor's own properties and functions:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import EmberObject from '@ember/object';\n\nconst MyObject = EmberObject.extend({\n  name: 'an object'\n});\n\nMyObject.reopenClass({\n  canBuild: false\n});\n\nMyObject.canBuild; // false\no = MyObject.create();
\n
\n
\n \n

In other words, this creates static properties and functions for the class.\nThese are only available on the class and not on any instance of that class.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  name: '',\n  sayHello() {\n    alert(`Hello. My name is ${this.get('name')}`);\n  }\n});\n\nPerson.reopenClass({\n  species: 'Homo sapiens',\n\n  createPerson(name) {\n    return Person.create({ name });\n  }\n});\n\nlet tom = Person.create({\n  name: 'Tom Dale'\n});\nlet yehuda = Person.createPerson('Yehuda Katz');\n\ntom.sayHello(); // "Hello. My name is Tom Dale"\nyehuda.sayHello(); // "Hello. My name is Yehuda Katz"\nalert(Person.species); // "Homo sapiens"
\n
\n
\n \n

Note that species and createPerson are not valid on the tom and yehuda\nvariables. They are only valid on Person.

\n

To add functions and properties to instances of\na constructor by extending the constructor's prototype\nsee reopen

\n", + "itemtype": "method", + "name": "reopenClass", + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 950, + "description": "

In some cases, you may want to annotate computed properties with additional\nmetadata about how they function or what values they operate on. For\nexample, computed property functions may close over variables that are then\nno longer available for introspection.

\n

You can pass a hash of these values to a computed property like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import { computed } from '@ember/object';\n\nperson: computed(function() {\n  let personId = this.get('personId');\n  return Person.create({ id: personId });\n}).meta({ type: Person })
\n
\n
\n \n

Once you've done this, you can retrieve the values saved to the computed\nproperty from your class like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
MyClass.metaForProperty('person');
\n
\n
\n \n

This will return the original hash that was passed to meta().

\n", + "static": 1, + "itemtype": "method", + "name": "metaForProperty", + "params": [ + { + "name": "key", + "description": "property name", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 993, + "description": "

Iterate over each computed property for the class, passing its name\nand any associated metadata (see metaForProperty) to the callback.

\n", + "static": 1, + "itemtype": "method", + "name": "eachComputedProperty", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + }, + { + "name": "binding", + "description": "", + "type": "Object" + } + ], + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 1085, + "description": "

Provides lookup-time type validation for injected properties.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_onLookup", + "class": "@ember/object", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 1106, + "description": "

Returns a hash of property names and container names that injected\nproperties will lookup on the container lazily.

\n", + "itemtype": "method", + "name": "_lazyInjections", + "return": { + "description": "Hash of all lazy injected property keys to container names", + "type": "Object" + }, + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/index.ts", + "line": 51, + "description": "

Decorator that turns the target function into an Action which can be accessed\ndirectly by reference.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\nimport { action, set } from '@ember/object';\n\nexport default class Tooltip extends Component {\n  @action\n  toggleShowing() {\n    set(this, 'isShowing', !this.isShowing);\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
<!-- template.hbs -->\n<button {{action this.toggleShowing}}>Show tooltip</button>\n\n{{#if isShowing}}\n  <div class="tooltip">\n    I'm a tooltip!\n  </div>\n{{/if}}
\n
\n
\n \n

Decorated actions also interop with the string style template actions:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
<!-- template.hbs -->\n<button {{action "toggleShowing"}}>Show tooltip</button>\n\n{{#if isShowing}}\n  <div class="tooltip">\n    I'm a tooltip!\n  </div>\n{{/if}}
\n
\n
\n \n

It also binds the function directly to the instance, so it can be used in any\ncontext and will correctly refer to the class it came from:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
<!-- template.hbs -->\n<button\n  {{did-insert this.toggleShowing}}\n  {{on "click" this.toggleShowing}}\n>\n  Show tooltip\n</button>\n\n{{#if isShowing}}\n  <div class="tooltip">\n    I'm a tooltip!\n  </div>\n{{/if}}
\n
\n
\n \n

This can also be used in JavaScript code directly:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import Component from '@ember/component';\nimport { action, set } from '@ember/object';\n\nexport default class Tooltip extends Component {\n  constructor() {\n    super(...arguments);\n\n    // this.toggleShowing is still bound correctly when added to\n    // the event listener\n    document.addEventListener('click', this.toggleShowing);\n  }\n\n  @action\n  toggleShowing() {\n    set(this, 'isShowing', !this.isShowing);\n  }\n}
\n
\n
\n \n

This is considered best practice, since it means that methods will be bound\ncorrectly no matter where they are used. By contrast, the {{action}} helper\nand modifier can also be used to bind context, but it will be required for\nevery usage of the method:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
<!-- template.hbs -->\n<button\n  {{did-insert (action this.toggleShowing)}}\n  {{on "click" (action this.toggleShowing)}}\n>\n  Show tooltip\n</button>\n\n{{#if isShowing}}\n  <div class="tooltip">\n    I'm a tooltip!\n  </div>\n{{/if}}
\n
\n
\n \n

They also do not have equivalents in JavaScript directly, so they cannot be\nused for other situations where binding would be useful.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "action", + "static": 1, + "params": [ + { + "name": "callback", + "description": "The function to turn into an action,\n when used in classic classes", + "type": "Function|undefined" + } + ], + "return": { + "description": "property decorator instance", + "type": "PropertyDecorator" + }, + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/index.ts", + "line": 289, + "description": "

Specify a method that observes property changes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import EmberObject from '@ember/object';\nimport { observer } from '@ember/object';\n\nexport default EmberObject.extend({\n  valueObserver: observer('value', function() {\n    // Executes whenever the "value" property changes\n  })\n});
\n
\n
\n \n

Also available as Function.prototype.observes if prototype extensions are\nenabled.

\n", + "itemtype": "method", + "name": "observer", + "params": [ + { + "name": "propertyNames", + "description": "", + "type": "String", + "multiple": true + }, + { + "name": "func", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "func" + }, + "access": "public", + "tagname": "", + "static": 1, + "class": "@ember/object", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/object/compat.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/object/compat.json new file mode 100644 index 000000000..36e5cf0c5 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/object/compat.json @@ -0,0 +1,64 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/object/compat", + "type": "class", + "attributes": { + "name": "@ember/object/compat", + "shortname": "@ember/object/compat", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/object/compat.ts", + "line": 40, + "description": "

@dependentKeyCompat is decorator that can be used on native getters that\nuse tracked properties. It exposes the getter to Ember's classic computed\nproperty and observer systems, so they can watch it for changes. It can be\nused in both native and classic classes.

\n

Native Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n
import { tracked } from '@glimmer/tracking';\nimport { dependentKeyCompat } from '@ember/object/compat';\nimport { computed, set } from '@ember/object';\n\nclass Person {\n  @tracked firstName;\n  @tracked lastName;\n\n  @dependentKeyCompat\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n}\n\nclass Profile {\n  constructor(person) {\n    set(this, 'person', person);\n  }\n\n  @computed('person.fullName')\n  get helloMessage() {\n    return `Hello, ${this.person.fullName}!`;\n  }\n}
\n
\n
\n \n

Classic Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n
import { tracked } from '@glimmer/tracking';\nimport { dependentKeyCompat } from '@ember/object/compat';\nimport EmberObject, { computed, observer, set } from '@ember/object';\n\nconst Person = EmberObject.extend({\n  firstName: tracked(),\n  lastName: tracked(),\n\n  fullName: dependentKeyCompat(function() {\n    return `${this.firstName} ${this.lastName}`;\n  }),\n});\n\nconst Profile = EmberObject.extend({\n  person: null,\n\n  helloMessage: computed('person.fullName', function() {\n    return `Hello, ${this.person.fullName}!`;\n  }),\n\n  onNameUpdated: observer('person.fullName', function() {\n    console.log('person name updated!');\n  }),\n});
\n
\n
\n \n

dependentKeyCompat() can receive a getter function or an object containing\nget/set methods when used in classic classes, like computed properties.

\n

In general, only properties which you expect to be watched by older,\nuntracked clases should be marked as dependency compatible. The decorator is\nmeant as an interop layer for parts of Ember's older classic APIs, and should\nnot be applied to every possible getter/setter in classes. The number of\ndependency compatible getters should be minimized wherever possible. New\napplication code should not need to use @dependentKeyCompat, since it is\nonly for interoperation with older code.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "dependentKeyCompat", + "static": 1, + "params": [ + { + "name": "desc", + "description": "A property descriptor containing\n the getter and setter (when used in\n classic classes)", + "type": "PropertyDescriptor|undefined" + } + ], + "return": { + "description": "property decorator instance", + "type": "PropertyDecorator" + }, + "class": "@ember/object/compat", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/object/computed.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/object/computed.json new file mode 100644 index 000000000..b8139d46b --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/object/computed.json @@ -0,0 +1,903 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/object/computed", + "type": "class", + "attributes": { + "name": "@ember/object/computed", + "shortname": "@ember/object/computed", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/expand_properties.ts", + "line": 9, + "description": "

Expands pattern, invoking callback for each expansion.

\n

The only pattern supported is brace-expansion, anything else will be passed\nonce to callback directly.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { expandProperties } from '@ember/object/computed';\n\nfunction echo(arg){ console.log(arg); }\n\nexpandProperties('foo.bar', echo);              //=> 'foo.bar'\nexpandProperties('{foo,bar}', echo);            //=> 'foo', 'bar'\nexpandProperties('foo.{bar,baz}', echo);        //=> 'foo.bar', 'foo.baz'\nexpandProperties('{foo,bar}.baz', echo);        //=> 'foo.baz', 'bar.baz'\nexpandProperties('foo.{bar,baz}.[]', echo)      //=> 'foo.bar.[]', 'foo.baz.[]'\nexpandProperties('{foo,bar}.{spam,eggs}', echo) //=> 'foo.spam', 'foo.eggs', 'bar.spam', 'bar.eggs'\nexpandProperties('{foo}.bar.{baz}')             //=> 'foo.bar.baz'
\n
\n
\n \n", + "itemtype": "method", + "name": "expandProperties", + "static": 1, + "access": "public", + "tagname": "", + "params": [ + { + "name": "pattern", + "description": "The property pattern to expand.", + "type": "String" + }, + { + "name": "callback", + "description": "The callback to invoke. It is invoked once per\nexpansion, and is passed the expansion.", + "type": "Function" + } + ], + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 60, + "description": "

A computed property macro that returns true if the value of the dependent\nproperty is null, an empty string, empty array, or empty function.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { set } from '@ember/object';\nimport { empty } from '@ember/object/computed';\n\nclass ToDoList {\n  constructor(todos) {\n    set(this, 'todos', todos);\n  }\n\n  @empty('todos') isDone;\n}\n\nlet todoList = new ToDoList(\n  ['Unit Test', 'Documentation', 'Release']\n);\n\ntodoList.isDone; // false\nset(todoList, 'todos', []);\ntodoList.isDone; // true
\n
\n
\n \n", + "since": "1.6.0", + "itemtype": "method", + "name": "empty", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which returns true if the value\nof the dependent property is null, an empty string, empty array, or empty\nfunction and false if the underlying value is not empty.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 109, + "description": "

A computed property that returns true if the value of the dependent property\nis NOT null, an empty string, empty array, or empty function.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { set } from '@ember/object';\nimport { notEmpty } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(backpack) {\n    set(this, 'backpack', backpack);\n  }\n\n  @notEmpty('backpack') hasStuff\n}\n\nlet hamster = new Hamster(\n  ['Food', 'Sleeping Bag', 'Tent']\n);\n\nhamster.hasStuff; // true\nset(hamster, 'backpack', []);\nhamster.hasStuff; // false
\n
\n
\n \n", + "itemtype": "method", + "name": "notEmpty", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which returns true if original\nvalue for property is not empty.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 155, + "description": "

A computed property that returns true if the value of the dependent property\nis null or undefined. This avoids errors from JSLint complaining about use of\n==, which can be technically confusing.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { none } from '@ember/object/computed';\n\nclass Hamster {\n  @none('food') isHungry;\n}\n\nlet hamster = new Hamster();\n\nhamster.isHungry; // true\n\nset(hamster, 'food', 'Banana');\nhamster.isHungry; // false\n\nset(hamster, 'food', null);\nhamster.isHungry; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "none", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which returns true if original\nvalue for property is null or undefined.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 198, + "description": "

A computed property that returns the inverse boolean value of the original\nvalue for the dependent property.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import { set } from '@ember/object';\nimport { not } from '@ember/object/computed';\n\nclass User {\n  loggedIn = false;\n\n  @not('loggedIn') isAnonymous;\n}\n\nlet user = new User();\n\nuser.isAnonymous; // true\nset(user, 'loggedIn', true);\nuser.isAnonymous; // false
\n
\n
\n \n", + "itemtype": "method", + "name": "not", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which returns inverse of the\noriginal value for property", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 240, + "description": "

A computed property that converts the provided dependent property into a\nboolean value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import { set } from '@ember/object';\nimport { bool } from '@ember/object/computed';\n\n\nclass Hamster {\n  @bool('numBananas') hasBananas\n}\n\nlet hamster = new Hamster();\n\nhamster.hasBananas; // false\n\nset(hamster, 'numBananas', 0);\nhamster.hasBananas; // false\n\nset(hamster, 'numBananas', 1);\nhamster.hasBananas; // true\n\nset(hamster, 'numBananas', null);\nhamster.hasBananas; // false
\n
\n
\n \n", + "itemtype": "method", + "name": "bool", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which converts to boolean the\noriginal value for property", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 288, + "description": "

A computed property which matches the original value for the dependent\nproperty against a given RegExp, returning true if the value matches the\nRegExp and false if it does not.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { match } from '@ember/object/computed';\n\nclass User {\n  @match('email', /^.+@.+\\..+$/) hasValidEmail;\n}\n\nlet user = new User();\n\nuser.hasValidEmail; // false\n\nset(user, 'email', '');\nuser.hasValidEmail; // false\n\nset(user, 'email', 'ember_hamster@example.com');\nuser.hasValidEmail; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "match", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "regexp", + "description": "", + "type": "RegExp" + } + ], + "return": { + "description": "computed property which match the original value\nfor property against a given RegExp", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 335, + "description": "

A computed property that returns true if the provided dependent property is\nequal to the given value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { equal } from '@ember/object/computed';\n\nclass Hamster {\n  @equal('percentCarrotsEaten', 100) satisfied;\n}\n\nlet hamster = new Hamster();\n\nhamster.satisfied; // false\n\nset(hamster, 'percentCarrotsEaten', 100);\nhamster.satisfied; // true\n\nset(hamster, 'percentCarrotsEaten', 50);\nhamster.satisfied; // false
\n
\n
\n \n", + "itemtype": "method", + "name": "equal", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "String|Number|Object" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is equal to the given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 380, + "description": "

A computed property that returns true if the provided dependent property is\ngreater than the provided value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { gt } from '@ember/object/computed';\n\nclass Hamster {\n  @gt('numBananas', 10) hasTooManyBananas;\n}\n\nlet hamster = new Hamster();\n\nhamster.hasTooManyBananas; // false\n\nset(hamster, 'numBananas', 3);\nhamster.hasTooManyBananas; // false\n\nset(hamster, 'numBananas', 11);\nhamster.hasTooManyBananas; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "gt", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "Number" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is greater than given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 425, + "description": "

A computed property that returns true if the provided dependent property is\ngreater than or equal to the provided value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { gte } from '@ember/object/computed';\n\nclass Hamster {\n  @gte('numBananas', 10) hasTooManyBananas;\n}\n\nlet hamster = new Hamster();\n\nhamster.hasTooManyBananas; // false\n\nset(hamster, 'numBananas', 3);\nhamster.hasTooManyBananas; // false\n\nset(hamster, 'numBananas', 10);\nhamster.hasTooManyBananas; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "gte", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "Number" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is greater or equal then given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 470, + "description": "

A computed property that returns true if the provided dependent property is\nless than the provided value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { lt } from '@ember/object/computed';\n\nclass Hamster {\n  @lt('numBananas', 3) needsMoreBananas;\n}\n\nlet hamster = new Hamster();\n\nhamster.needsMoreBananas; // true\n\nset(hamster, 'numBananas', 3);\nhamster.needsMoreBananas; // false\n\nset(hamster, 'numBananas', 2);\nhamster.needsMoreBananas; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "lt", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "Number" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is less then given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 515, + "description": "

A computed property that returns true if the provided dependent property is\nless than or equal to the provided value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { lte } from '@ember/object/computed';\n\nclass Hamster {\n  @lte('numBananas', 3) needsMoreBananas;\n}\n\nlet hamster = new Hamster();\n\nhamster.needsMoreBananas; // true\n\nset(hamster, 'numBananas', 5);\nhamster.needsMoreBananas; // false\n\nset(hamster, 'numBananas', 3);\nhamster.needsMoreBananas; // true
\n
\n
\n \n", + "itemtype": "method", + "name": "lte", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "Number" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is less or equal than given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 560, + "description": "

A computed property that performs a logical and on the original values for\nthe provided dependent properties.

\n

You may pass in more than two properties and even use property brace\nexpansion. The computed property will return the first falsy value or last\ntruthy value just like JavaScript's && operator.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n
import { set } from '@ember/object';\nimport { and } from '@ember/object/computed';\n\nclass Hamster {\n  @and('hasTent', 'hasBackpack') readyForCamp;\n  @and('hasWalkingStick', 'hasBackpack') readyForHike;\n}\n\nlet tomster = new Hamster();\n\ntomster.readyForCamp; // false\n\nset(tomster, 'hasTent', true);\ntomster.readyForCamp; // false\n\nset(tomster, 'hasBackpack', true);\ntomster.readyForCamp; // true\n\nset(tomster, 'hasBackpack', 'Yes');\ntomster.readyForCamp; // 'Yes'\n\nset(tomster, 'hasWalkingStick', null);\ntomster.readyForHike; // null
\n
\n
\n \n", + "itemtype": "method", + "name": "and", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computed property which performs a logical `and` on\nthe values of all the original values for properties.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 606, + "description": "

A computed property which performs a logical or on the original values for\nthe provided dependent properties.

\n

You may pass in more than two properties and even use property brace\nexpansion. The computed property will return the first truthy value or last\nfalsy value just like JavaScript's || operator.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import { set } from '@ember/object';\nimport { or } from '@ember/object/computed';\n\nclass Hamster {\n  @or('hasJacket', 'hasUmbrella') readyForRain;\n  @or('hasSunscreen', 'hasUmbrella') readyForBeach;\n}\n\nlet tomster = new Hamster();\n\ntomster.readyForRain; // undefined\n\nset(tomster, 'hasUmbrella', true);\ntomster.readyForRain; // true\n\nset(tomster, 'hasJacket', 'Yes');\ntomster.readyForRain; // 'Yes'\n\nset(tomster, 'hasSunscreen', 'Check');\ntomster.readyForBeach; // 'Check'
\n
\n
\n \n", + "itemtype": "method", + "name": "or", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computed property which performs a logical `or` on\nthe values of all the original values for properties.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 649, + "description": "

Creates a new property that is an alias for another property on an object.\nCalls to get or set this property behave as though they were called on the\noriginal property.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { set } from '@ember/object';\nimport { alias } from '@ember/object/computed';\n\nclass Person {\n  name = 'Alex Matchneer';\n\n  @alias('name') nomen;\n}\n\nlet alex = new Person();\n\nalex.nomen; // 'Alex Matchneer'\nalex.name;  // 'Alex Matchneer'\n\nset(alex, 'nomen', '@machty');\nalex.name;  // '@machty'
\n
\n
\n \n", + "itemtype": "method", + "name": "alias", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which creates an alias to the\noriginal value for property.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 684, + "description": "

Where the alias computed macro aliases get and set, and allows for\nbidirectional data flow, the oneWay computed macro only provides an aliased\nget. The set will not mutate the upstream property, rather causes the\ncurrent property to become the value set. This causes the downstream property\nto permanently diverge from the upstream property.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import { set } from '@ember/object';\nimport { oneWay }from '@ember/object/computed';\n\nclass User {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @oneWay('firstName') nickName;\n}\n\nlet teddy = new User('Teddy', 'Zeenny');\n\nteddy.nickName; // 'Teddy'\n\nset(teddy, 'nickName', 'TeddyBear');\nteddy.firstName; // 'Teddy'\nteddy.nickName; // 'TeddyBear'
\n
\n
\n \n", + "itemtype": "method", + "name": "oneWay", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which creates a one way computed\nproperty to the original value for property.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 732, + "description": "

This is a more semantically meaningful alias of the oneWay computed macro,\nwhose name is somewhat ambiguous as to which direction the data flows.

\n", + "itemtype": "method", + "name": "reads", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which creates a one way computed\n property to the original value for property.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 745, + "description": "

Where oneWay computed macro provides oneWay bindings, the readOnly\ncomputed macro provides a readOnly one way binding. Very often when using\nthe oneWay macro one does not also want changes to propagate back up, as\nthey will replace the value.

\n

This prevents the reverse flow, and also throws an exception when it occurs.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import { set } from '@ember/object';\nimport { readOnly } from '@ember/object/computed';\n\nclass User {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @readOnly('firstName') nickName;\n});\n\nlet teddy = new User('Teddy', 'Zeenny');\n\nteddy.nickName; // 'Teddy'\n\nset(teddy, 'nickName', 'TeddyBear'); // throws Exception\n// throw new EmberError('Cannot Set: nickName on: <User:ember27288>' );`\n\nteddy.firstName; // 'Teddy'
\n
\n
\n \n", + "itemtype": "method", + "name": "readOnly", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which creates a one way computed\nproperty to the original value for property.", + "type": "ComputedProperty" + }, + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 796, + "description": "

Creates a new property that is an alias for another property on an object.\nCalls to get or set this property behave as though they were called on the\noriginal property, but also print a deprecation warning.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import { set } from '@ember/object';\nimport { deprecatingAlias } from '@ember/object/computed';\n\nclass Hamster {\n  @deprecatingAlias('cavendishCount', {\n    id: 'hamster.deprecate-banana',\n    until: '3.0.0'\n  })\n  bananaCount;\n}\n\nlet hamster = new Hamster();\n\nset(hamster, 'bananaCount', 5); // Prints a deprecation warning.\nhamster.cavendishCount; // 5
\n
\n
\n \n", + "itemtype": "method", + "name": "deprecatingAlias", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "Options for `deprecate`.", + "type": "Object" + } + ], + "return": { + "description": "computed property which creates an alias with a\ndeprecation to the original value for property.", + "type": "ComputedProperty" + }, + "since": "1.7.0", + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 76, + "description": "

A computed property that returns the sum of the values in the dependent array.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { sum } from '@ember/object/computed';\n\nclass Invoice {\n  lineItems = [1.00, 2.50, 9.99];\n\n  @sum('lineItems') total;\n}\n\nlet invoice = new Invoice();\n\ninvoice.total; // 13.49
\n
\n
\n \n", + "itemtype": "method", + "name": "sum", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes the sum of all values in the\ndependentKey's array", + "type": "ComputedProperty" + }, + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 113, + "description": "

A computed property that calculates the maximum value in the dependent array.\nThis will return -Infinity when the dependent array is empty.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n
import { set } from '@ember/object';\nimport { mapBy, max } from '@ember/object/computed';\n\nclass Person {\n  children = [];\n\n  @mapBy('children', 'age') childAges;\n  @max('childAges') maxChildAge;\n}\n\nlet lordByron = new Person();\n\nlordByron.maxChildAge; // -Infinity\n\nset(lordByron, 'children', [\n  {\n    name: 'Augusta Ada Byron',\n    age: 7\n  }\n]);\nlordByron.maxChildAge; // 7\n\nset(lordByron, 'children', [\n  ...lordByron.children,\n  {\n    name: 'Allegra Byron',\n    age: 5\n  }, {\n    name: 'Elizabeth Medora Leigh',\n    age: 8\n  }\n]);\nlordByron.maxChildAge; // 8
\n
\n
\n \n

If the types of the arguments are not numbers, they will be converted to\nnumbers and the type of the return value will always be Number. For example,\nthe max of a list of Date objects will be the highest timestamp as a Number.\nThis behavior is consistent with Math.max.

\n", + "itemtype": "method", + "name": "max", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes the largest value in the dependentKey's\narray", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 177, + "description": "

A computed property that calculates the minimum value in the dependent array.\nThis will return Infinity when the dependent array is empty.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n
import { set } from '@ember/object';\nimport { mapBy, min } from '@ember/object/computed';\n\nclass Person {\n  children = [];\n\n  @mapBy('children', 'age') childAges;\n  @min('childAges') minChildAge;\n}\n\nlet lordByron = Person.create({ children: [] });\n\nlordByron.minChildAge; // Infinity\n\nset(lordByron, 'children', [\n  {\n    name: 'Augusta Ada Byron',\n    age: 7\n  }\n]);\nlordByron.minChildAge; // 7\n\nset(lordByron, 'children', [\n  ...lordByron.children,\n  {\n    name: 'Allegra Byron',\n    age: 5\n  }, {\n    name: 'Elizabeth Medora Leigh',\n    age: 8\n  }\n]);\nlordByron.minChildAge; // 5
\n
\n
\n \n

If the types of the arguments are not numbers, they will be converted to\nnumbers and the type of the return value will always be Number. For example,\nthe min of a list of Date objects will be the lowest timestamp as a Number.\nThis behavior is consistent with Math.min.

\n", + "itemtype": "method", + "name": "min", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes the smallest value in the dependentKey's array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 240, + "description": "

Returns an array mapped via the callback

\n

The callback method you provide should have the following signature:

\n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the integer index of the current item in the iteration.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function mapCallback(item, index);
\n
\n
\n \n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { set } from '@ember/object';\nimport { map } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  @map('chores', function(chore, index) {\n    return `${chore.toUpperCase()}!`;\n  })\n  excitingChores;\n});\n\nlet hamster = new Hamster(['clean', 'write more unit tests']);\n\nhamster.excitingChores; // ['CLEAN!', 'WRITE MORE UNIT TESTS!']
\n
\n
\n \n

You can optionally pass an array of additional dependent keys as the second\nparameter to the macro, if your map function relies on any external values:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n
import { set } from '@ember/object';\nimport { map } from '@ember/object/computed';\n\nclass Hamster {\n  shouldUpperCase = false;\n\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  @map('chores', ['shouldUpperCase'], function(chore, index) {\n    if (this.shouldUpperCase) {\n      return `${chore.toUpperCase()}!`;\n    } else {\n      return `${chore}!`;\n    }\n  })\n  excitingChores;\n}\n\nlet hamster = new Hamster(['clean', 'write more unit tests']);\n\nhamster.excitingChores; // ['clean!', 'write more unit tests!']\n\nset(hamster, 'shouldUpperCase', true);\nhamster.excitingChores; // ['CLEAN!', 'WRITE MORE UNIT TESTS!']
\n
\n
\n \n", + "itemtype": "method", + "name": "map", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "additionalDependentKeys", + "description": "optional array of additional\ndependent keys", + "type": "Array", + "optional": true + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "an array mapped via the callback", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 364, + "description": "

Returns an array mapped to the specified key.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n
import { set } from '@ember/object';\nimport { mapBy } from '@ember/object/computed';\n\nclass Person {\n  children = [];\n\n  @mapBy('children', 'age') childAges;\n}\n\nlet lordByron = new Person();\n\nlordByron.childAges; // []\n\nset(lordByron, 'children', [\n  {\n    name: 'Augusta Ada Byron',\n    age: 7\n  }\n]);\nlordByron.childAges; // [7]\n\nset(lordByron, 'children', [\n  ...lordByron.children,\n  {\n    name: 'Allegra Byron',\n    age: 5\n  }, {\n    name: 'Elizabeth Medora Leigh',\n    age: 8\n  }\n]);\nlordByron.childAges; // [7, 5, 8]
\n
\n
\n \n", + "itemtype": "method", + "name": "mapBy", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "propertyKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "an array mapped to the specified key", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 431, + "description": "

Filters the array by the callback, like the Array.prototype.filter method.

\n

The callback method you provide should have the following signature:

\n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the integer index of the current item in the iteration.
  • \n
  • array is the dependant array itself.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function filterCallback(item, index, array);
\n
\n
\n \n

In the callback, return a truthy value that coerces to true to keep the\nelement, or a falsy to reject it.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import { set } from '@ember/object';\nimport { filter } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  @filter('chores', function(chore, index, array) {\n    return !chore.done;\n  })\n  remainingChores;\n}\n\nlet hamster = Hamster.create([\n  { name: 'cook', done: true },\n  { name: 'clean', done: true },\n  { name: 'write more unit tests', done: false }\n]);\n\nhamster.remainingChores; // [{name: 'write more unit tests', done: false}]
\n
\n
\n \n

You can also use @each.property in your dependent key, the callback will\nstill use the underlying array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n
import { set } from '@ember/object';\nimport { filter } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  @filter('chores.@each.done', function(chore, index, array) {\n    return !chore.done;\n  })\n  remainingChores;\n}\n\nlet hamster = new Hamster([\n  { name: 'cook', done: true },\n  { name: 'clean', done: true },\n  { name: 'write more unit tests', done: false }\n]);\nhamster.remainingChores; // [{name: 'write more unit tests', done: false}]\n\nset(hamster.chores[2], 'done', true);\nhamster.remainingChores; // []
\n
\n
\n \n

Finally, you can optionally pass an array of additional dependent keys as the\nsecond parameter to the macro, if your filter function relies on any external\nvalues:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n
import { filter } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  doneKey = 'finished';\n\n  @filter('chores', ['doneKey'], function(chore, index, array) {\n    return !chore[this.doneKey];\n  })\n  remainingChores;\n}\n\nlet hamster = new Hamster([\n  { name: 'cook', finished: true },\n  { name: 'clean', finished: true },\n  { name: 'write more unit tests', finished: false }\n]);\n\nhamster.remainingChores; // [{name: 'write more unit tests', finished: false}]
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "additionalDependentKeys", + "description": "optional array of additional dependent keys", + "type": "Array", + "optional": true + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "the filtered array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 601, + "description": "

Filters the array by the property and value.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { set } from '@ember/object';\nimport { filterBy } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(chores) {\n    set(this, 'chores', chores);\n  }\n\n  @filterBy('chores', 'done', false) remainingChores;\n}\n\nlet hamster = new Hamster([\n  { name: 'cook', done: true },\n  { name: 'clean', done: true },\n  { name: 'write more unit tests', done: false }\n]);\n\nhamster.remainingChores; // [{ name: 'write more unit tests', done: false }]
\n
\n
\n \n", + "itemtype": "method", + "name": "filterBy", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "propertyKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "*" + } + ], + "return": { + "description": "the filtered array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 657, + "description": "

A computed property which returns a new array with all the unique elements\nfrom one or more dependent arrays.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import { set } from '@ember/object';\nimport { uniq } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(fruits) {\n    set(this, 'fruits', fruits);\n  }\n\n  @uniq('fruits') uniqueFruits;\n}\n\nlet hamster = new Hamster([\n  'banana',\n  'grape',\n  'kale',\n  'banana'\n]);\n\nhamster.uniqueFruits; // ['banana', 'grape', 'kale']
\n
\n
\n \n", + "itemtype": "method", + "name": "uniq", + "static": 1, + "params": [ + { + "name": "propertyKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computes a new array with all the\nunique elements from the dependent array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 728, + "description": "

A computed property which returns a new array with all the unique elements\nfrom an array, with uniqueness determined by specific key.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import { set } from '@ember/object';\nimport { uniqBy } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(fruits) {\n    set(this, 'fruits', fruits);\n  }\n\n  @uniqBy('fruits', 'id') uniqueFruits;\n}\n\nlet hamster = new Hamster([\n  { id: 1, 'banana' },\n  { id: 2, 'grape' },\n  { id: 3, 'peach' },\n  { id: 1, 'banana' }\n]);\n\nhamster.uniqueFruits; // [ { id: 1, 'banana' }, { id: 2, 'grape' }, { id: 3, 'peach' }]
\n
\n
\n \n", + "itemtype": "method", + "name": "uniqBy", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "propertyKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes a new array with all the\nunique elements from the dependent array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 782, + "description": "

A computed property which returns a new array with all the unique elements\nfrom one or more dependent arrays.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n
import { set } from '@ember/object';\nimport { union } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(fruits, vegetables) {\n    set(this, 'fruits', fruits);\n    set(this, 'vegetables', vegetables);\n  }\n\n  @union('fruits', 'vegetables') uniqueFruits;\n});\n\nlet hamster = new, Hamster(\n  [\n    'banana',\n    'grape',\n    'kale',\n    'banana',\n    'tomato'\n  ],\n  [\n    'tomato',\n    'carrot',\n    'lettuce'\n  ]\n);\n\nhamster.uniqueFruits; // ['banana', 'grape', 'kale', 'tomato', 'carrot', 'lettuce']
\n
\n
\n \n", + "itemtype": "method", + "name": "union", + "static": 1, + "params": [ + { + "name": "propertyKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computes a new array with all the unique elements\nfrom one or more dependent arrays.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 829, + "description": "

A computed property which returns a new array with all the elements\ntwo or more dependent arrays have in common.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { set } from '@ember/object';\nimport { intersect } from '@ember/object/computed';\n\nclass FriendGroups {\n  constructor(adaFriends, charlesFriends) {\n    set(this, 'adaFriends', adaFriends);\n    set(this, 'charlesFriends', charlesFriends);\n  }\n\n  @intersect('adaFriends', 'charlesFriends') friendsInCommon;\n}\n\nlet groups = new FriendGroups(\n  ['Charles Babbage', 'John Hobhouse', 'William King', 'Mary Somerville'],\n  ['William King', 'Mary Somerville', 'Ada Lovelace', 'George Peacock']\n);\n\ngroups.friendsInCommon; // ['William King', 'Mary Somerville']
\n
\n
\n \n", + "itemtype": "method", + "name": "intersect", + "static": 1, + "params": [ + { + "name": "propertyKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computes a new array with all the duplicated\nelements from the dependent arrays", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 910, + "description": "

A computed property which returns a new array with all the properties from the\nfirst dependent array that are not in the second dependent array.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n
import { set } from '@ember/object';\nimport { setDiff } from '@ember/object/computed';\n\nclass Hamster {\n  constructor(likes, fruits) {\n    set(this, 'likes', likes);\n    set(this, 'fruits', fruits);\n  }\n\n  @setDiff('likes', 'fruits') wants;\n}\n\nlet hamster = new Hamster(\n  [\n    'banana',\n    'grape',\n    'kale'\n  ],\n  [\n    'grape',\n    'kale',\n  ]\n);\n\nhamster.wants; // ['banana']
\n
\n
\n \n", + "itemtype": "method", + "name": "setDiff", + "static": 1, + "params": [ + { + "name": "setAProperty", + "description": "", + "type": "String" + }, + { + "name": "setBProperty", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes a new array with all the items from the\nfirst dependent array that are not in the second dependent array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 980, + "description": "

A computed property that returns the array of values for the provided\ndependent properties.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import { set } from '@ember/object';\nimport { collect } from '@ember/object/computed';\n\nclass Hamster {\n  @collect('hat', 'shirt') clothes;\n}\n\nlet hamster = new Hamster();\n\nhamster.clothes; // [null, null]\n\nset(hamster, 'hat', 'Camp Hat');\nset(hamster, 'shirt', 'Camp Shirt');\nhamster.clothes; // ['Camp Hat', 'Camp Shirt']
\n
\n
\n \n", + "itemtype": "method", + "name": "collect", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computed property which maps values of all passed\nin properties to an array.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 1039, + "description": "

A computed property which returns a new array with all the properties from the\nfirst dependent array sorted based on a property or sort function. The sort\nmacro can be used in two different ways:

\n
    \n
  1. By providing a sort callback function
  2. \n
  3. By providing an array of keys to sort the array
  4. \n
\n

In the first form, the callback method you provide should have the following\nsignature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function sortCallback(itemA, itemB);
\n
\n
\n \n
    \n
  • itemA the first item to compare.
  • \n
  • itemB the second item to compare.
  • \n
\n

This function should return negative number (e.g. -1) when itemA should\ncome before itemB. It should return positive number (e.g. 1) when itemA\nshould come after itemB. If the itemA and itemB are equal this function\nshould return 0.

\n

Therefore, if this function is comparing some numeric values, simple itemA -\nitemB or itemA.get( 'foo' ) - itemB.get( 'foo' ) can be used instead of\nseries of if.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n
import { set } from '@ember/object';\nimport { sort } from '@ember/object/computed';\n\nclass ToDoList {\n  constructor(todos) {\n    set(this, 'todos', todos);\n  }\n\n  // using a custom sort function\n  @sort('todos', function(a, b){\n    if (a.priority > b.priority) {\n      return 1;\n    } else if (a.priority < b.priority) {\n      return -1;\n    }\n\n    return 0;\n  })\n  priorityTodos;\n}\n\nlet todoList = new ToDoList([\n  { name: 'Unit Test', priority: 2 },\n  { name: 'Documentation', priority: 3 },\n  { name: 'Release', priority: 1 }\n]);\n\ntodoList.priorityTodos; // [{ name:'Release', priority:1 }, { name:'Unit Test', priority:2 }, { name:'Documentation', priority:3 }]
\n
\n
\n \n

You can also optionally pass an array of additional dependent keys as the\nsecond parameter, if your sort function is dependent on additional values that\ncould changes:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n
import EmberObject, { set } from '@ember/object';\nimport { sort } from '@ember/object/computed';\n\nclass ToDoList {\n  sortKey = 'priority';\n\n  constructor(todos) {\n    set(this, 'todos', todos);\n  }\n\n  // using a custom sort function\n  @sort('todos', ['sortKey'], function(a, b){\n    if (a[this.sortKey] > b[this.sortKey]) {\n      return 1;\n    } else if (a[this.sortKey] < b[this.sortKey]) {\n      return -1;\n    }\n\n    return 0;\n  })\n  sortedTodos;\n});\n\nlet todoList = new ToDoList([\n  { name: 'Unit Test', priority: 2 },\n  { name: 'Documentation', priority: 3 },\n  { name: 'Release', priority: 1 }\n]);\n\ntodoList.priorityTodos; // [{ name:'Release', priority:1 }, { name:'Unit Test', priority:2 }, { name:'Documentation', priority:3 }]
\n
\n
\n \n

In the second form, you should provide the key of the array of sort values as\nthe second parameter:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n
import { set } from '@ember/object';\nimport { sort } from '@ember/object/computed';\n\nclass ToDoList {\n  constructor(todos) {\n    set(this, 'todos', todos);\n  }\n\n  // using standard ascending sort\n  todosSorting = ['name'];\n  @sort('todos', 'todosSorting') sortedTodos;\n\n  // using descending sort\n  todosSortingDesc = ['name:desc'];\n  @sort('todos', 'todosSortingDesc') sortedTodosDesc;\n}\n\nlet todoList = new ToDoList([\n  { name: 'Unit Test', priority: 2 },\n  { name: 'Documentation', priority: 3 },\n  { name: 'Release', priority: 1 }\n]);\n\ntodoList.sortedTodos; // [{ name:'Documentation', priority:3 }, { name:'Release', priority:1 }, { name:'Unit Test', priority:2 }]\ntodoList.sortedTodosDesc; // [{ name:'Unit Test', priority:2 }, { name:'Release', priority:1 }, { name:'Documentation', priority:3 }]
\n
\n
\n \n", + "itemtype": "method", + "name": "sort", + "static": 1, + "params": [ + { + "name": "itemsKey", + "description": "", + "type": "String" + }, + { + "name": "sortDefinitionOrDependentKeys", + "description": "The key of the sort definition (an array of sort properties),\nthe sort function, or an array of additional dependent keys", + "type": "String|Function|Array" + }, + { + "name": "sortDefinition", + "description": "the sort function (when used with additional dependent keys)", + "type": "Function?" + } + ], + "return": { + "description": "computes a new sorted array based on the sort\nproperty array or callback function", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/object/evented.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/object/evented.json new file mode 100644 index 000000000..6735e7c0e --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/object/evented.json @@ -0,0 +1,70 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/object/evented", + "type": "class", + "attributes": { + "name": "@ember/object/evented", + "shortname": "@ember/object/evented", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/events.ts", + "line": 180, + "description": "

Define a property as a function that should be executed when\na specified event or events are triggered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\nimport { on } from '@ember/object/evented';\nimport { sendEvent } from '@ember/object/events';\n\nlet Job = EmberObject.extend({\n  logCompleted: on('completed', function() {\n    console.log('Job completed!');\n  })\n});\n\nlet job = Job.create();\n\nsendEvent(job, 'completed'); // Logs 'Job completed!'
\n
\n
\n \n", + "itemtype": "method", + "name": "on", + "static": 1, + "params": [ + { + "name": "eventNames", + "description": "", + "type": "String", + "multiple": true + }, + { + "name": "func", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "the listener function, passed as last argument to on(...)", + "type": "Function" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/evented", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/object/events.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/object/events.json new file mode 100644 index 000000000..8ff05dc73 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/object/events.json @@ -0,0 +1,199 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/object/events", + "type": "class", + "attributes": { + "name": "@ember/object/events", + "shortname": "@ember/object/events", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/deprecate_property.ts", + "line": 10, + "description": "

Used internally to allow changing properties in a backwards compatible way, and print a helpful\ndeprecation warning.

\n", + "itemtype": "method", + "name": "deprecateProperty", + "params": [ + { + "name": "object", + "description": "The object to add the deprecated property to.", + "type": "Object" + }, + { + "name": "deprecatedKey", + "description": "The property to add (and print deprecation warnings upon accessing).", + "type": "String" + }, + { + "name": "newKey", + "description": "The property that will be aliased.", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "since": "1.7.0", + "class": "@ember/object/events", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/metal/lib/events.ts", + "line": 28, + "description": "

Add an event listener

\n", + "itemtype": "method", + "name": "addListener", + "static": 1, + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "eventName", + "description": "", + "type": "String" + }, + { + "name": "target", + "description": "A target object or a function", + "type": "Object|Function" + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + }, + { + "name": "once", + "description": "A flag whether a function should only be called once", + "type": "Boolean" + } + ], + "access": "public", + "tagname": "", + "class": "@ember/object/events", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/events.ts", + "line": 62, + "description": "

Remove an event listener

\n

Arguments should match those passed to addListener.

\n", + "itemtype": "method", + "name": "removeListener", + "static": 1, + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "eventName", + "description": "", + "type": "String" + }, + { + "name": "target", + "description": "A target object or a function", + "type": "Object|Function" + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "access": "public", + "tagname": "", + "class": "@ember/object/events", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/events.ts", + "line": 105, + "description": "

Send an event. The execution of suspended listeners\nis skipped, and once listeners are removed. A listener without\na target is executed on the passed object. If an array of actions\nis not passed, the actions stored on the passed object are invoked.

\n", + "itemtype": "method", + "name": "sendEvent", + "static": 1, + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "eventName", + "description": "", + "type": "String" + }, + { + "name": "params", + "description": "Optional parameters for each listener.", + "type": "Array" + } + ], + "return": { + "description": "if the event was delivered to one or more actions", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/events", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/events.ts", + "line": 162, + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "hasListeners", + "static": 1, + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "eventName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "if `obj` has listeners for event `eventName`", + "type": "Boolean" + }, + "class": "@ember/object/events", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/object/internals.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/object/internals.json new file mode 100644 index 000000000..bcb1f5a9b --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/object/internals.json @@ -0,0 +1,94 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/object/internals", + "type": "class", + "attributes": { + "name": "@ember/object/internals", + "shortname": "@ember/object/internals", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/utils/lib/guid.ts", + "line": 55, + "description": "

Generates a new guid, optionally saving the guid to the object that you\npass in. You will rarely need to use this method. Instead you should\ncall guidFor(obj), which return an existing guid if available.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "generateGuid", + "static": 1, + "params": [ + { + "name": "obj", + "description": "Object the guid will be used for. If passed in, the guid will\n be saved on the object and reused whenever you pass the same object\n again.\n\n If no object is passed, just generate a new guid.", + "type": "Object", + "optional": true + }, + { + "name": "prefix", + "description": "Prefix to place in front of the guid. Useful when you want to\n separate the guid into separate namespaces.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "the guid", + "type": "String" + }, + "class": "@ember/object/internals", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/utils/lib/guid.ts", + "line": 83, + "description": "

Returns a unique id for the object. If the object does not yet have a guid,\none will be assigned to it. You can call this on any object,\nEmberObject-based or not.

\n

You can also use this method on DOM Element objects.

\n", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "guidFor", + "params": [ + { + "name": "obj", + "description": "any object, string, number, Element, or primitive", + "type": "Object" + } + ], + "return": { + "description": "the unique guid for this instance.", + "type": "String" + }, + "class": "@ember/object/internals", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/object/mixin.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/object/mixin.json new file mode 100644 index 000000000..841ae93e7 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/object/mixin.json @@ -0,0 +1,118 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/object/mixin", + "type": "class", + "attributes": { + "name": "@ember/object/mixin", + "shortname": "@ember/object/mixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object/mixin", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/object/mixin.ts", + "line": 581, + "itemtype": "method", + "name": "create", + "static": 1, + "params": [ + { + "name": "arguments", + "description": "", + "multiple": true + } + ], + "access": "public", + "tagname": "", + "class": "@ember/object/mixin", + "module": "@ember/object/mixin" + }, + { + "file": "packages/@ember/object/mixin.ts", + "line": 614, + "itemtype": "method", + "name": "reopen", + "params": [ + { + "name": "arguments", + "description": "", + "multiple": true + } + ], + "access": "private", + "tagname": "", + "internal": "", + "class": "@ember/object/mixin", + "module": "@ember/object/mixin" + }, + { + "file": "packages/@ember/object/mixin.ts", + "line": 637, + "itemtype": "method", + "name": "apply", + "params": [ + { + "name": "obj", + "description": "" + } + ], + "return": { + "description": "applied object" + }, + "access": "private", + "tagname": "", + "internal": "", + "class": "@ember/object/mixin", + "module": "@ember/object/mixin" + }, + { + "file": "packages/@ember/object/mixin.ts", + "line": 658, + "itemtype": "method", + "name": "detect", + "params": [ + { + "name": "obj", + "description": "" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "internal": "", + "class": "@ember/object/mixin", + "module": "@ember/object/mixin" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/object/mixin", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/object/observers.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/object/observers.json new file mode 100644 index 000000000..87a1904b5 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/object/observers.json @@ -0,0 +1,107 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/object/observers", + "type": "class", + "attributes": { + "name": "@ember/object/observers", + "shortname": "@ember/object/observers", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/observer.ts", + "line": 27, + "itemtype": "method", + "name": "addObserver", + "static": 1, + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "path", + "description": "", + "type": "String" + }, + { + "name": "target", + "description": "", + "type": "Object|Function" + }, + { + "name": "method", + "description": "", + "type": "Function|String", + "optional": true + } + ], + "access": "public", + "tagname": "", + "class": "@ember/object/observers", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/observer.ts", + "line": 55, + "itemtype": "method", + "name": "removeObserver", + "static": 1, + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "path", + "description": "", + "type": "String" + }, + { + "name": "target", + "description": "", + "type": "Object|Function" + }, + { + "name": "method", + "description": "", + "type": "Function|String", + "optional": true + } + ], + "access": "public", + "tagname": "", + "class": "@ember/object/observers", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/owner.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/owner.json new file mode 100644 index 000000000..0d08ee8c1 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/owner.json @@ -0,0 +1,285 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/owner", + "type": "class", + "attributes": { + "name": "@ember/owner", + "shortname": "@ember/owner", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/owner", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 544, + "description": "

setOwner forces a new owner on a given object instance. This is primarily\nuseful in some testing cases.

\n", + "itemtype": "method", + "name": "setOwner", + "static": 1, + "params": [ + { + "name": "object", + "description": "An object instance.", + "type": "Object" + }, + { + "name": "object", + "description": "The new owner object of the object instance.", + "type": "Owner" + } + ], + "since": "2.3.0", + "access": "public", + "tagname": "", + "class": "@ember/owner", + "module": "@ember/owner" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 574, + "description": "

Returns an object that can be used to provide an owner to a\nmanually created instance.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(this);\n\nUser.create(\n  owner.ownerInjection(),\n  { username: 'rwjblue' }\n)
\n
\n
\n ", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "ownerInjection", + "since": "2.3.0", + "return": { + "description": "", + "type": "Object" + }, + "class": "@ember/owner", + "module": "@ember/owner" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 606, + "description": "

Given a fullName return the corresponding factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "resolveRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "fullName's factory", + "type": "Function" + }, + "class": "@ember/owner", + "module": "@ember/owner" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 616, + "description": "

Unregister a factory.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\nlet User = EmberObject.extend();\nApp.register('model:user', User);\n\nApp.resolveRegistration('model:user').create() instanceof User //=> true\n\nApp.unregister('model:user')\nApp.resolveRegistration('model:user') === undefined //=> true
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "@ember/owner", + "module": "@ember/owner" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 639, + "description": "

Check if a factory is registered.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "hasRegistration", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "@ember/owner", + "module": "@ember/owner" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 649, + "description": "

Return a specific registered option for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOption", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "optionName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "@ember/owner", + "module": "@ember/owner" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 663, + "description": "

Register options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "@ember/owner", + "module": "@ember/owner" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 673, + "description": "

Return registered options for a particular factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptions", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "@ember/owner", + "module": "@ember/owner" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 683, + "description": "

Allow registering options for all factories of a type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Application from '@ember/application';\n\nlet App = Application.create();\nlet appInstance = App.buildInstance();\n\n// if all of type `connection` must not be singletons\nappInstance.registerOptionsForType('connection', { singleton: false });\n\nappInstance.register('connection:twitter', TwitterConnection);\nappInstance.register('connection:facebook', FacebookConnection);\n\nlet twitter = appInstance.lookup('connection:twitter');\nlet twitter2 = appInstance.lookup('connection:twitter');\n\ntwitter === twitter2; // => false\n\nlet facebook = appInstance.lookup('connection:facebook');\nlet facebook2 = appInstance.lookup('connection:facebook');\n\nfacebook === facebook2; // => false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "@ember/owner", + "module": "@ember/owner" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 716, + "description": "

Return the registered options for all factories of a type.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registeredOptionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + } + ], + "return": { + "description": "options", + "type": "Object" + }, + "class": "@ember/owner", + "module": "@ember/owner" + }, + { + "file": "packages/@ember/owner/index.ts", + "line": 41, + "description": "

Framework objects in an Ember application (components, services, routes, etc.)\nare created via a factory and dependency injection system. Each of these\nobjects is the responsibility of an "owner", which handled its\ninstantiation and manages its lifetime.

\n

getOwner fetches the owner object responsible for an instance. This can\nbe used to lookup or resolve other class instances, or register new factories\ninto the owner.

\n

For example, this component dynamically looks up a service based on the\naudioType passed as an argument:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
audio.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { getOwner } from '@ember/application';\n\n// Usage:\n//\n//   <PlayAudio @audioType={{@model.audioType}} @audioFile={{@model.file}}/>\n//\nexport default class extends Component {\n  get audioService() {\n    return getOwner(this)?.lookup(`service:${this.args.audioType}`);\n  }\n\n  @action\n  onPlay() {\n    this.audioService?.play(this.args.audioFile);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "getOwner", + "static": 1, + "params": [ + { + "name": "object", + "description": "An object with an owner.", + "type": "Object" + } + ], + "return": { + "description": "An owner object.", + "type": "Object" + }, + "since": "2.3.0", + "access": "public", + "tagname": "", + "class": "@ember/owner", + "module": "@ember/owner" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/owner", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/routing.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/routing.json new file mode 100644 index 000000000..c3612229d --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/routing.json @@ -0,0 +1,55 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/routing", + "type": "class", + "attributes": { + "name": "@ember/routing", + "shortname": "@ember/routing", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/components/link-to.ts", + "line": 264, + "description": "

An opaque interface which can be imported and used in strict-mode\ntemplates to call .

\n

See Ember.Templates.components.LinkTo.

\n", + "itemtype": "method", + "name": "LinkTo", + "see": [ + "{Ember.Templates.components.LinkTo}" + ], + "access": "public", + "tagname": "", + "class": "@ember/routing", + "module": "@ember/routing" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/routing/location.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/routing/location.json new file mode 100644 index 000000000..22a2caa42 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/routing/location.json @@ -0,0 +1,40 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/routing/location", + "type": "class", + "attributes": { + "name": "@ember/routing/location", + "shortname": "@ember/routing/location", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing/location", + "namespace": "", + "methods": [], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/routing/location", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/runloop.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/runloop.json new file mode 100644 index 000000000..a3628fb83 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/runloop.json @@ -0,0 +1,498 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/runloop", + "type": "class", + "attributes": { + "name": "@ember/runloop", + "shortname": "@ember/runloop", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/runloop", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/runloop/index.ts", + "line": 108, + "description": "

Runs the passed target and method inside of a RunLoop, ensuring any\ndeferred actions including bindings and views updates are flushed at the\nend.

\n

Normally you should not need to invoke this method yourself. However if\nyou are implementing raw event handlers when interfacing with other\nlibraries or plugins, you should probably wrap all of your code inside this\ncall.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { run } from '@ember/runloop';\n\nrun(function() {\n  // code to be executed within a RunLoop\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "run", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to call", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "Method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Any additional arguments you wish to pass to the method.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "return value from invoking the passed function.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 153, + "description": "

If no run-loop is present, it creates a new one. If a run loop is\npresent it will queue itself to run on the existing run-loops action\nqueue.

\n

Please note: This is not for normal usage, and should be used sparingly.

\n

If invoked when not within a run loop:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { join } from '@ember/runloop';\n\njoin(function() {\n  // creates a new run-loop\n});
\n
\n
\n \n

Alternatively, if called within an existing run loop:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { run, join } from '@ember/runloop';\n\nrun(function() {\n  // creates a new run-loop\n\n  join(function() {\n    // joins with the existing run-loop, and queues for invocation on\n    // the existing run-loops action queue.\n  });\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "join", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to call", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "Method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Any additional arguments you wish to pass to the method.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Return value from invoking the passed function. Please note,\nwhen called within an existing loop, no return value is possible.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 212, + "description": "

Allows you to specify which context to call the specified function in while\nadding the execution of that function to the Ember run loop. This ability\nmakes this method a great way to asynchronously integrate third-party libraries\ninto your Ember application.

\n

bind takes two main arguments, the desired context and the function to\ninvoke in that context. Any additional arguments will be supplied as arguments\nto the function that is passed in.

\n

Let's use the creation of a TinyMCE component as an example. Currently,\nTinyMCE provides a setup configuration option we can use to do some processing\nafter the TinyMCE instance is initialized but before it is actually rendered.\nWe can use that setup option to do some additional setup for our component.\nThe component itself could look something like the following:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
editor.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n
import Component from '@ember/component';\nimport { on } from '@ember/object/evented';\nimport { bind } from '@ember/runloop';\n\nexport default Component.extend({\n  initializeTinyMCE: on('didInsertElement', function() {\n    tinymce.init({\n      selector: '#' + this.$().prop('id'),\n      setup: bind(this, this.setupEditor)\n    });\n  }),\n\n  didInsertElement() {\n    tinymce.init({\n      selector: '#' + this.$().prop('id'),\n      setup: bind(this, this.setupEditor)\n    });\n  }\n\n  setupEditor(editor) {\n    this.set('editor', editor);\n\n    editor.on('change', function() {\n      console.log('content changed!');\n    });\n  }\n});
\n
\n
\n \n

In this example, we use bind to bind the setupEditor method to the\ncontext of the RichTextEditor component and to have the invocation of that\nmethod be safely handled and executed by the Ember run loop.

\n", + "itemtype": "method", + "name": "bind", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to call", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "Method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Any additional arguments you wish to pass to the method.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "returns a new function that will always have a particular context", + "type": "Function" + }, + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 334, + "description": "

Begins a new RunLoop. Any deferred actions invoked after the begin will\nbe buffered until you invoke a matching call to end(). This is\na lower-level way to use a RunLoop instead of using run().

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { begin, end } from '@ember/runloop';\n\nbegin();\n// code to be executed within a RunLoop\nend();
\n
\n
\n \n", + "itemtype": "method", + "name": "begin", + "static": 1, + "return": { + "description": "", + "type": "Void" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 357, + "description": "

Ends a RunLoop. This must be called sometime after you call\nbegin() to flush any deferred actions. This is a lower-level way\nto use a RunLoop instead of using run().

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { begin, end } from '@ember/runloop';\n\nbegin();\n// code to be executed within a RunLoop\nend();
\n
\n
\n \n", + "itemtype": "method", + "name": "end", + "static": 1, + "return": { + "description": "", + "type": "Void" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 380, + "description": "

Adds the passed target/method and any optional arguments to the named\nqueue to be executed at the end of the RunLoop. If you have not already\nstarted a RunLoop when calling this method one will be started for you\nautomatically.

\n

At the end of a RunLoop, any methods scheduled in this way will be invoked.\nMethods will be invoked in an order matching the named queues defined in\nthe queues property.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { schedule } from '@ember/runloop';\n\nschedule('afterRender', this, function() {\n  // this will be executed in the 'afterRender' queue\n  console.log('scheduled on afterRender queue');\n});\n\nschedule('actions', this, function() {\n  // this will be executed in the 'actions' queue\n  console.log('scheduled on actions queue');\n});\n\n// Note the functions will be run in order based on the run queues order.\n// Output would be:\n//   scheduled on actions queue\n//   scheduled on afterRender queue
\n
\n
\n \n", + "itemtype": "method", + "name": "schedule", + "static": 1, + "params": [ + { + "name": "queue", + "description": "The name of the queue to schedule against. Default queues is 'actions'", + "type": "String" + }, + { + "name": "target", + "description": "target object to use as the context when invoking a method.", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke. If you pass a string it\n will be resolved on the target object at the time the scheduled item is\n invoked allowing you to change the target function.", + "type": "String|Function" + }, + { + "name": "arguments*", + "description": "Optional arguments to be passed to the queued method.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 453, + "description": "

Invokes the passed target/method and optional arguments after a specified\nperiod of time. The last parameter of this method must always be a number\nof milliseconds.

\n

You should use this method whenever you need to run some action after a\nperiod of time instead of using setTimeout(). This method will ensure that\nitems that expire during the same script execution cycle all execute\ntogether, which is often more efficient than using a real setTimeout.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { later } from '@ember/runloop';\n\nlater(myContext, function() {\n  // code here will execute within a RunLoop in about 500ms with this == myContext\n}, 500);
\n
\n
\n \n", + "itemtype": "method", + "name": "later", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to invoke", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + }, + { + "name": "wait", + "description": "Number of milliseconds to wait.", + "type": "Number" + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 501, + "description": "

Schedule a function to run one time during the current RunLoop. This is equivalent\n to calling scheduleOnce with the "actions" queue.

\n", + "itemtype": "method", + "name": "once", + "static": 1, + "params": [ + { + "name": "target", + "description": "The target of the method to invoke.", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 532, + "description": "

Schedules a function to run one time in a given queue of the current RunLoop.\nCalling this method with the same queue/target/method combination will have\nno effect (past the initial call).

\n

Note that although you can pass optional arguments these will not be\nconsidered when looking for duplicates. New arguments will replace previous\ncalls.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { run, scheduleOnce } from '@ember/runloop';\n\nfunction sayHi() {\n  console.log('hi');\n}\n\nrun(function() {\n  scheduleOnce('afterRender', myContext, sayHi);\n  scheduleOnce('afterRender', myContext, sayHi);\n  // sayHi will only be executed once, in the afterRender queue of the RunLoop\n});
\n
\n
\n \n

Also note that for scheduleOnce to prevent additional calls, you need to\npass the same function instance. The following case works as expected:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
function log() {\n  console.log('Logging only once');\n}\n\nfunction scheduleIt() {\n  scheduleOnce('actions', myContext, log);\n}\n\nscheduleIt();\nscheduleIt();
\n
\n
\n \n

But this other case will schedule the function multiple times:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import { scheduleOnce } from '@ember/runloop';\n\nfunction scheduleIt() {\n  scheduleOnce('actions', myContext, function() {\n    console.log('Closure');\n  });\n}\n\nscheduleIt();\nscheduleIt();\n\n// "Closure" will print twice, even though we're using `scheduleOnce`,\n// because the function we pass to it won't match the\n// previously scheduled operation.
\n
\n
\n \n

Available queues, and their order, can be found at queues

\n", + "itemtype": "method", + "name": "scheduleOnce", + "static": 1, + "params": [ + { + "name": "queue", + "description": "The name of the queue to schedule against. Default queues is 'actions'.", + "type": "String", + "optional": true + }, + { + "name": "target", + "description": "The target of the method to invoke.", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 626, + "description": "

Schedules an item to run from within a separate run loop, after\ncontrol has been returned to the system. This is equivalent to calling\nlater with a wait time of 1ms.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import { next } from '@ember/runloop';\n\nnext(myContext, function() {\n  // code to be executed in the next run loop,\n  // which will be scheduled after the current one\n});
\n
\n
\n \n

Multiple operations scheduled with next will coalesce\ninto the same later run loop, along with any other operations\nscheduled by later that expire right around the same\ntime that next operations will fire.

\n

Note that there are often alternatives to using next.\nFor instance, if you'd like to schedule an operation to happen\nafter all DOM element operations have completed within the current\nrun loop, you can make use of the afterRender run loop queue (added\nby the ember-views package, along with the preceding render queue\nwhere all the DOM element operations happen).

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import Component from '@ember/component';\nimport { scheduleOnce } from '@ember/runloop';\n\nexport Component.extend({\n  didInsertElement() {\n    this._super(...arguments);\n    scheduleOnce('afterRender', this, 'processChildElements');\n  },\n\n  processChildElements() {\n    // ... do something with component's child component\n    // elements after they've finished rendering, which\n    // can't be done within this component's\n    // `didInsertElement` hook because that gets run\n    // before the child elements have been added to the DOM.\n  }\n});
\n
\n
\n \n

One benefit of the above approach compared to using next is\nthat you will be able to perform DOM/CSS operations before unprocessed\nelements are rendered to the screen, which may prevent flickering or\nother artifacts caused by delaying processing until after rendering.

\n

The other major benefit to the above approach is that next\nintroduces an element of non-determinism, which can make things much\nharder to test, due to its reliance on setTimeout; it's much harder\nto guarantee the order of scheduled operations when they are scheduled\noutside of the current run loop, i.e. with next.

\n", + "itemtype": "method", + "name": "next", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to invoke", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 711, + "description": "

Cancels a scheduled item. Must be a value returned by later(),\nonce(), scheduleOnce(), next(), debounce(), or\nthrottle().

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n42\n43\n44\n45\n46\n47\n48\n49\n50\n51\n52\n
import {\n  next,\n  cancel,\n  later,\n  scheduleOnce,\n  once,\n  throttle,\n  debounce\n} from '@ember/runloop';\n\nlet runNext = next(myContext, function() {\n  // will not be executed\n});\n\ncancel(runNext);\n\nlet runLater = later(myContext, function() {\n  // will not be executed\n}, 500);\n\ncancel(runLater);\n\nlet runScheduleOnce = scheduleOnce('afterRender', myContext, function() {\n  // will not be executed\n});\n\ncancel(runScheduleOnce);\n\nlet runOnce = once(myContext, function() {\n  // will not be executed\n});\n\ncancel(runOnce);\n\nlet throttle = throttle(myContext, function() {\n  // will not be executed\n}, 1, false);\n\ncancel(throttle);\n\nlet debounce = debounce(myContext, function() {\n  // will not be executed\n}, 1);\n\ncancel(debounce);\n\nlet debounceImmediate = debounce(myContext, function() {\n  // will be executed since we passed in true (immediate)\n}, 100, true);\n\n// the 100ms delay until this method can be called again will be canceled\ncancel(debounceImmediate);
\n
\n
\n \n", + "itemtype": "method", + "name": "cancel", + "static": 1, + "params": [ + { + "name": "timer", + "description": "Timer object to cancel", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "true if canceled or false/undefined if it wasn't found", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 782, + "description": "

Delay calling the target method until the debounce period has elapsed\nwith no additional debounce calls. If debounce is called again before\nthe specified time has elapsed, the timer is reset and the entire period\nmust pass again before the target method is called.

\n

This method should be used when an event may be called multiple times\nbut the action should only be called once when the event is done firing.\nA common example is for scroll events where you only want updates to\nhappen once scrolling has ceased.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { debounce } from '@ember/runloop';\n\nfunction whoRan() {\n  console.log(this.name + ' ran.');\n}\n\nlet myContext = { name: 'debounce' };\n\ndebounce(myContext, whoRan, 150);\n\n// less than 150ms passes\ndebounce(myContext, whoRan, 150);\n\n// 150ms passes\n// whoRan is invoked with context myContext\n// console logs 'debounce ran.' one time.
\n
\n
\n \n

Immediate allows you to run the function immediately, but debounce\nother calls for this function until the wait time has elapsed. If\ndebounce is called again before the specified time has elapsed,\nthe timer is reset and the entire period must pass again before\nthe method can be called again.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import { debounce } from '@ember/runloop';\n\nfunction whoRan() {\n  console.log(this.name + ' ran.');\n}\n\nlet myContext = { name: 'debounce' };\n\ndebounce(myContext, whoRan, 150, true);\n\n// console logs 'debounce ran.' one time immediately.\n// 100ms passes\ndebounce(myContext, whoRan, 150, true);\n\n// 150ms passes and nothing else is logged to the console and\n// the debouncee is no longer being watched\ndebounce(myContext, whoRan, 150, true);\n\n// console logs 'debounce ran.' one time immediately.\n// 150ms passes and nothing else is logged to the console and\n// the debouncee is no longer being watched
\n
\n
\n \n", + "itemtype": "method", + "name": "debounce", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to invoke", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + }, + { + "name": "wait", + "description": "Number of milliseconds to wait.", + "type": "Number" + }, + { + "name": "immediate", + "description": "Trigger the function on the leading instead\n of the trailing edge of the wait interval. Defaults to false.", + "type": "Boolean" + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 879, + "description": "

Ensure that the target method is never called more frequently than\nthe specified spacing period. The target method is called immediately.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n
import { throttle } from '@ember/runloop';\n\nfunction whoRan() {\n  console.log(this.name + ' ran.');\n}\n\nlet myContext = { name: 'throttle' };\n\nthrottle(myContext, whoRan, 150);\n// whoRan is invoked with context myContext\n// console logs 'throttle ran.'\n\n// 50ms passes\nthrottle(myContext, whoRan, 150);\n\n// 50ms passes\nthrottle(myContext, whoRan, 150);\n\n// 150ms passes\nthrottle(myContext, whoRan, 150);\n// whoRan is invoked with context myContext\n// console logs 'throttle ran.'
\n
\n
\n \n", + "itemtype": "method", + "name": "throttle", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to invoke", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + }, + { + "name": "spacing", + "description": "Number of milliseconds to space out requests.", + "type": "Number" + }, + { + "name": "immediate", + "description": "Trigger the function on the leading instead\n of the trailing edge of the wait interval. Defaults to true.", + "type": "Boolean" + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/runloop/index.ts", + "line": 61, + "description": "

Array of named queues. This array determines the order in which queues\nare flushed at the end of the RunLoop. You can define your own queues by\nsimply adding the queue name to this array. Normally you should not need\nto inspect or modify this property.

\n", + "itemtype": "property", + "name": "queues", + "type": "Array", + "default": "['actions', 'destroy']", + "access": "private", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/routing/transition" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/runloop", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/service.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/service.json new file mode 100644 index 000000000..a04574e8b --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/service.json @@ -0,0 +1,88 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/service", + "type": "class", + "attributes": { + "name": "@ember/service", + "shortname": "@ember/service", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/service", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/service/index.ts", + "line": 10, + "itemtype": "method", + "name": "inject", + "static": 1, + "since": "1.10.0", + "params": [ + { + "name": "name", + "description": "(optional) name of the service to inject, defaults to\n the property's name", + "type": "String" + } + ], + "return": { + "description": "injection decorator instance", + "type": "ComputedDecorator" + }, + "access": "public", + "tagname": "", + "class": "@ember/service", + "module": "@ember/service" + }, + { + "file": "packages/@ember/service/index.ts", + "line": 30, + "description": "

Creates a property that lazily looks up a service in the container. There are\nno restrictions as to what objects a service can be injected into.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Route from '@ember/routing/route';\nimport { service } from '@ember/service';\n\nexport default class ApplicationRoute extends Route {\n  @service('auth') authManager;\n\n  model() {\n    return this.authManager.findCurrentUser();\n  }\n}
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Route from '@ember/routing/route';\nimport { service } from '@ember/service';\n\nexport default Route.extend({\n  authManager: service('auth'),\n\n  model() {\n    return this.get('authManager').findCurrentUser();\n  }\n});
\n
\n
\n \n

This example will create an authManager property on the application route\nthat looks up the auth service in the container, making it easily accessible\nin the model hook.

\n", + "itemtype": "method", + "name": "service", + "static": 1, + "since": "4.1.0", + "params": [ + { + "name": "name", + "description": "(optional) name of the service to inject, defaults to\n the property's name", + "type": "String" + } + ], + "return": { + "description": "injection decorator instance", + "type": "ComputedDecorator" + }, + "access": "public", + "tagname": "", + "class": "@ember/service", + "module": "@ember/service" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/service", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/template.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/template.json new file mode 100644 index 000000000..9980387a1 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/template.json @@ -0,0 +1,107 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/template", + "type": "class", + "attributes": { + "name": "@ember/template", + "shortname": "@ember/template", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/template", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/utils/managers.ts", + "line": 9, + "description": "

Associate a class with a component manager (an object that is responsible for\ncoordinating the lifecycle events that occurs when invoking, rendering and\nre-rendering a component).

\n", + "itemtype": "method", + "name": "setComponentManager", + "params": [ + { + "name": "factory", + "description": "a function to create the owner for an object", + "type": "Function" + }, + { + "name": "obj", + "description": "the object to associate with the componetn manager", + "type": "Object" + } + ], + "return": { + "description": "the same object passed in", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/template", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/utils/string.ts", + "line": 121, + "description": "

Use this method to indicate that a string should be rendered as HTML\nwhen the string is used in a template. To say this another way,\nstrings marked with htmlSafe will not be HTML escaped.

\n

A word of warning - The htmlSafe method does not make the string safe;\nit only tells the framework to treat the string as if it is safe to render\nas HTML. If a string contains user inputs or other untrusted\ndata, you must sanitize the string before using the htmlSafe method.\nOtherwise your code is vulnerable to\nCross-Site Scripting.\nThere are many open source sanitization libraries to choose from,\nboth for front end and server-side sanitization.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { htmlSafe } from '@ember/template';\n\nconst someTrustedOrSanitizedString = "<div>Hello!</div>"\n\nhtmlSafe(someTrustedorSanitizedString)
\n
\n
\n \n", + "itemtype": "method", + "name": "htmlSafe", + "params": [ + { + "name": "str", + "description": "The string to treat as trusted.", + "type": "String" + } + ], + "static": 1, + "return": { + "description": "A string that will not be HTML escaped by Handlebars.", + "type": "SafeString" + }, + "access": "public", + "tagname": "", + "class": "@ember/template", + "module": "@ember/template" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/utils/string.ts", + "line": 159, + "description": "

Detects if a string was decorated using htmlSafe.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { htmlSafe, isHTMLSafe } from '@ember/template';\n\nlet plainString = 'plain string';\nlet safeString = htmlSafe('<div>someValue</div>');\n\nisHTMLSafe(plainString); // false\nisHTMLSafe(safeString);  // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isHTMLSafe", + "static": 1, + "return": { + "description": "`true` if the string was decorated with `htmlSafe`, `false` otherwise.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/template", + "module": "@ember/template" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/template", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/test.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/test.json new file mode 100644 index 000000000..ff77fd51c --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/test.json @@ -0,0 +1,395 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/test", + "type": "class", + "attributes": { + "name": "@ember/test", + "shortname": "@ember/test", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/test", + "namespace": "", + "methods": [ + { + "file": "packages/ember-testing/lib/ext/application.ts", + "line": 64, + "description": "

This hook defers the readiness of the application, so that you can start\nthe app when your tests are ready to run. It also sets the router's\nlocation to 'none', so that the window's location will not be modified\n(preventing both accidental leaking of state between tests and interference\nwith your testing framework). setupForTesting should only be called after\nsetting a custom router class (for example App.Router = Router.extend().

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
App.setupForTesting();
\n
\n
\n ", + "itemtype": "method", + "name": "setupForTesting", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/ext/application.ts", + "line": 103, + "description": "

This injects the test helpers into the helperContainer object. If an object is provided\nit will be used as the helperContainer. If helperContainer is not set it will default\nto window. If a function of the same name has already been defined it will be cached\n(so that it can be reset if the helper is removed with unregisterHelper or\nremoveTestHelpers).

\n

Any callbacks registered with onInjectHelpers will be called once the\nhelpers have been injected.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
App.injectTestHelpers();
\n
\n
\n ", + "itemtype": "method", + "name": "injectTestHelpers", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/ext/application.ts", + "line": 148, + "description": "

This removes all helpers that have been registered, and resets and functions\nthat were overridden by the helpers.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
App.removeTestHelpers();
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "removeTestHelpers", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/helpers/current_path.ts", + "line": 9, + "description": "

Returns the current path.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
function validateURL() {\nequal(currentPath(), 'some.path.index', "correct path was transitioned into.");\n}\n\nclick('#some-link-id').then(validateURL);
\n
\n
\n \n", + "itemtype": "method", + "name": "currentPath", + "return": { + "description": "The currently active path.", + "type": "Object" + }, + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/current_route_name.ts", + "line": 8, + "description": "

Returns the currently active route name.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
function validateRouteName() {\nequal(currentRouteName(), 'some.path', "correct route was transitioned into.");\n}\nvisit('/some/path').then(validateRouteName)
\n
\n
\n \n", + "itemtype": "method", + "name": "currentRouteName", + "return": { + "description": "The name of the currently active route.", + "type": "Object" + }, + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/current_url.ts", + "line": 9, + "description": "

Returns the current URL.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
function validateURL() {\nequal(currentURL(), '/some/path', "correct URL was transitioned into.");\n}\n\nclick('#some-link-id').then(validateURL);
\n
\n
\n \n", + "itemtype": "method", + "name": "currentURL", + "return": { + "description": "The currently active URL.", + "type": "Object" + }, + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/pause_test.ts", + "line": 9, + "description": "

Resumes a test paused by pauseTest.

\n", + "itemtype": "method", + "name": "resumeTest", + "return": { + "description": "", + "type": "Void" + }, + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/pause_test.ts", + "line": 22, + "description": "

Pauses the current test - this is useful for debugging while testing or for test-driving.\nIt allows you to inspect the state of your application at any point.\nExample (The test will pause before clicking the button):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
visit('/')\nreturn pauseTest();\nclick('.btn');
\n
\n
\n \n

You may want to turn off the timeout before pausing.

\n

qunit (timeout available to use as of 2.4.0):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
visit('/');\nassert.timeout(0);\nreturn pauseTest();\nclick('.btn');
\n
\n
\n

mocha (timeout happens automatically as of ember-mocha v0.14.0):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
visit('/');\nthis.timeout(0);\nreturn pauseTest();\nclick('.btn');
\n
\n
\n ", + "since": "1.9.0", + "itemtype": "method", + "name": "pauseTest", + "return": { + "description": "A promise that will never resolve", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/visit.ts", + "line": 6, + "description": "

Loads a route, sets up any controllers, and renders any templates associated\nwith the route as though a real user had triggered the route change while\nusing your app.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
visit('posts/index').then(function() {\n  // assert something\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "visit", + "params": [ + { + "name": "url", + "description": "the name of the route", + "type": "String" + } + ], + "return": { + "description": "", + "type": "RSVP.Promise" + }, + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/helpers/wait.ts", + "line": 12, + "description": "

Causes the run loop to process any pending events. This is used to ensure that\nany async operations from other helpers (or your assertions) have been processed.

\n

This is most often used as the return value for the helper functions (see 'click',\n'fillIn','visit',etc). However, there is a method to register a test helper which\nutilizes this method without the need to actually call wait() in your helpers.

\n

The wait helper is built into registerAsyncHelper by default. You will not need\nto return app.testHelpers.wait(); - the wait behavior is provided for you.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import { registerAsyncHelper } from '@ember/test';\n\nregisterAsyncHelper('loginUser', function(app, username, password) {\n  visit('secured/path/here')\n    .fillIn('#username', username)\n    .fillIn('#password', password)\n    .click('.submit');\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "wait", + "params": [ + { + "name": "value", + "description": "The value to be returned.", + "type": "Object" + } + ], + "return": { + "description": "Promise that resolves to the passed value.", + "type": "RSVP.Promise" + }, + "access": "public", + "tagname": "", + "since": "1.0.0", + "class": "@ember/test", + "module": "ember" + }, + { + "file": "packages/ember-testing/lib/test/helpers.ts", + "line": 16, + "description": "

registerHelper is used to register a test helper that will be injected\nwhen App.injectTestHelpers is called.

\n

The helper method will always be called with the current Application as\nthe first parameter.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import { registerHelper } from '@ember/test';\nimport { run } from '@ember/runloop';\n\nregisterHelper('boot', function(app) {\n  run(app, app.advanceReadiness);\n});
\n
\n
\n \n

This helper can later be called without arguments because it will be\ncalled with app as the first parameter.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import Application from '@ember/application';\n\nApp = Application.create();\nApp.injectTestHelpers();\nboot();
\n
\n
\n \n", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "registerHelper", + "params": [ + { + "name": "name", + "description": "The name of the helper method to add.", + "type": "String" + }, + { + "name": "helperMethod", + "description": "", + "type": "Function" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/helpers.ts", + "line": 63, + "description": "

registerAsyncHelper is used to register an async test helper that will be injected\nwhen App.injectTestHelpers is called.

\n

The helper method will always be called with the current Application as\nthe first parameter.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import { registerAsyncHelper } from '@ember/test';\nimport { run } from '@ember/runloop';\n\nregisterAsyncHelper('boot', function(app) {\n  run(app, app.advanceReadiness);\n});
\n
\n
\n \n

The advantage of an async helper is that it will not run\nuntil the last async helper has completed. All async helpers\nafter it will wait for it complete before running.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { registerAsyncHelper } from '@ember/test';\n\nregisterAsyncHelper('deletePost', function(app, postId) {\n  click('.delete-' + postId);\n});\n\n// ... in your test\nvisit('/post/2');\ndeletePost(2);\nvisit('/post/3');\ndeletePost(3);
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "registerAsyncHelper", + "params": [ + { + "name": "name", + "description": "The name of the helper method to add.", + "type": "String" + }, + { + "name": "helperMethod", + "description": "", + "type": "Function" + } + ], + "since": "1.2.0", + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/helpers.ts", + "line": 116, + "description": "

Remove a previously added helper method.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import { unregisterHelper } from '@ember/test';\n\nunregisterHelper('wait');
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregisterHelper", + "static": 1, + "params": [ + { + "name": "name", + "description": "The helper to remove.", + "type": "String" + } + ], + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/waiters.ts", + "line": 7, + "description": "

This allows ember-testing to play nicely with other asynchronous\nevents, such as an application that is waiting for a CSS3\ntransition or an IndexDB transaction. The waiter runs periodically\nafter each async helper (i.e. click, andThen, visit, etc) has executed,\nuntil the returning result is truthy. After the waiters finish, the next async helper\nis executed and the process repeats.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { registerWaiter } from '@ember/test';\n\nregisterWaiter(function() {\n  return myPendingTransactions() === 0;\n});
\n
\n
\n \n

The context argument allows you to optionally specify the this\nwith which your callback will be invoked.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import { registerWaiter } from '@ember/test';\n\nregisterWaiter(MyDB, MyDB.hasPendingTransactions);
\n
\n
\n \n", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "registerWaiter", + "params": [ + { + "name": "context", + "description": "(optional)", + "type": "Object" + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "since": "1.2.0", + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/waiters.ts", + "line": 70, + "description": "

unregisterWaiter is used to unregister a callback that was\nregistered with registerWaiter.

\n", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "unregisterWaiter", + "params": [ + { + "name": "context", + "description": "(optional)", + "type": "Object" + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "since": "1.2.0", + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/waiters.ts", + "line": 98, + "description": "

Iterates through each registered test waiter, and invokes\nits callback. If any waiter returns false, this method will return\ntrue indicating that the waiters have not settled yet.

\n

This is generally used internally from the acceptance/integration test\ninfrastructure.

\n", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "checkWaiters", + "class": "@ember/test", + "module": "@ember/test" + } + ], + "events": [], + "properties": [ + { + "file": "packages/ember-testing/lib/ext/application.ts", + "line": 23, + "description": "

This property contains the testing helpers for the current application. These\nare created once you call injectTestHelpers on your Application\ninstance. The included helpers are also available on the window object by\ndefault, but can be used from this object on the individual application also.

\n", + "itemtype": "property", + "name": "testHelpers", + "type": "{Object}", + "default": "{}", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/ext/application.ts", + "line": 36, + "description": "

This property will contain the original methods that were registered\non the helperContainer before injectTestHelpers is called.

\n

When removeTestHelpers is called, these methods are restored to the\nhelperContainer.

\n", + "itemtype": "property", + "name": "originalMethods", + "type": "{Object}", + "default": "{}", + "access": "private", + "tagname": "", + "since": "1.3.0", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/ext/application.ts", + "line": 51, + "description": "

This property indicates whether or not this application is currently in\ntesting mode. This is set when setupForTesting is called on the current\napplication.

\n", + "itemtype": "property", + "name": "testing", + "type": "{Boolean}", + "default": "false", + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + }, + { + "file": "packages/ember-testing/lib/ext/application.ts", + "line": 91, + "description": "

This will be used as the container to inject the test helpers into. By\ndefault the helpers are injected into window.

\n", + "itemtype": "property", + "name": "helperContainer", + "type": "{Object} The object to be used for test helpers.", + "default": "window", + "since": "1.2.0", + "access": "private", + "tagname": "", + "class": "@ember/test", + "module": "ember", + "namespace": "Ember.Test" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/test", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/utils.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/utils.json new file mode 100644 index 000000000..da21543d5 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-@ember/utils.json @@ -0,0 +1,213 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/utils", + "type": "class", + "attributes": { + "name": "@ember/utils", + "shortname": "@ember/utils", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/utils", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/utils/lib/compare.ts", + "line": 53, + "description": "

Compares two javascript values and returns:

\n
    \n
  • -1 if the first is smaller than the second,

    \n
  • \n
  • 0 if both are equal,

    \n
  • \n
  • 1 if the first is greater than the second.

    \n
    \n
    \n
    \n \n \n \n \n \n \n \n
    1\n2\n3\n4\n5\n
    import { compare } from '@ember/utils';\n\ncompare('hello', 'hello');  // 0\ncompare('abc', 'dfg');      // -1\ncompare(2, 1);              // 1
    \n
    \n
    \n \n
  • \n
\n

If the types of the two objects are different precedence occurs in the\nfollowing order, with types earlier in the list considered < types\nlater in the list:

\n
    \n
  • undefined

    \n
  • \n
  • null

    \n
  • \n
  • boolean

    \n
  • \n
  • number

    \n
  • \n
  • string

    \n
  • \n
  • array

    \n
  • \n
  • object

    \n
  • \n
  • instance

    \n
  • \n
  • function

    \n
  • \n
  • class

    \n
  • \n
  • date

    \n
    \n
    \n
    \n \n \n \n \n \n \n \n
    1\n2\n3\n4\n
    import { compare } from '@ember/utils';\n\ncompare('hello', 50);       // 1\ncompare(50, 'hello');       // -1
    \n
    \n
    \n \n
  • \n
\n", + "itemtype": "method", + "name": "compare", + "static": 1, + "params": [ + { + "name": "v", + "description": "First value to compare", + "type": "Object" + }, + { + "name": "w", + "description": "Second value to compare", + "type": "Object" + } + ], + "return": { + "description": "-1 if v < w, 0 if v = w and 1 if v > w.", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/utils/lib/is-equal.ts", + "line": 4, + "description": "

Compares two objects, returning true if they are equal.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
import { isEqual } from '@ember/utils';\n\nisEqual('hello', 'hello');                   // true\nisEqual(1, 2);                               // false
\n
\n
\n \n

isEqual is a more specific comparison than a triple equal comparison.\nIt will call the isEqual instance method on the objects being\ncompared, allowing finer control over when objects should be considered\nequal to each other.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { isEqual } from '@ember/utils';\nimport EmberObject from '@ember/object';\n\nlet Person = EmberObject.extend({\n  isEqual(other) { return this.ssn == other.ssn; }\n});\n\nlet personA = Person.create({name: 'Muhammad Ali', ssn: '123-45-6789'});\nlet personB = Person.create({name: 'Cassius Clay', ssn: '123-45-6789'});\n\nisEqual(personA, personB); // true
\n
\n
\n \n

Due to the expense of array comparisons, collections will never be equal to\neach other even if each of their items are equal to each other.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import { isEqual } from '@ember/utils';\n\nisEqual([4, 2], [4, 2]);                     // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isEqual", + "static": 1, + "params": [ + { + "name": "a", + "description": "first object to compare", + "type": "Object" + }, + { + "name": "b", + "description": "second object to compare", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/utils/lib/is_blank.ts", + "line": 5, + "description": "

A value is blank if it is empty or a whitespace string.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import { isBlank } from '@ember/utils';\n\nisBlank(null);            // true\nisBlank(undefined);       // true\nisBlank('');              // true\nisBlank([]);              // true\nisBlank('\\n\\t');          // true\nisBlank('  ');            // true\nisBlank({});              // false\nisBlank('\\n\\t Hello');    // false\nisBlank('Hello world');   // false\nisBlank([1,2,3]);         // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isBlank", + "static": 1, + "params": [ + { + "name": "obj", + "description": "Value to test", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/utils/lib/is_empty.ts", + "line": 6, + "description": "

Verifies that a value is null or undefined, an empty string, or an empty\narray.

\n

Constrains the rules on isNone by returning true for empty strings and\nempty arrays.

\n

If the value is an object with a size property of type number, it is used\nto check emptiness.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
isEmpty(null);             // true\nisEmpty(undefined);        // true\nisEmpty('');               // true\nisEmpty([]);               // true\nisEmpty({ size: 0});       // true\nisEmpty({});               // false\nisEmpty('Adam Hawkins');   // false\nisEmpty([0,1,2]);          // false\nisEmpty('\\n\\t');           // false\nisEmpty('  ');             // false\nisEmpty({ size: 1 })       // false\nisEmpty({ size: () => 0 }) // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isEmpty", + "static": 1, + "params": [ + { + "name": "obj", + "description": "Value to test", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/utils/lib/is_none.ts", + "line": 4, + "description": "

Returns true if the passed value is null or undefined. This avoids errors\nfrom JSLint complaining about use of ==, which can be technically\nconfusing.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
isNone(null);          // true\nisNone(undefined);     // true\nisNone('');            // false\nisNone([]);            // false\nisNone(function() {}); // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isNone", + "static": 1, + "params": [ + { + "name": "obj", + "description": "Value to test", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/utils/lib/is_present.ts", + "line": 5, + "description": "

A value is present if it not isBlank.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
isPresent(null);            // false\nisPresent(undefined);       // false\nisPresent('');              // false\nisPresent('  ');            // false\nisPresent('\\n\\t');          // false\nisPresent([]);              // false\nisPresent({ length: 0 });   // false\nisPresent(false);           // true\nisPresent(true);            // true\nisPresent('string');        // true\nisPresent(0);               // true\nisPresent(function() {});   // true\nisPresent({});              // true\nisPresent('\\n\\t Hello');    // true\nisPresent([1, 2, 3]);       // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isPresent", + "static": 1, + "params": [ + { + "name": "obj", + "description": "Value to test", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.8.0", + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/utils/lib/type-of.ts", + "line": 40, + "description": "

Returns a consistent type for the passed object.

\n

Use this instead of the built-in typeof to get the type of an item.\nIt will return the same result across all browsers and includes a bit\nmore detail. Here is what will be returned:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
| Return Value  | Meaning                                              |\n|---------------|------------------------------------------------------|\n| 'string'      | String primitive or String object.                   |\n| 'number'      | Number primitive or Number object.                   |\n| 'boolean'     | Boolean primitive or Boolean object.                 |\n| 'null'        | Null value                                           |\n| 'undefined'   | Undefined value                                      |\n| 'function'    | A function                                           |\n| 'array'       | An instance of Array                                 |\n| 'regexp'      | An instance of RegExp                                |\n| 'date'        | An instance of Date                                  |\n| 'filelist'    | An instance of FileList                              |\n| 'class'       | An Ember class (created using EmberObject.extend())  |\n| 'instance'    | An Ember object instance                             |\n| 'error'       | An instance of the Error object                      |\n| 'object'      | A JavaScript object not inheriting from EmberObject  |
\n
\n
\n

Examples:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n
import { A } from '@ember/array';\nimport { typeOf } from '@ember/utils';\nimport EmberObject from '@ember/object';\n\ntypeOf();                       // 'undefined'\ntypeOf(null);                   // 'null'\ntypeOf(undefined);              // 'undefined'\ntypeOf('michael');              // 'string'\ntypeOf(new String('michael'));  // 'string'\ntypeOf(101);                    // 'number'\ntypeOf(new Number(101));        // 'number'\ntypeOf(true);                   // 'boolean'\ntypeOf(new Boolean(true));      // 'boolean'\ntypeOf(A);                      // 'function'\ntypeOf(A());                    // 'array'\ntypeOf([1, 2, 90]);             // 'array'\ntypeOf(/abc/);                  // 'regexp'\ntypeOf(new Date());             // 'date'\ntypeOf(event.target.files);     // 'filelist'\ntypeOf(EmberObject.extend());   // 'class'\ntypeOf(EmberObject.create());   // 'instance'\ntypeOf(new Error('teamocil'));  // 'error'\n\n// 'normal' JavaScript object\ntypeOf({ a: 'b' });             // 'object'
\n
\n
\n \n", + "itemtype": "method", + "name": "typeOf", + "params": [ + { + "name": "item", + "description": "the item to check" + } + ], + "return": { + "description": "the type", + "type": "String" + }, + "access": "public", + "tagname": "", + "static": 1, + "class": "@ember/utils", + "module": "@ember/utils" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/utils", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-@glimmer/tracking.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-@glimmer/tracking.json new file mode 100644 index 000000000..ba0c0353a --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-@glimmer/tracking.json @@ -0,0 +1,65 @@ +{ + "data": { + "id": "ember-5.3.0-@glimmer/tracking", + "type": "class", + "attributes": { + "name": "@glimmer/tracking", + "shortname": "@glimmer/tracking", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@glimmer/tracking", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/glimmer-tracking-docs.ts", + "line": 22, + "description": "

Marks a property as tracked. By default, values that are rendered in Ember app\ntemplates are static, meaning that updates to them won't cause the\napplication to rerender. Marking a property as tracked means that when that\nproperty changes, any templates that used that property, directly or\nindirectly, will rerender. For instance, consider this component:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
<div>Count: {{this.count}}</div>\n<div>Times Ten: {{this.timesTen}}</div>\n<div>\n  <button {{on "click" this.plusOne}}>\n    Plus One\n  </button>\n</div>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { action } from '@ember/object';\n\nexport default class CounterComponent extends Component {\n  @tracked count = 0;\n\n  get timesTen() {\n    return this.count * 10;\n  }\n\n  @action\n  plusOne() {\n    this.count += 1;\n  }\n}
\n
\n
\n \n

Both the {{this.count}} and the {{this.timesTen}} properties in the\ntemplate will update whenever the button is clicked. Any tracked properties\nthat are used in any way to calculate a value that is used in the template\nwill cause a rerender when updated - this includes through method calls and\nother means:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n42\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\n\nclass Entry {\n  @tracked name;\n  @tracked phoneNumber;\n\n  constructor(name, phoneNumber) {\n    this.name = name;\n    this.phoneNumber = phoneNumber;\n  }\n}\n\nexport default class PhoneBookComponent extends Component {\n  entries = [\n    new Entry('Pizza Palace', 5551234),\n    new Entry('1st Street Cleaners', 5554321),\n    new Entry('Plants R Us', 5552468),\n  ];\n\n  // Any usage of this property will update whenever any of the names in the\n  // entries arrays are updated\n  get names() {\n    return this.entries.map(e => e.name);\n  }\n\n  // Any usage of this property will update whenever any of the numbers in the\n  // entries arrays are updated\n  get numbers() {\n    return this.getFormattedNumbers();\n  }\n\n  getFormattedNumbers() {\n    return this.entries\n      .map(e => e.phoneNumber)\n      .map(number => {\n        let numberString = '' + number;\n\n        return numberString.slice(0, 3) + '-' + numberString.slice(3);\n      });\n  }\n}
\n
\n
\n \n

It's important to note that setting tracked properties will always trigger an\nupdate, even if the property is set to the same value as it was before.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let entry = new Entry('Pizza Palace', 5551234);\n\n// if entry was used when rendering, this would cause a rerender, even though\n// the name is being set to the same value as it was before\nentry.name = entry.name;
\n
\n
\n \n

tracked can also be used with the classic Ember object model in a similar\nmanner to classic computed properties:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import EmberObject from '@ember/object';\nimport { tracked } from '@glimmer/tracking';\n\nconst Entry = EmberObject.extend({\n  name: tracked(),\n  phoneNumber: tracked()\n});
\n
\n
\n \n

Often this is unnecessary, but to ensure robust auto-tracking behavior it is\nadvisable to mark tracked state appropriately wherever possible.

\n

This form of tracked also accepts an optional configuration object\ncontaining either an initial value or an initializer function (but not\nboth).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import EmberObject from '@ember/object';\nimport { tracked } from '@glimmer/tracking';\n\nconst Entry = EmberObject.extend({\n  name: tracked({ value: 'Zoey' }),\n  favoriteSongs: tracked({\n    initializer: () => ['Raspberry Beret', 'Time After Time']\n  })\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "tracked", + "static": 1, + "access": "public", + "tagname": "", + "class": "@glimmer/tracking", + "module": "@glimmer/tracking" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/glimmer-tracking-docs.ts", + "line": 158, + "description": "

Gives the getter a caching behavior. The return value of the getter\nwill be cached until any of the properties it is entangled with\nare invalidated. This is useful when a getter is expensive and\nused very often.

\n

For instance, in this GuestList class, we have the sortedGuests\ngetter that sorts the guests alphabetically:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
  import { tracked } from '@glimmer/tracking';\n\n  class GuestList {\n    @tracked guests = ['Zoey', 'Tomster'];\n\n    get sortedGuests() {\n      return this.guests.slice().sort()\n    }\n  }
\n
\n
\n \n

Every time sortedGuests is accessed, a new array will be created and sorted,\nbecause JavaScript getters do not cache by default. When the guest list\nis small, like the one in the example, this is not a problem. However, if\nthe guest list were to grow very large, it would mean that we would be doing\na large amount of work each time we accessed sortedGuests. With @cached,\nwe can cache the value instead:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
  import { tracked, cached } from '@glimmer/tracking';\n\n  class GuestList {\n    @tracked guests = ['Zoey', 'Tomster'];\n\n    @cached\n    get sortedGuests() {\n      return this.guests.slice().sort()\n    }\n  }
\n
\n
\n \n

Now the sortedGuests getter will be cached based on autotracking.\nIt will only rerun and create a new sorted array when the guests tracked\nproperty is updated.

\n

Tradeoffs

\n

Overuse is discouraged.

\n

In general, you should avoid using @cached unless you have confirmed that\nthe getter you are decorating is computationally expensive, since @cached\nadds a small amount of overhead to the getter.\nWhile the individual costs are small, a systematic use of the @cached\ndecorator can add up to a large impact overall in your app.\nMany getters and tracked properties are only accessed once during rendering,\nand then never rerendered, so adding @cached when unnecessary can\nnegatively impact performance.

\n

Also, @cached may rerun even if the values themselves have not changed,\nsince tracked properties will always invalidate.\nFor example updating an integer value from 5 to an other 5 will trigger\na rerun of the cached properties building from this integer.

\n

Avoiding a cache invalidation in this case is not something that can\nbe achieved on the @cached decorator itself, but rather when updating\nthe underlying tracked values, by applying some diff checking mechanisms:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
if (nextValue !== this.trackedProp) {\n  this.trackedProp = nextValue;\n}
\n
\n
\n \n

Here equal values won't update the property, therefore not triggering\nthe subsequent cache invalidations of the @cached properties who were\nusing this trackedProp.

\n

As a reminder, do not use this piece of code inside a tracked getter,\nas the dependency chain could lead to an infinite loop. Mutating an adjacent\nproperty from a getter is not a good practice anyway, even with a caching\nmechanism reducing reruns.

\n

The cost of these edge-guards adds up to the trade-off calculation of using\na caching strategy, hence requiring a very sensitive and moderate approach\nregarding performance.

\n", + "itemtype": "method", + "name": "cached", + "static": 1, + "access": "public", + "tagname": "", + "class": "@glimmer/tracking", + "module": "@glimmer/tracking" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@glimmer/tracking", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-@glimmer/tracking/primitives/cache.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-@glimmer/tracking/primitives/cache.json new file mode 100644 index 000000000..1ac26f8b8 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-@glimmer/tracking/primitives/cache.json @@ -0,0 +1,77 @@ +{ + "data": { + "id": "ember-5.3.0-@glimmer/tracking/primitives/cache", + "type": "class", + "attributes": { + "name": "@glimmer/tracking/primitives/cache", + "shortname": "@glimmer/tracking/primitives/cache", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@glimmer/tracking/primitives/cache", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/cache.ts", + "line": 14, + "description": "

Receives a function, and returns a wrapped version of it that memoizes based on\nautotracking. The function will only rerun whenever any tracked values used\nwithin it have changed. Otherwise, it will return the previous value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n
import { tracked } from '@glimmer/tracking';\nimport { createCache, getValue } from '@glimmer/tracking/primitives/cache';\n\nclass State {\n  @tracked value;\n}\n\nlet state = new State();\nlet computeCount = 0;\n\nlet counter = createCache(() => {\n  // consume the state. Now, `counter` will\n  // only rerun if `state.value` changes.\n  state.value;\n\n  return ++computeCount;\n});\n\ngetValue(counter); // 1\n\n// returns the same value because no tracked state has changed\ngetValue(counter); // 1\n\nstate.value = 'foo';\n\n// reruns because a tracked value used in the function has changed,\n// incermenting the counter\ngetValue(counter); // 2
\n
\n
\n \n", + "itemtype": "method", + "name": "createCache", + "static": 1, + "access": "public", + "tagname": "", + "class": "@glimmer/tracking/primitives/cache", + "module": "@glimmer/tracking/primitives/cache" + }, + { + "file": "packages/@ember/-internals/metal/lib/cache.ts", + "line": 56, + "description": "

Gets the value of a cache created with createCache.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { tracked } from '@glimmer/tracking';\nimport { createCache, getValue } from '@glimmer/tracking/primitives/cache';\n\nlet computeCount = 0;\n\nlet counter = createCache(() => {\n  return ++computeCount;\n});\n\ngetValue(counter); // 1
\n
\n
\n \n", + "itemtype": "method", + "name": "getValue", + "static": 1, + "access": "public", + "tagname": "", + "class": "@glimmer/tracking/primitives/cache", + "module": "@glimmer/tracking/primitives/cache" + }, + { + "file": "packages/@ember/-internals/metal/lib/cache.ts", + "line": 78, + "description": "

Can be used to check if a memoized function is constant. If no tracked state\nwas used while running a memoized function, it will never rerun, because nothing\ncan invalidate its result. isConst can be used to determine if a memoized\nfunction is constant or not, in order to optimize code surrounding that\nfunction.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n
import { tracked } from '@glimmer/tracking';\nimport { createCache, getValue, isConst } from '@glimmer/tracking/primitives/cache';\n\nclass State {\n  @tracked value;\n}\n\nlet state = new State();\nlet computeCount = 0;\n\nlet counter = createCache(() => {\n  // consume the state\n  state.value;\n\n  return computeCount++;\n});\n\nlet constCounter = createCache(() => {\n  return computeCount++;\n});\n\ngetValue(counter);\ngetValue(constCounter);\n\nisConst(counter); // false\nisConst(constCounter); // true
\n
\n
\n \n

If called on a cache that hasn't been accessed yet, it will throw an\nerror. This is because there's no way to know if the function will be constant\nor not yet, and so this helps prevent missing an optimization opportunity on\naccident.

\n", + "itemtype": "method", + "name": "isConst", + "static": 1, + "access": "public", + "tagname": "", + "class": "@glimmer/tracking/primitives/cache", + "module": "@glimmer/tracking/primitives/cache" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@glimmer/tracking/primitives/cache", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-Application.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-Application.json new file mode 100644 index 000000000..25330eb51 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-Application.json @@ -0,0 +1,573 @@ +{ + "data": { + "id": "ember-5.3.0-Application", + "type": "class", + "attributes": { + "name": "Application", + "shortname": "Application", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/application", + "namespace": "", + "file": "packages/@ember/application/index.ts", + "line": 42, + "description": "

An instance of Application is the starting point for every Ember\napplication. It instantiates, initializes and coordinates the\nobjects that make up your app.

\n

Each Ember app has one and only one Application object. Although\nEmber CLI creates this object implicitly, the Application class\nis defined in the app/app.js. You can define a ready method on the\nApplication class, which will be run by Ember when the application is\ninitialized.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n
export default class App extends Application {\n  ready() {\n    // your code here\n  }\n}
\n
\n
\n \n

Because Application ultimately inherits from Ember.Namespace, any classes\nyou create will have useful string representations when calling toString().\nSee the Ember.Namespace documentation for more information.

\n

While you can think of your Application as a container that holds the\nother classes in your application, there are several other responsibilities\ngoing on under-the-hood that you may want to understand. It is also important\nto understand that an Application is different from an ApplicationInstance.\nRefer to the Guides to understand the difference between these.

\n

Event Delegation

\n

Ember uses a technique called event delegation. This allows the framework\nto set up a global, shared event listener instead of requiring each view to\ndo it manually. For example, instead of each view registering its own\nmousedown listener on its associated element, Ember sets up a mousedown\nlistener on the body.

\n

If a mousedown event occurs, Ember will look at the target of the event and\nstart walking up the DOM node tree, finding corresponding views and invoking\ntheir mouseDown method as it goes.

\n

Application has a number of default events that it listens for, as\nwell as a mapping from lowercase events to camel-cased view method names. For\nexample, the keypress event causes the keyPress method on the view to be\ncalled, the dblclick event causes doubleClick to be called, and so on.

\n

If there is a bubbling browser event that Ember does not listen for by\ndefault, you can specify custom events and their corresponding view method\nnames by setting the application's customEvents property:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Application from '@ember/application';\n\nexport default class App extends Application {\n  customEvents = {\n    // add support for the paste event\n    paste: 'paste'\n  }\n}
\n
\n
\n \n

To prevent Ember from setting up a listener for a default event,\nspecify the event name with a null value in the customEvents\nproperty:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Application from '@ember/application';\n\nexport default class App extends Application {\n  customEvents = {\n    // prevent listeners for mouseenter/mouseleave events\n    mouseenter: null,\n    mouseleave: null\n  }\n}
\n
\n
\n \n

By default, the application sets up these event listeners on the document\nbody. However, in cases where you are embedding an Ember application inside\nan existing page, you may want it to set up the listeners on an element\ninside the body.

\n

For example, if only events inside a DOM element with the ID of ember-app\nshould be delegated, set your application's rootElement property:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n
import Application from '@ember/application';\n\nexport default class App extends Application {\n  rootElement = '#ember-app'\n}
\n
\n
\n \n

The rootElement can be either a DOM element or a CSS selector\nstring. Note that views appended to the DOM outside the root element will\nnot receive events. If you specify a custom root element, make sure you only\nappend views inside it!

\n

To learn more about the events Ember components use, see

\n

components/handling-events.

\n

Initializers

\n

To add behavior to the Application's boot process, you can define initializers in\nthe app/initializers directory, or with ember generate initializer using Ember CLI.\nThese files should export a named initialize function which will receive the created application\nobject as its first argument.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
export function initialize(application) {\n  // application.inject('route', 'foo', 'service:foo');\n}
\n
\n
\n \n

Application initializers can be used for a variety of reasons including:

\n
    \n
  • setting up external libraries
  • \n
  • injecting dependencies
  • \n
  • setting up event listeners in embedded apps
  • \n
  • deferring the boot process using the deferReadiness and advanceReadiness APIs.
  • \n
\n

Routing

\n

In addition to creating your application's router, Application is\nalso responsible for telling the router when to start routing. Transitions\nbetween routes can be logged with the LOG_TRANSITIONS flag, and more\ndetailed intra-transition logging can be logged with\nthe LOG_TRANSITIONS_INTERNAL flag:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import Application from '@ember/application';\n\nlet App = Application.create({\n  LOG_TRANSITIONS: true, // basic logging of successful transitions\n  LOG_TRANSITIONS_INTERNAL: true // detailed logging of all routing steps\n});
\n
\n
\n \n

By default, the router will begin trying to translate the current URL into\napplication state once the browser emits the DOMContentReady event. If you\nneed to defer routing, you can call the application's deferReadiness()\nmethod. Once routing can begin, call the advanceReadiness() method.

\n

If there is any setup required before routing begins, you can implement a\nready() method on your app that will be invoked immediately before routing\nbegins.

\n", + "extends": "Engine", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/application/index.ts", + "line": 196, + "description": "

This creates a registry with the default Ember naming conventions.

\n

It also configures the registry:

\n
    \n
  • registered views are created every time they are looked up (they are\nnot singletons)
  • \n
  • registered templates are not factories; the registered value is\nreturned directly.
  • \n
  • the router receives the application as its namespace property
  • \n
  • all controllers receive the router as their target and controllers\nproperties
  • \n
  • all controllers receive the application as their namespace property
  • \n
  • the application view receives the application controller as its\ncontroller property
  • \n
  • the application view receives the application template as its\ndefaultTemplate property
  • \n
\n", + "itemtype": "method", + "name": "buildRegistry", + "static": 1, + "params": [ + { + "name": "namespace", + "description": "the application for which to\n build the registry", + "type": "Application" + } + ], + "return": { + "description": "the built registry", + "type": "Ember.Registry" + }, + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 443, + "description": "

Create an ApplicationInstance for this application.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "buildInstance", + "return": { + "description": "the application instance", + "type": "ApplicationInstance" + }, + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 468, + "description": "

Start tracking an ApplicationInstance for this application.\nUsed when the ApplicationInstance is created.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_watchInstance", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 479, + "description": "

Stop tracking an ApplicationInstance for this application.\nUsed when the ApplicationInstance is about to be destroyed.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_unwatchInstance", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 492, + "description": "

Enable the legacy globals mode by allowing this application to act\nas a global namespace. See the docs on the _globalsMode property\nfor details.

\n

Most of these features are already deprecated in 1.x, so we can\nstop using them internally and try to remove them.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_prepareForGlobalsMode", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 539, + "description": "

Automatically kick-off the boot process for the application once the\nDOM has become ready.

\n

The initialization itself is scheduled on the actions queue which\nensures that code-loading finishes before booting.

\n

If you are asynchronously loading code, you should call deferReadiness()\nto defer booting, and then call advanceReadiness() once all of your code\nhas finished loading.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "waitForDOMReady", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 579, + "description": "

This is the autoboot flow:

\n
    \n
  1. Boot the app by calling this.boot()
  2. \n
  3. Create an instance (or use the __deprecatedInstance__ in globals mode)
  4. \n
  5. Boot the instance by calling instance.boot()
  6. \n
  7. Invoke the App.ready() callback
  8. \n
  9. Kick-off routing on the instance
  10. \n
\n

Ideally, this is all we would need to do:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
_autoBoot() {\n  this.boot().then(() => {\n    let instance = (this._globalsMode) ? this.__deprecatedInstance__ : this.buildInstance();\n    return instance.boot();\n  }).then((instance) => {\n    App.ready();\n    instance.startRouting();\n  });\n}
\n
\n
\n \n

Unfortunately, we cannot actually write this because we need to participate\nin the "synchronous" boot process. While the code above would work fine on\nthe initial boot (i.e. DOM ready), when App.reset() is called, we need to\nboot a new instance synchronously (see the documentation on _bootSync()\nfor details).

\n

Because of this restriction, the actual logic of this method is located\ninside didBecomeReady().

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "domReady", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 624, + "description": "

Use this to defer readiness until some condition is true.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Application from '@ember/application';\n\nlet App = Application.create();\n\nApp.deferReadiness();\n\nfetch('/auth-token')\n.then(response => response.json())\n.then(data => {\n  App.token = data.token;\n  App.advanceReadiness();\n});
\n
\n
\n \n

This allows you to perform asynchronous setup logic and defer\nbooting your application until the setup has finished.

\n

However, if the setup requires a loading UI, it might be better\nto use the router for this purpose.

\n", + "itemtype": "method", + "name": "deferReadiness", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 674, + "description": "

Call advanceReadiness after any asynchronous setup logic has completed.\nEach call to deferReadiness must be matched by a call to advanceReadiness\nor the application will never become ready and routing will not begin.

\n", + "itemtype": "method", + "name": "advanceReadiness", + "see": [ + "{Application#deferReadiness}" + ], + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 713, + "description": "

Initialize the application and return a promise that resolves with the Application\nobject when the boot process is complete.

\n

Run any application initializers and run the application load hook. These hooks may\nchoose to defer readiness. For example, an authentication hook might want to defer\nreadiness until the auth token has been retrieved.

\n

By default, this method is called automatically on "DOM ready"; however, if autoboot\nis disabled, this is automatically called when the first application instance is\ncreated via visit.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "boot", + "return": { + "description": "", + "type": "Promise" + }, + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 794, + "description": "

Reset the application. This is typically used only in tests. It cleans up\nthe application in the following order:

\n
    \n
  1. Deactivate existing routes
  2. \n
  3. Destroy all objects in the container
  4. \n
  5. Create a new application container
  6. \n
  7. Re-route to the existing url
  8. \n
\n

Typical Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Application from '@ember/application';\nlet App;\n\nrun(function() {\n  App = Application.create();\n});\n\nmodule('acceptance test', {\n  setup: function() {\n    App.reset();\n  }\n});\n\ntest('first test', function() {\n  // App is freshly reset\n});\n\ntest('second test', function() {\n  // App is again freshly reset\n});
\n
\n
\n \n

Advanced Example:

\n

Occasionally you may want to prevent the app from initializing during\nsetup. This could enable extra configuration, or enable asserting prior\nto the app becoming ready.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n
import Application from '@ember/application';\nlet App;\n\nrun(function() {\n  App = Application.create();\n});\n\nmodule('acceptance test', {\n  setup: function() {\n    run(function() {\n      App.reset();\n      App.deferReadiness();\n    });\n  }\n});\n\ntest('first test', function() {\n  ok(true, 'something before app is initialized');\n\n  run(function() {\n    App.advanceReadiness();\n  });\n\n  ok(true, 'something after app is initialized');\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "reset", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 898, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "didBecomeReady", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 976, + "description": "

Boot a new instance of ApplicationInstance for the current\napplication and navigate it to the given url. Returns a Promise that\nresolves with the instance when the initial routing and rendering is\ncomplete, or rejects with any error that occurred during the boot process.

\n

When autoboot is disabled, calling visit would first cause the\napplication to boot, which runs the application initializers.

\n

This method also takes a hash of boot-time configuration options for\ncustomizing the instance's behavior. See the documentation on\nApplicationInstance.BootOptions for details.

\n

ApplicationInstance.BootOptions is an interface class that exists\npurely to document the available options; you do not need to construct it\nmanually. Simply pass a regular JavaScript object containing of the\ndesired options:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
MyApp.visit("/", { location: "none", rootElement: "#container" });
\n
\n
\n \n

Supported Scenarios

\n

While the BootOptions class exposes a large number of knobs, not all\ncombinations of them are valid; certain incompatible combinations might\nresult in unexpected behavior.

\n

For example, booting the instance in the full browser environment\nwhile specifying a foreign document object (e.g. { isBrowser: true,\ndocument: iframe.contentDocument }) does not work correctly today,\nlargely due to Ember's jQuery dependency.

\n

Currently, there are three officially supported scenarios/configurations.\nUsages outside of these scenarios are not guaranteed to work, but please\nfeel free to file bug reports documenting your experience and any issues\nyou encountered to help expand support.

\n

Browser Applications (Manual Boot)

\n

The setup is largely similar to how Ember works out-of-the-box. Normally,\nEmber will boot a default instance for your Application on "DOM ready".\nHowever, you can customize this behavior by disabling autoboot.

\n

For example, this allows you to render a miniture demo of your application\ninto a specific area on your marketing website:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import MyApp from 'my-app';\n\n$(function() {\n  let App = MyApp.create({ autoboot: false });\n\n  let options = {\n    // Override the router's location adapter to prevent it from updating\n    // the URL in the address bar\n    location: 'none',\n\n    // Override the default `rootElement` on the app to render into a\n    // specific `div` on the page\n    rootElement: '#demo'\n  };\n\n  // Start the app at the special demo URL\n  App.visit('/demo', options);\n});
\n
\n
\n \n

Or perhaps you might want to boot two instances of your app on the same\npage for a split-screen multiplayer experience:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import MyApp from 'my-app';\n\n$(function() {\n  let App = MyApp.create({ autoboot: false });\n\n  let sessionId = MyApp.generateSessionID();\n\n  let player1 = App.visit(`/matches/join?name=Player+1&session=${sessionId}`, { rootElement: '#left', location: 'none' });\n  let player2 = App.visit(`/matches/join?name=Player+2&session=${sessionId}`, { rootElement: '#right', location: 'none' });\n\n  Promise.all([player1, player2]).then(() => {\n    // Both apps have completed the initial render\n    $('#loading').fadeOut();\n  });\n});
\n
\n
\n \n

Do note that each app instance maintains their own registry/container, so\nthey will run in complete isolation by default.

\n

Server-Side Rendering (also known as FastBoot)

\n

This setup allows you to run your Ember app in a server environment using\nNode.js and render its content into static HTML for SEO purposes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
const HTMLSerializer = new SimpleDOM.HTMLSerializer(SimpleDOM.voidMap);\n\nfunction renderURL(url) {\n  let dom = new SimpleDOM.Document();\n  let rootElement = dom.body;\n  let options = { isBrowser: false, document: dom, rootElement: rootElement };\n\n  return MyApp.visit(options).then(instance => {\n    try {\n      return HTMLSerializer.serialize(rootElement.firstChild);\n    } finally {\n      instance.destroy();\n    }\n  });\n}
\n
\n
\n \n

In this scenario, because Ember does not have access to a global document\nobject in the Node.js environment, you must provide one explicitly. In practice,\nin the non-browser environment, the stand-in document object only needs to\nimplement a limited subset of the full DOM API. The SimpleDOM library is known\nto work.

\n

Since there is no DOM access in the non-browser environment, you must also\nspecify a DOM Element object in the same document for the rootElement option\n(as opposed to a selector string like "body").

\n

See the documentation on the isBrowser, document and rootElement properties\non ApplicationInstance.BootOptions for details.

\n

Server-Side Resource Discovery

\n

This setup allows you to run the routing layer of your Ember app in a server\nenvironment using Node.js and completely disable rendering. This allows you\nto simulate and discover the resources (i.e. AJAX requests) needed to fulfill\na given request and eagerly "push" these resources to the client.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
service.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import BrowserNetworkService from 'app/services/network/browser';\nimport NodeNetworkService from 'app/services/network/node';\n\n// Inject a (hypothetical) service for abstracting all AJAX calls and use\n// the appropriate implementation on the client/server. This also allows the\n// server to log all the AJAX calls made during a particular request and use\n// that for resource-discovery purpose.\n\nexport function initialize(application) {\n  if (window) { // browser\n    application.register('service:network', BrowserNetworkService);\n  } else { // node\n    application.register('service:network', NodeNetworkService);\n  }\n};\n\nexport default {\n  name: 'network-service',\n  initialize: initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Route from '@ember/routing/route';\nimport { service } from '@ember/service';\n\n// An example of how the (hypothetical) service is used in routes.\n\nexport default class IndexRoute extends Route {\n  @service network;\n\n  model(params) {\n    return this.network.fetch(`/api/posts/${params.post_id}.json`);\n  }\n\n  afterModel(post) {\n    if (post.isExternalContent) {\n      return this.network.fetch(`/api/external/?url=${post.externalURL}`);\n    } else {\n      return post;\n    }\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
// Finally, put all the pieces together\n\nfunction discoverResourcesFor(url) {\n  return MyApp.visit(url, { isBrowser: false, shouldRender: false }).then(instance => {\n    let networkService = instance.lookup('service:network');\n    return networkService.requests; // => { "/api/posts/123.json": "..." }\n  });\n}
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "visit", + "params": [ + { + "name": "url", + "description": "The initial URL to navigate to", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "ApplicationInstance.BootOptions" + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 62, + "description": "

The goal of initializers should be to register dependencies and injections.\nThis phase runs once. Because these initializers may load code, they are\nallowed to defer application readiness and advance it. If you need to access\nthe container or store you should use an InstanceInitializer that will be run\nafter all initializers and therefore after all code is loaded and the app is\nready.

\n

Initializer receives an object which has the following attributes:\nname, before, after, initialize. The only required attribute is\ninitialize, all others are optional.

\n
    \n
  • name allows you to specify under which name the initializer is registered.\nThis must be a unique name, as trying to register two initializers with the\nsame name will result in an error.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
initializer.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Running namedInitializer!');\n}\n\nexport default {\n  name: 'named-initializer',\n  initialize\n};
\n
\n
\n \n
    \n
  • before and after are used to ensure that this initializer is ran prior\nor after the one identified by the value. This value can be a single string\nor an array of strings, referencing the name of other initializers.
  • \n
\n

An example of ordering initializers, we create an initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/first.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('First initializer!');\n}\n\nexport default {\n  name: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
// DEBUG: First initializer!
\n
\n
\n \n

We add another initializer named second, specifying that it should run\nafter the initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/second.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Second initializer!');\n}\n\nexport default {\n  name: 'second',\n  after: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
// DEBUG: First initializer!\n// DEBUG: Second initializer!
\n
\n
\n

Afterwards we add a further initializer named pre, this time specifying\nthat it should run before the initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/pre.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Pre initializer!');\n}\n\nexport default {\n  name: 'pre',\n  before: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
// DEBUG: Pre initializer!\n// DEBUG: First initializer!\n// DEBUG: Second initializer!
\n
\n
\n \n

Finally we add an initializer named post, specifying it should run after\nboth the first and the second initializers:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Post initializer!');\n}\n\nexport default {\n  name: 'post',\n  after: ['first', 'second'],\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
// DEBUG: Pre initializer!\n// DEBUG: First initializer!\n// DEBUG: Second initializer!\n// DEBUG: Post initializer!
\n
\n
\n \n
    \n
  • initialize is a callback function that receives one argument,\napplication, on which you can operate.
  • \n
\n

Example of using application to register an adapter:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
adapter.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import ApiAdapter from '../utils/api-adapter';\n\nexport function initialize(application) {\n  application.register('api-adapter:main', ApiAdapter);\n}\n\nexport default {\n  name: 'post',\n  after: ['first', 'second'],\n  initialize\n};
\n
\n
\n \n", + "itemtype": "method", + "name": "initializer", + "params": [ + { + "name": "initializer", + "description": "", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 209, + "description": "

Instance initializers run after all initializers have run. Because\ninstance initializers run after the app is fully set up. We have access\nto the store, container, and other items. However, these initializers run\nafter code has loaded and are not allowed to defer readiness.

\n

Instance initializer receives an object which has the following attributes:\nname, before, after, initialize. The only required attribute is\ninitialize, all others are optional.

\n
    \n
  • name allows you to specify under which name the instanceInitializer is\nregistered. This must be a unique name, as trying to register two\ninstanceInitializer with the same name will result in an error.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
initializer.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Running named-instance-initializer!');\n}\n\nexport default {\n  name: 'named-instance-initializer',\n  initialize\n};
\n
\n
\n \n
    \n
  • before and after are used to ensure that this initializer is ran prior\nor after the one identified by the value. This value can be a single string\nor an array of strings, referencing the name of other initializers.

    \n
  • \n
  • See Application.initializer for discussion on the usage of before\nand after.

    \n
  • \n
\n

Example instanceInitializer to preload data into the store.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
data.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n
export function initialize(application) {\n    var userConfig, userConfigEncoded, store;\n    // We have a HTML escaped JSON representation of the user's basic\n    // configuration generated server side and stored in the DOM of the main\n    // index.html file. This allows the app to have access to a set of data\n    // without making any additional remote calls. Good for basic data that is\n    // needed for immediate rendering of the page. Keep in mind, this data,\n    // like all local models and data can be manipulated by the user, so it\n    // should not be relied upon for security or authorization.\n\n    // Grab the encoded data from the meta tag\n    userConfigEncoded = document.querySelector('head meta[name=app-user-config]').attr('content');\n\n    // Unescape the text, then parse the resulting JSON into a real object\n    userConfig = JSON.parse(unescape(userConfigEncoded));\n\n    // Lookup the store\n    store = application.lookup('service:store');\n\n    // Push the encoded JSON into the store\n    store.pushPayload(userConfig);\n}\n\nexport default {\n  name: 'named-instance-initializer',\n  initialize\n};
\n
\n
\n \n", + "itemtype": "method", + "name": "instanceInitializer", + "params": [ + { + "name": "instanceInitializer", + "description": "" + } + ], + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 285, + "description": "

This creates a registry with the default Ember naming conventions.

\n

It also configures the registry:

\n
    \n
  • registered views are created every time they are looked up (they are\nnot singletons)
  • \n
  • registered templates are not factories; the registered value is\nreturned directly.
  • \n
  • the router receives the application as its namespace property
  • \n
  • all controllers receive the router as their target and controllers\nproperties
  • \n
  • all controllers receive the application as their namespace property
  • \n
  • the application view receives the application controller as its\ncontroller property
  • \n
  • the application view receives the application template as its\ndefaultTemplate property
  • \n
\n", + "itemtype": "method", + "name": "buildRegistry", + "static": 1, + "params": [ + { + "name": "namespace", + "description": "the application for which to\n build the registry", + "type": "Application" + } + ], + "return": { + "description": "the built registry", + "type": "Ember.Registry" + }, + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 346, + "description": "

Ensure that initializers are run once, and only once, per engine.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "ensureInitializers", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 359, + "description": "

Create an EngineInstance for this engine.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "buildInstance", + "return": { + "description": "the engine instance", + "type": "EngineInstance" + }, + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 371, + "description": "

Build and configure the registry for the current engine.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "buildRegistry", + "return": { + "description": "the configured registry", + "type": "Ember.Registry" + }, + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 384, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "initializer", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 392, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "instanceInitializer", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 400, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "runInitializers", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 414, + "access": "private", + "tagname": "", + "since": "1.12.0", + "itemtype": "method", + "name": "runInstanceInitializers", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 448, + "description": "

This function defines the default lookup rules for container lookups:

\n
    \n
  • templates are looked up on Ember.TEMPLATES
  • \n
  • other names are looked up on the application after classifying the name.\nFor example, controller:post looks up App.PostController by default.
  • \n
  • if the default lookup fails, look for registered classes on the container
  • \n
\n

This allows the application to register default injections in the container\nthat could be overridden by the normal naming convention.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "resolverFor", + "params": [ + { + "name": "namespace", + "description": "the namespace to look for classes", + "type": "Ember.Enginer" + } + ], + "return": { + "description": "the resolved value for a given lookup", + "type": "*" + }, + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 107, + "description": "

Registers a factory that can be used for dependency injection (with\ninject) or for service lookup. Each factory is registered with\na full name including two parts: type:name.

\n

A simple example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Orange = EmberObject.extend();\nApp.register('fruit:favorite', App.Orange);
\n
\n
\n \n

Ember will resolve factories from the App namespace automatically.\nFor example App.CarsController will be discovered and returned if\nan application requests controller:cars.

\n

An example of registering a controller with a non-standard name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Application from '@ember/application';\nimport Controller from '@ember/controller';\n\nlet App = Application.create();\nlet Session = Controller.extend();\n\nApp.register('controller:session', Session);\n\n// The Session controller can now be treated like a normal controller,\n// despite its non-standard name.\nApp.ApplicationController = Controller.extend({\n  needs: ['session']\n});
\n
\n
\n \n

Registered factories are instantiated by having create\ncalled on them. Additionally they are singletons, each time\nthey are looked up they return the same instance.

\n

Some examples modifying that default behavior:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Person = EmberObject.extend();\nApp.Orange = EmberObject.extend();\nApp.Email = EmberObject.extend();\nApp.session = EmberObject.create();\n\nApp.register('model:user', App.Person, { singleton: false });\nApp.register('fruit:favorite', App.Orange);\nApp.register('communication:main', App.Email, { singleton: false });\nApp.register('session', App.session, { instantiate: false });
\n
\n
\n \n", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "type:name (e.g., 'model:user')", + "type": "String" + }, + { + "name": "factory", + "description": "(e.g., App.Person)", + "type": "Factory|object" + }, + { + "name": "options", + "description": "(optional) disable instantiation or singleton usage", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/owner", + "inherited": true, + "inheritedFrom": "BasicRegistry" + } + ], + "events": [ + { + "file": "packages/@ember/application/index.ts", + "line": 951, + "description": "

Called when the Application has become ready, immediately before routing\nbegins. The call will be delayed until the DOM has become ready.

\n", + "itemtype": "event", + "name": "ready", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + } + ], + "properties": [ + { + "file": "packages/@ember/application/index.ts", + "line": 241, + "description": "

The root DOM element of the Application. This can be specified as an\nelement or a selector string.

\n

This is the element that will be passed to the Application's,\neventDispatcher, which sets up the listeners for event delegation. Every\nview in your application should be a child of the element you specify here.

\n", + "itemtype": "property", + "name": "rootElement", + "type": "DOMElement", + "default": "'body'", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 256, + "itemtype": "property", + "name": "_document", + "type": "Document | null", + "default": "'window.document'", + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 265, + "description": "

The Ember.EventDispatcher responsible for delegating events to this\napplication's views.

\n

The event dispatcher is created by the application at initialization time\nand sets up event listeners on the DOM element described by the\napplication's rootElement property.

\n

See the documentation for Ember.EventDispatcher for more information.

\n", + "itemtype": "property", + "name": "eventDispatcher", + "type": "Ember.EventDispatcher", + "default": "null", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 282, + "description": "

The DOM events for which the event dispatcher should listen.

\n

By default, the application's Ember.EventDispatcher listens\nfor a set of standard DOM events, such as mousedown and\nkeyup, and delegates them to your application's Ember.View\ninstances.

\n

If you would like additional bubbling events to be delegated to your\nviews, set your Application's customEvents property\nto a hash containing the DOM event name as the key and the\ncorresponding view method name as the value. Setting an event to\na value of null will prevent a default event listener from being\nadded for that event.

\n

To add new events to be listened to:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Application from '@ember/application';\n\nlet App = Application.extend({\n  customEvents: {\n    // add support for the paste event\n    paste: 'paste'\n  }\n});
\n
\n
\n \n

To prevent default events from being listened to:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/app.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Application from '@ember/application';\n\nlet App = Application.extend({\n  customEvents: {\n    // remove support for mouseenter / mouseleave events\n    mouseenter: null,\n    mouseleave: null\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "customEvents", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 330, + "description": "

Whether the application should automatically start routing and render\ntemplates to the rootElement on DOM ready. While default by true,\nother environments such as FastBoot or a testing harness can set this\nproperty to false and control the precise timing and behavior of the boot\nprocess.

\n", + "itemtype": "property", + "name": "autoboot", + "type": "Boolean", + "default": "true", + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 344, + "description": "

Whether the application should be configured for the legacy "globals mode".\nUnder this mode, the Application object serves as a global namespace for all\nclasses.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import Application from '@ember/application';\nimport Component from '@ember/component';\n\nlet App = Application.create({\n  ...\n});\n\nApp.Router.reopen({\n  location: 'none'\n});\n\nApp.Router.map({\n  ...\n});\n\nApp.MyComponent = Component.extend({\n  ...\n});
\n
\n
\n \n

This flag also exposes other internal APIs that assumes the existence of\na special "default instance", like App.__container__.lookup(...).

\n

This option is currently not configurable, its value is derived from\nthe autoboot flag – disabling autoboot also implies opting-out of\nglobals mode support, although they are ultimately orthogonal concerns.

\n

Some of the global modes features are already deprecated in 1.x. The\nexistence of this flag is to untangle the globals mode code paths from\nthe autoboot code paths, so that these legacy features can be reviewed\nfor deprecation/removal separately.

\n

Forcing the (autoboot=true, _globalsMode=false) here and running the tests\nwould reveal all the places where we are still relying on these legacy\nbehavior internally (mostly just tests).

\n", + "itemtype": "property", + "name": "_globalsMode", + "type": "Boolean", + "default": "true", + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/index.ts", + "line": 393, + "description": "

An array of application instances created by buildInstance(). Used\ninternally to ensure that all instances get destroyed.

\n", + "itemtype": "property", + "name": "_applicationInstances", + "type": "Array", + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 325, + "description": "

Set this to provide an alternate class to DefaultResolver

\n", + "itemtype": "property", + "name": "resolver", + "access": "public", + "tagname": "", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 338, + "description": "

A private flag indicating whether an engine's initializers have run yet.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_initializersRan", + "class": "Application", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "Engine" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-5.3.0-Engine", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/application", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-ApplicationInstance.BootOptions.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-ApplicationInstance.BootOptions.json new file mode 100644 index 000000000..d0d111d7a --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-ApplicationInstance.BootOptions.json @@ -0,0 +1,143 @@ +{ + "data": { + "id": "ember-5.3.0-ApplicationInstance.BootOptions", + "type": "class", + "attributes": { + "name": "ApplicationInstance.BootOptions", + "shortname": "ApplicationInstance.BootOptions", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/application", + "namespace": "ApplicationInstance", + "file": "packages/@ember/application/instance.ts", + "line": 316, + "description": "

A list of boot-time configuration options for customizing the behavior of\nan ApplicationInstance.

\n

This is an interface class that exists purely to document the available\noptions; you do not need to construct it manually. Simply pass a regular\nJavaScript object containing the desired options into methods that require\none of these options object:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
MyApp.visit("/", { location: "none", rootElement: "#container" });
\n
\n
\n \n

Not all combinations of the supported options are valid. See the documentation\non Application#visit for the supported configurations.

\n

Internal, experimental or otherwise unstable flags are marked as private.

\n", + "access": "public", + "tagname": "", + "methods": [], + "events": [], + "properties": [ + { + "file": "packages/@ember/application/instance.ts", + "line": 339, + "description": "

Interactive mode: whether we need to set up event delegation and invoke\nlifecycle callbacks on Components.

\n", + "itemtype": "property", + "name": "isInteractive", + "type": "boolean", + "default": "auto-detected", + "access": "private", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.ts", + "line": 350, + "itemtype": "property", + "name": "_renderMode", + "type": "string", + "default": "undefined", + "access": "private", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.ts", + "line": 358, + "description": "

Run in a full browser environment.

\n

When this flag is set to false, it will disable most browser-specific\nand interactive features. Specifically:

\n
    \n
  • It does not use jQuery to append the root view; the rootElement\n(either specified as a subsequent option or on the application itself)\nmust already be an Element in the given document (as opposed to a\nstring selector).

    \n
  • \n
  • It does not set up an EventDispatcher.

    \n
  • \n
  • It does not run any Component lifecycle hooks (such as didInsertElement).

    \n
  • \n
  • It sets the location option to "none". (If you would like to use\nthe location adapter specified in the app's router instead, you can also\nspecify { location: null } to specifically opt-out.)

    \n
  • \n
\n", + "itemtype": "property", + "name": "isBrowser", + "type": "boolean", + "default": "auto-detected", + "access": "public", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.ts", + "line": 384, + "description": "

If present, overrides the router's location property with this\nvalue. This is useful for environments where trying to modify the\nURL would be inappropriate.

\n", + "itemtype": "property", + "name": "location", + "type": "string", + "default": "null", + "access": "public", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.ts", + "line": 396, + "description": "

Disable rendering completely.

\n

When this flag is set to false, it will disable the entire rendering\npipeline. Essentially, this puts the app into "routing-only" mode. No\ntemplates will be rendered, and no Components will be created.

\n", + "itemtype": "property", + "name": "shouldRender", + "type": "boolean", + "default": "true", + "access": "public", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.ts", + "line": 410, + "description": "

If present, render into the given Document object instead of the\nglobal window.document object.

\n

In practice, this is only useful in non-browser environment or in\nnon-interactive mode, because Ember's jQuery dependency is\nimplicitly bound to the current document, causing event delegation\nto not work properly when the app is rendered into a foreign\ndocument object (such as an iframe's contentDocument).

\n

In non-browser mode, this could be a "Document-like" object as\nEmber only interact with a small subset of the DOM API in non-\ninteractive mode. While the exact requirements have not yet been\nformalized, the SimpleDOM library's implementation is known to\nwork.

\n", + "itemtype": "property", + "name": "document", + "type": "Document", + "default": "the global `document` object", + "access": "public", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + }, + { + "file": "packages/@ember/application/instance.ts", + "line": 433, + "description": "

If present, overrides the application's rootElement property on\nthe instance. This is useful for testing environment, where you\nmight want to append the root view to a fixture area.

\n

In non-browser mode, because Ember does not have access to jQuery,\nthis options must be specified as a DOM Element object instead of\na selector string.

\n

See the documentation on Application's rootElement for\ndetails.

\n", + "itemtype": "property", + "name": "rootElement", + "type": "String|Element", + "default": "null", + "access": "public", + "tagname": "", + "class": "ApplicationInstance.BootOptions", + "module": "@ember/application", + "namespace": "ApplicationInstance" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/application", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-ApplicationInstance.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-ApplicationInstance.json new file mode 100644 index 000000000..9c4127937 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-ApplicationInstance.json @@ -0,0 +1,803 @@ +{ + "data": { + "id": "ember-5.3.0-ApplicationInstance", + "type": "class", + "attributes": { + "name": "ApplicationInstance", + "shortname": "ApplicationInstance", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/application", + "namespace": "", + "file": "packages/@ember/application/instance.ts", + "line": 19, + "description": "

The ApplicationInstance encapsulates all of the stateful aspects of a\nrunning Application.

\n

At a high-level, we break application boot into two distinct phases:

\n
    \n
  • Definition time, where all of the classes, templates, and other\ndependencies are loaded (typically in the browser).
  • \n
  • Run time, where we begin executing the application once everything\nhas loaded.
  • \n
\n

Definition time can be expensive and only needs to happen once since it is\nan idempotent operation. For example, between test runs and FastBoot\nrequests, the application stays the same. It is only the state that we want\nto reset.

\n

That state is what the ApplicationInstance manages: it is responsible for\ncreating the container that contains all application state, and disposing of\nit once the particular test run or FastBoot request has finished.

\n", + "access": "public", + "tagname": "", + "extends": "EngineInstance", + "methods": [ + { + "file": "packages/@ember/application/instance.ts", + "line": 296, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupRegistry", + "params": [ + { + "name": "registry", + "description": "", + "type": "Registry" + }, + { + "name": "options", + "description": "", + "type": "BootOptions" + } + ], + "class": "ApplicationInstance", + "module": "@ember/application" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 56, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupRegistry", + "params": [ + { + "name": "registry", + "description": "", + "type": "Registry" + }, + { + "name": "options", + "description": "", + "type": "BootOptions" + } + ], + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 107, + "description": "

Initialize the EngineInstance and return a promise that resolves\nwith the instance itself when the boot process is complete.

\n

The primary task here is to run any registered instance initializers.

\n

See the documentation on BootOptions for the options it takes.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "boot", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 173, + "description": "

Unregister a factory.

\n

Overrides RegistryProxy#unregister in order to clear any cached instances\nof the unregistered factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 190, + "description": "

Build a new EngineInstance that's a child of this instance.

\n

Engines must be registered by name with their parent engine\n(or application).

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "buildChildEngineInstance", + "params": [ + { + "name": "name", + "description": "the registered name of the engine.", + "type": "String" + }, + { + "name": "options", + "description": "options provided to the engine instance.", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EngineInstance,Error" + }, + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 220, + "description": "

Clone dependencies shared between an engine instance and its parent.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "cloneParentDependencies", + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 322, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 541, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 568, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 576, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 164, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 212, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 229, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 247, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 333, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 354, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 371, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 388, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 403, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 433, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 453, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 497, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 198, + "description": "

Given a fullName return a corresponding instance.

\n

The default behavior is for lookup to return a singleton instance.\nThe singleton is scoped to the container, allowing multiple containers\nto all have their own locally scoped singletons.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter');\n\ntwitter instanceof Twitter; // => true\n\n// by default the container will return singletons\nlet twitter2 = container.lookup('api:twitter');\ntwitter2 instanceof Twitter; // => true\n\ntwitter === twitter2; //=> true
\n
\n
\n \n

If singletons are not wanted an optional flag can be provided at lookup.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter', { singleton: false });\nlet twitter2 = container.lookup('api:twitter', { singleton: false });\n\ntwitter === twitter2; //=> false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "lookup", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "RegisterOptions" + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "ApplicationInstance", + "module": "@ember/owner", + "inherited": true, + "inheritedFrom": "BasicContainer" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 247, + "description": "

Given a FullName, of the form "type:name" return a FactoryManager.

\n

This method returns a manager which can be used for introspection of the\nfactory's class or for the creation of factory instances with initial\nproperties. The manager is an object with the following properties:

\n
    \n
  • class - The registered or resolved class.
  • \n
  • create - A function that will create an instance of the class with\nany dependencies injected.
  • \n
\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(otherInstance);\n// the owner is commonly the `applicationInstance`, and can be accessed via\n// an instance initializer.\n\nlet factory = owner.factoryFor('service:bespoke');\n\nfactory.class;\n// The registered or resolved class. For example when used with an Ember-CLI\n// app, this would be the default export from `app/services/bespoke.js`.\n\nlet instance = factory.create({\n  someProperty: 'an initial property value'\n});\n// Create an instance with any injections and the passed options as\n// initial properties.
\n
\n
\n \n

Any instances created via the factory's .create() method must be destroyed\nmanually by the caller of .create(). Typically, this is done during the creating\nobjects own destroy or willDestroy methods.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "factoryFor", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "FactoryManager" + }, + "class": "ApplicationInstance", + "module": "@ember/owner", + "inherited": true, + "inheritedFrom": "BasicContainer" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 107, + "description": "

Registers a factory that can be used for dependency injection (with\ninject) or for service lookup. Each factory is registered with\na full name including two parts: type:name.

\n

A simple example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Orange = EmberObject.extend();\nApp.register('fruit:favorite', App.Orange);
\n
\n
\n \n

Ember will resolve factories from the App namespace automatically.\nFor example App.CarsController will be discovered and returned if\nan application requests controller:cars.

\n

An example of registering a controller with a non-standard name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Application from '@ember/application';\nimport Controller from '@ember/controller';\n\nlet App = Application.create();\nlet Session = Controller.extend();\n\nApp.register('controller:session', Session);\n\n// The Session controller can now be treated like a normal controller,\n// despite its non-standard name.\nApp.ApplicationController = Controller.extend({\n  needs: ['session']\n});
\n
\n
\n \n

Registered factories are instantiated by having create\ncalled on them. Additionally they are singletons, each time\nthey are looked up they return the same instance.

\n

Some examples modifying that default behavior:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Person = EmberObject.extend();\nApp.Orange = EmberObject.extend();\nApp.Email = EmberObject.extend();\nApp.session = EmberObject.create();\n\nApp.register('model:user', App.Person, { singleton: false });\nApp.register('fruit:favorite', App.Orange);\nApp.register('communication:main', App.Email, { singleton: false });\nApp.register('session', App.session, { instantiate: false });
\n
\n
\n \n", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "type:name (e.g., 'model:user')", + "type": "String" + }, + { + "name": "factory", + "description": "(e.g., App.Person)", + "type": "Factory|object" + }, + { + "name": "options", + "description": "(optional) disable instantiation or singleton usage", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/owner", + "inherited": true, + "inheritedFrom": "BasicRegistry" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/application/instance.ts", + "line": 45, + "description": "

The Application for which this is an instance.

\n", + "itemtype": "property", + "name": "application", + "type": "Application", + "access": "private", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/instance.ts", + "line": 53, + "description": "

The root DOM element of the Application as an element or a\nCSS selector.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "rootElement", + "type": "String|DOMElement", + "class": "ApplicationInstance", + "module": "@ember/application" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 68, + "description": "

The base Engine for which this is an instance.

\n", + "itemtype": "property", + "name": "engine", + "type": "Engine", + "access": "private", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/engine", + "inherited": true, + "inheritedFrom": "EngineInstance" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 25, + "description": "

The container stores state.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "__container__", + "type": "Ember.Container", + "class": "ApplicationInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 356, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 430, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 505, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 523, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "ApplicationInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-5.3.0-EngineInstance", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/application", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-ArrayProxy.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-ArrayProxy.json new file mode 100644 index 000000000..e73495e44 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-ArrayProxy.json @@ -0,0 +1,1834 @@ +{ + "data": { + "id": "ember-5.3.0-ArrayProxy", + "type": "class", + "attributes": { + "name": "ArrayProxy", + "shortname": "ArrayProxy", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/array/proxy", + "namespace": "", + "file": "packages/@ember/array/proxy.ts", + "line": 59, + "description": "

An ArrayProxy wraps any other object that implements Array and/or\nMutableArray, forwarding all requests. This makes it very useful for\na number of binding use cases or other cases where being able to swap\nout the underlying array is useful.

\n

A simple example of usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { A } from '@ember/array';\nimport ArrayProxy from '@ember/array/proxy';\n\nlet pets = ['dog', 'cat', 'fish'];\nlet ap = ArrayProxy.create({ content: A(pets) });\n\nap.get('firstObject');                        // 'dog'\nap.set('content', ['amoeba', 'paramecium']);\nap.get('firstObject');                        // 'amoeba'
\n
\n
\n \n

This class can also be useful as a layer to transform the contents of\nan array, as they are accessed. This can be done by overriding\nobjectAtContent:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import { A } from '@ember/array';\nimport ArrayProxy from '@ember/array/proxy';\n\nlet pets = ['dog', 'cat', 'fish'];\nlet ap = ArrayProxy.create({\n    content: A(pets),\n    objectAtContent: function(idx) {\n        return this.get('content').objectAt(idx).toUpperCase();\n    }\n});\n\nap.get('firstObject'); // . 'DOG'
\n
\n
\n \n

When overriding this class, it is important to place the call to\n_super after setting content so the internal observers have\na chance to fire properly:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { A } from '@ember/array';\nimport ArrayProxy from '@ember/array/proxy';\n\nexport default ArrayProxy.extend({\n  init() {\n    this.set('content', A(['dog', 'cat', 'fish']));\n    this._super(...arguments);\n  }\n});
\n
\n
\n \n", + "extends": "EmberObject", + "uses": [ + "MutableArray" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/array/proxy.ts", + "line": 138, + "description": "

Should actually retrieve the object at the specified index from the\ncontent. You can override this method in subclasses to transform the\ncontent item to something new.

\n

This method will only be called if content is non-null.

\n", + "itemtype": "method", + "name": "objectAtContent", + "params": [ + { + "name": "idx", + "description": "The index to retrieve.", + "type": "Number" + } + ], + "return": { + "description": "the value or undefined if none found", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array/proxy" + }, + { + "file": "packages/@ember/array/proxy.ts", + "line": 151, + "description": "

Should actually replace the specified objects on the content array.\nYou can override this method in subclasses to transform the content item\ninto something new.

\n

This method will only be called if content is non-null.

\n", + "itemtype": "method", + "name": "replaceContent", + "params": [ + { + "name": "idx", + "description": "The starting index", + "type": "Number" + }, + { + "name": "amt", + "description": "The number of items to remove from the content.", + "type": "Number" + }, + { + "name": "objects", + "description": "Optional array of objects to insert.", + "type": "Array" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array/proxy" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1484, + "description": "

Required. You must implement this method to apply this mixin.

\n

This is one of the primitives you must implement to support Array.\nYou should replace amt objects started at idx with the objects in the\npassed array.

\n

Note that this method is expected to validate the type(s) of objects that it expects.

\n", + "itemtype": "method", + "name": "replace", + "params": [ + { + "name": "idx", + "description": "Starting index in the array to replace. If\n idx >= length, then append to the end of the array.", + "type": "Number" + }, + { + "name": "amt", + "description": "Number of elements that should be removed from\n the array, starting at *idx*.", + "type": "Number" + }, + { + "name": "objects", + "description": "An optional array of zero or more objects that should be\n inserted into the array at *idx*", + "type": "EmberArray", + "optional": true + } + ], + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1503, + "description": "

Remove all elements from the array. This is useful if you\nwant to reuse an existing array without having to recreate it.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue'];\n\ncolors.length;  // 3\ncolors.clear(); // []\ncolors.length;  // 0
\n
\n
\n \n", + "itemtype": "method", + "name": "clear", + "return": { + "description": "An empty Array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1520, + "description": "

This will use the primitive replace() method to insert an object at the\nspecified index.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.insertAt(2, 'yellow');  // ['red', 'green', 'yellow', 'blue']\ncolors.insertAt(5, 'orange');  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "insertAt", + "params": [ + { + "name": "idx", + "description": "index of insert the object at.", + "type": "Number" + }, + { + "name": "object", + "description": "object to insert", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1538, + "description": "

Remove an object at the specified index using the replace() primitive\nmethod. You can pass either a single index, or a start and a length.

\n

If you pass a start and length that is beyond the\nlength this method will throw an assertion.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue', 'yellow', 'orange'];\n\ncolors.removeAt(0);     // ['green', 'blue', 'yellow', 'orange']\ncolors.removeAt(2, 2);  // ['green', 'blue']\ncolors.removeAt(4, 2);  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "removeAt", + "params": [ + { + "name": "start", + "description": "index, start of range", + "type": "Number" + }, + { + "name": "len", + "description": "length of passing range", + "type": "Number" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1560, + "description": "

Push the object onto the end of the array. Works just like push() but it\nis KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green'];\n\ncolors.pushObject('black');     // ['red', 'green', 'black']\ncolors.pushObject(['yellow']);  // ['red', 'green', ['yellow']]
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObject", + "params": [ + { + "name": "obj", + "description": "object to push", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1577, + "description": "

Add the objects in the passed array to the end of the array. Defers\nnotifying observers of the change until all objects are added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
let colors = ['red'];\n\ncolors.pushObjects(['yellow', 'orange']);  // ['red', 'yellow', 'orange']
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "Array" + } + ], + "return": { + "description": "receiver", + "type": "MutableArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1593, + "description": "

Pop object from array or nil if none are left. Works just like pop() but\nit is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.popObject();   // 'blue'\nconsole.log(colors);  // ['red', 'green']
\n
\n
\n \n", + "itemtype": "method", + "name": "popObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1609, + "description": "

Shift an object from start of array or nil if none are left. Works just\nlike shift() but it is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.shiftObject();  // 'red'\nconsole.log(colors);   // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "shiftObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1625, + "description": "

Unshift an object to start of array. Works just like unshift() but it is\nKVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObject('yellow');    // ['yellow', 'red']\ncolors.unshiftObject(['black']);   // [['black'], 'yellow', 'red']
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObject", + "params": [ + { + "name": "obj", + "description": "object to unshift", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1642, + "description": "

Adds the named objects to the beginning of the array. Defers notifying\nobservers until all objects have been added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObjects(['black', 'white']);   // ['black', 'white', 'red']\ncolors.unshiftObjects('yellow'); // Type Error: 'undefined' is not a function
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "Enumerable" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1659, + "description": "

Reverse objects in the array. Works just like reverse() but it is\nKVO-compliant.

\n", + "itemtype": "method", + "name": "reverseObjects", + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1668, + "description": "

Replace all the receiver's content with content of the argument.\nIf argument is an empty array receiver will be cleared.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.setObjects(['black', 'white']);  // ['black', 'white']\ncolors.setObjects([]);                  // []
\n
\n
\n \n", + "itemtype": "method", + "name": "setObjects", + "params": [ + { + "name": "objects", + "description": "array whose content will be used for replacing\n the content of the receiver", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver with the new content", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1686, + "description": "

Remove all occurrences of an object in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let cities = ['Chicago', 'Berlin', 'Lima', 'Chicago'];\n\ncities.removeObject('Chicago');  // ['Berlin', 'Lima']\ncities.removeObject('Lima');     // ['Berlin']\ncities.removeObject('Tokyo')     // ['Berlin']
\n
\n
\n \n", + "itemtype": "method", + "name": "removeObject", + "params": [ + { + "name": "obj", + "description": "object to remove", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1703, + "description": "

Removes each object in the passed array from the receiver.

\n", + "itemtype": "method", + "name": "removeObjects", + "params": [ + { + "name": "objects", + "description": "the objects to remove", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1712, + "description": "

Push the object onto the end of the array if it is not already\npresent in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let cities = ['Chicago', 'Berlin'];\n\ncities.addObject('Lima');    // ['Chicago', 'Berlin', 'Lima']\ncities.addObject('Berlin');  // ['Chicago', 'Berlin', 'Lima']
\n
\n
\n \n", + "itemtype": "method", + "name": "addObject", + "params": [ + { + "name": "obj", + "description": "object to add, if not already present", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1729, + "description": "

Adds each object in the passed array to the receiver.

\n", + "itemtype": "method", + "name": "addObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add.", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 322, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 541, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 568, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 576, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 164, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 212, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 229, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 247, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 333, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 354, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 371, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 388, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 403, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 433, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 453, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 497, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 263, + "description": "

Returns the object at the given index. If the given index is negative\nor is greater or equal than the array length, returns undefined.

\n

This is one of the primitives you must implement to support EmberArray.\nIf your object supports retrieving the value of an array item using get()\n(i.e. myArray.get(0)), then you do not need to implement this method\nyourself.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectAt(0);   // 'a'\narr.objectAt(3);   // 'd'\narr.objectAt(-1);  // undefined\narr.objectAt(4);   // undefined\narr.objectAt(5);   // undefined
\n
\n
\n \n", + "itemtype": "method", + "name": "objectAt", + "params": [ + { + "name": "idx", + "description": "The index of the item to return.", + "type": "Number" + } + ], + "return": { + "description": "item at index or undefined", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 288, + "description": "

This returns the objects at the specified indexes, using objectAt.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectsAt([0, 1, 2]);  // ['a', 'b', 'c']\narr.objectsAt([2, 3, 4]);  // ['c', 'd', undefined]
\n
\n
\n \n", + "itemtype": "method", + "name": "objectsAt", + "params": [ + { + "name": "indexes", + "description": "An array of indexes of items to return.", + "type": "Array" + } + ], + "return": { + "description": "", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 354, + "description": "

Returns a new array that is a slice of the receiver. This implementation\nuses the observable array methods to retrieve the objects for the new\nslice.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = ['red', 'green', 'blue'];\n\narr.slice(0);       // ['red', 'green', 'blue']\narr.slice(0, 2);    // ['red', 'green']\narr.slice(1, 100);  // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "slice", + "params": [ + { + "name": "beginIndex", + "description": "(Optional) index to begin slicing from.", + "type": "Number" + }, + { + "name": "endIndex", + "description": "(Optional) index to end the slice at (but not included).", + "type": "Number" + } + ], + "return": { + "description": "New array with specified slice", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 374, + "description": "

Used to determine the passed object's first occurrence in the array.\nReturns the index if found, -1 if no match is found.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.indexOf('a');       //  0\narr.indexOf('z');       // -1\narr.indexOf('a', 2);    //  4\narr.indexOf('a', -1);   //  4, equivalent to indexOf('a', 4)\narr.indexOf('a', -100); //  0, searches entire array\narr.indexOf('b', 3);    // -1\narr.indexOf('a', 100);  // -1\n\nlet people = [{ name: 'Zoey' }, { name: 'Bob' }]\nlet newPerson = { name: 'Tom' };\npeople = [newPerson, ...people, newPerson];\n\npeople.indexOf(newPerson);     //  0\npeople.indexOf(newPerson, 1);  //  3\npeople.indexOf(newPerson, -4); //  0\npeople.indexOf(newPerson, 10); // -1
\n
\n
\n \n", + "itemtype": "method", + "name": "indexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "index or -1 if not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 412, + "description": "

Returns the index of the given object's last occurrence.

\n
    \n
  • If no startAt argument is given, the search starts from\nthe last position.
  • \n
  • If it's greater than or equal to the length of the array,\nthe search starts from the last position.
  • \n
  • If it's negative, it is taken as the offset from the end\nof the array i.e. startAt + array.length.
  • \n
  • If it's any other positive number, will search backwards\nfrom that index of the array.
  • \n
\n

Returns -1 if no match is found.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.lastIndexOf('a');       //  4\narr.lastIndexOf('z');       // -1\narr.lastIndexOf('a', 2);    //  0\narr.lastIndexOf('a', -1);   //  4\narr.lastIndexOf('a', -3);   //  0\narr.lastIndexOf('b', 3);    //  1\narr.lastIndexOf('a', 100);  //  4
\n
\n
\n \n", + "itemtype": "method", + "name": "lastIndexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search from\nbackwards, defaults to `(array.length - 1)`", + "type": "Number" + } + ], + "return": { + "description": "The last index of the `object` in the array or -1\nif not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 447, + "description": "

Iterates through the array, calling the passed function on each\nitem. This method corresponds to the forEach() method defined in\nJavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
let foods = [\n  { name: 'apple', eaten: false },\n  { name: 'banana', eaten: false },\n  { name: 'carrot', eaten: false }\n];\n\nfoods.forEach((food) => food.eaten = true);\n\nlet output = '';\nfoods.forEach((item, index, array) =>\n  output += `${index + 1}/${array.length} ${item.name}\\n`;\n);\nconsole.log(output);\n// 1/3 apple\n// 2/3 banana\n// 3/3 carrot
\n
\n
\n \n", + "itemtype": "method", + "name": "forEach", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 498, + "description": "

Alias for mapBy.

\n

Returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.getEach('name');\n// ['Joe', 'Matt'];\n\npeople.getEach('nonexistentProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "getEach", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 520, + "description": "

Sets the value on the named property for each member. This is more\nergonomic than using other methods defined on this helper. If the object\nimplements Observable, the value will be changed to set(), otherwise\nit will be set directly. null objects are skipped.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.setEach('zipCode', '10011');\n// [{name: 'Joe', zipCode: '10011'}, {name: 'Matt', zipCode: '10011'}];
\n
\n
\n \n", + "itemtype": "method", + "name": "setEach", + "params": [ + { + "name": "key", + "description": "The key to set", + "type": "String" + }, + { + "name": "value", + "description": "The object to set", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 540, + "description": "

Maps all of the items in the enumeration to another value, returning\na new array. This method corresponds to map() defined in JavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
function(item, index, array);\nlet arr = [1, 2, 3, 4, 5, 6];\n\narr.map(element => element * element);\n// [1, 4, 9, 16, 25, 36];\n\narr.map((element, index) => element + index);\n// [1, 3, 5, 7, 9, 11];
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the mapped value.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n", + "itemtype": "method", + "name": "map", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 578, + "description": "

Similar to map, this specialized function returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.mapBy('name');\n// ['Joe', 'Matt'];\n\npeople.mapBy('unknownProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "mapBy", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 599, + "description": "

Returns a new array with all of the items in the enumeration that the provided\ncallback function returns true for. This method corresponds to Array.prototype.filter().

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All parameters are optional. The function should return true to include the item\nin the results, and false otherwise.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nlet people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n\npeople.filter(isAdult); // returns [{ name: 'Joan', age: 45 }];
\n
\n
\n \n

Note that in addition to a callback, you can pass an optional target object\nthat will be set as this on the context. This is a good way to give your\niterator function access to the current object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
function isAdultAndEngineer(person) {\n  return person.age > 18 && this.engineering;\n}\n\nclass AdultsCollection {\n  engineering = false;\n\n  constructor(opts = {}) {\n    super(...arguments);\n\n    this.engineering = opts.engineering;\n    this.people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n  }\n}\n\nlet collection = new AdultsCollection({ engineering: true });\ncollection.people.filter(isAdultAndEngineer, { target: collection });
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A filtered array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 662, + "description": "

Returns an array with all of the items in the enumeration where the passed\nfunction returns false. This method is the inverse of filter().

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration
  • \n
  • array is the array itself.
  • \n
\n

It should return a falsey value to include the item in the results.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as "this" on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\nconst nonFruits = food.reject(function(thing) {\n  return thing.isFruit;\n}); // [{food: 'bread', isFruit: false}]
\n
\n
\n \n", + "itemtype": "method", + "name": "reject", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A rejected array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 706, + "description": "

Filters the array by the property and an optional value. If a value is given, it returns\nthe items that have said value for the property. If not, it returns all the items that\nhave a truthy value for the property.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let things = Ember.A([{ food: 'apple', isFruit: true }, { food: 'beans', isFruit: false }]);\n\nthings.filterBy('food', 'beans'); // [{ food: 'beans', isFruit: false }]\nthings.filterBy('isFruit'); // [{ food: 'apple', isFruit: true }]
\n
\n
\n \n", + "itemtype": "method", + "name": "filterBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "filtered array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 727, + "description": "

Returns an array with the items that do not have truthy values for the provided key.\nYou can pass an optional second argument with a target value to reject for the key.\nOtherwise this will reject objects where the provided property evaluates to false.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
  let food = [\n    { name: "apple", isFruit: true },\n    { name: "carrot", isFruit: false },\n    { name: "bread", isFruit: false },\n  ];\n  food.rejectBy('isFruit'); // [{ name: "carrot", isFruit: false }, { name: "bread", isFruit: false }]\n  food.rejectBy('name', 'carrot'); // [{ name: "apple", isFruit: true }}, { name: "bread", isFruit: false }]
\n
\n
\n \n", + "itemtype": "method", + "name": "rejectBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "rejected array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 751, + "description": "

Returns the first item in the array for which the callback returns true.\nThis method is similar to the find() method defined in ECMAScript 2015.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the true to include the item in the results, false\notherwise.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let users = [\n  { id: 1, name: 'Yehuda' },\n  { id: 2, name: 'Tom' },\n  { id: 3, name: 'Melanie' },\n  { id: 4, name: 'Leah' }\n];\n\nusers.find((user) => user.name == 'Tom'); // [{ id: 2, name: 'Tom' }]\nusers.find(({ id }) => id == 3); // [{ id: 3, name: 'Melanie' }]
\n
\n
\n \n", + "itemtype": "method", + "name": "find", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Found item or `undefined`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 801, + "description": "

Returns the first item with a property matching the passed value. You\ncan pass an optional second argument with the target value. Otherwise\nthis will match any property that evaluates to true.

\n

This method works much like the more generic find() method.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
let users = [\n  { id: 1, name: 'Yehuda', isTom: false },\n  { id: 2, name: 'Tom', isTom: true },\n  { id: 3, name: 'Melanie', isTom: false },\n  { id: 4, name: 'Leah', isTom: false }\n];\n\nusers.findBy('id', 4); // { id: 4, name: 'Leah', isTom: false }\nusers.findBy('name', 'Melanie'); // { id: 3, name: 'Melanie', isTom: false }\nusers.findBy('isTom'); // { id: 2, name: 'Tom', isTom: true }
\n
\n
\n \n", + "itemtype": "method", + "name": "findBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "found item or `undefined`", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 831, + "description": "

Returns true if the passed function returns true for every item in the\nenumeration. This corresponds with the Array.prototype.every() method defined in ES5.

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All params are optional. The method should return true or false.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nconst people = Ember.A([{ name: 'John', age: 24 }, { name: 'Joan', age: 45 }]);\nconst areAllAdults = people.every(isAdult);
\n
\n
\n \n", + "itemtype": "method", + "name": "every", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 872, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for all items in the array. This method is often simpler/faster\nthan using a callback.

\n

Note that like the native Array.every, isEvery will return true when called\non any empty array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
class Language {\n  constructor(name, isProgrammingLanguage) {\n    this.name = name;\n    this.programmingLanguage = isProgrammingLanguage;\n  }\n}\n\nconst compiledLanguages = [\n  new Language('Java', true),\n  new Language('Go', true),\n  new Language('Rust', true)\n]\n\nconst languagesKnownByMe = [\n  new Language('Javascript', true),\n  new Language('English', false),\n  new Language('Ruby', true)\n]\n\ncompiledLanguages.isEvery('programmingLanguage'); // true\nlanguagesKnownByMe.isEvery('programmingLanguage'); // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isEvery", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 912, + "description": "

The any() method executes the callback function once for each element\npresent in the array until it finds the one where callback returns a truthy\nvalue (i.e. true). If such an element is found, any() immediately returns\ntrue. Otherwise, any() returns false.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array object itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. It can be a good way\nto give your iterator function access to an object in cases where an ES6\narrow function would not be appropriate.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let includesManager = people.any(this.findPersonInManagersList, this);\n\nlet includesStockHolder = people.any(person => {\n  return this.findPersonInStockHoldersList(person)\n});\n\nif (includesManager || includesStockHolder) {\n  Paychecks.addBiggerBonus();\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "any", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "`true` if the passed function returns `true` for any item", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 955, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for any item in the array. This method is often simpler/faster\nthan using a callback.

\n

Example usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\n\nfood.isAny('isFruit'); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isAny", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 981, + "description": "

This will combine the values of the array into a single value. It\nis a useful way to collect a summary value from an array. This\ncorresponds to the reduce() method defined in JavaScript 1.8.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(previousValue, item, index, array);
\n
\n
\n \n
    \n
  • previousValue is the value returned by the last call to the iterator.
  • \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Return the new cumulative value.

\n

In addition to the callback you can also pass an initialValue. An error\nwill be raised if you do not pass an initial value and the enumerator is\nempty.

\n

Note that unlike the other methods, this method does not allow you to\npass a target object to set as this for the callback. It's part of the\nspec. Sorry.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
  let numbers = [1, 2, 3, 4, 5];\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }); // 15 (1 + 2 + 3 + 4 + 5)\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }, -15); // 0 (-15 + 1 + 2 + 3 + 4 + 5)\n\n\n  let binaryValues = [true, false, false];\n\n  binaryValues.reduce(function(truthValue, current) {\n    return truthValue && current;\n  }); // false (true && false && false)
\n
\n
\n \n", + "itemtype": "method", + "name": "reduce", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "initialValue", + "description": "Initial value for the reduce", + "type": "Object" + } + ], + "return": { + "description": "The reduced value.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1039, + "description": "

Invokes the named method on every object in the receiver that\nimplements it. This method corresponds to the implementation in\nPrototype 1.6.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
class Person {\n  name = null;\n\n  constructor(name) {\n    this.name = name;\n  }\n\n  greet(prefix='Hello') {\n    return `${prefix} ${this.name}`;\n  }\n}\n\nlet people = [new Person('Joe'), new Person('Matt')];\n\npeople.invoke('greet'); // ['Hello Joe', 'Hello Matt']\npeople.invoke('greet', 'Bonjour'); // ['Bonjour Joe', 'Bonjour Matt']
\n
\n
\n \n", + "itemtype": "method", + "name": "invoke", + "params": [ + { + "name": "methodName", + "description": "the name of the method", + "type": "String" + }, + { + "name": "args", + "description": "optional arguments to pass as well.", + "type": "Object..." + } + ], + "return": { + "description": "return values from calling invoke.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1073, + "description": "

Simply converts the object into a genuine array. The order is not\nguaranteed. Corresponds to the method implemented by Prototype.

\n", + "itemtype": "method", + "name": "toArray", + "return": { + "description": "the object as an array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1082, + "description": "

Returns a copy of the array with all null and undefined elements removed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', null, 'c', undefined];\narr.compact();  // ['a', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "compact", + "return": { + "description": "the array without null and undefined elements.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1095, + "description": "

Used to determine if the array contains the passed object.\nReturns true if found, false otherwise.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n

This method has the same behavior of JavaScript's Array.includes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
[1, 2, 3].includes(2);     // true\n[1, 2, 3].includes(4);     // false\n[1, 2, 3].includes(3, 2);  // true\n[1, 2, 3].includes(3, 3);  // false\n[1, 2, 3].includes(3, -1); // true\n[1, 2, 3].includes(1, -1); // false\n[1, 2, 3].includes(1, -4); // true\n[1, 2, NaN].includes(NaN); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "includes", + "params": [ + { + "name": "object", + "description": "The object to search for.", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "`true` if object is found in the array.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1125, + "description": "

Sorts the array by the keys specified in the argument.

\n

You may provide multiple arguments to sort by multiple properties.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
   let colors = [\n { name: 'red', weight: 500 },\n { name: 'green', weight: 600 },\n { name: 'blue', weight: 500 }\n];\n\n   colors.sortBy('name');\n   // [{name: 'blue', weight: 500}, {name: 'green', weight: 600}, {name: 'red', weight: 500}]\n\n   colors.sortBy('weight', 'name');\n   // [{name: 'blue', weight: 500}, {name: 'red', weight: 500}, {name: 'green', weight: 600}]
\n
\n
\n \n", + "itemtype": "method", + "name": "sortBy", + "params": [ + { + "name": "property", + "description": "name(s) to sort on", + "type": "String" + } + ], + "return": { + "description": "The sorted array.", + "type": "Array" + }, + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1150, + "description": "

Returns a new array that contains only unique values. The default\nimplementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'a', 'b', 'b'];\narr.uniq();  // ['a', 'b']
\n
\n
\n \n

This only works on primitive data types, e.g. Strings, Numbers, etc.

\n", + "itemtype": "method", + "name": "uniq", + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1166, + "description": "

Returns a new array that contains only items containing a unique property value.\nThe default implementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }];\narr.uniqBy('value');  // [{ value: 'a' }, { value: 'b' }]\n\nlet arr = [2.2, 2.1, 3.2, 3.3];\narr.uniqBy(Math.floor);  // [2.2, 3.2];
\n
\n
\n \n", + "itemtype": "method", + "name": "uniqBy", + "params": [ + { + "name": "key", + "description": "", + "type": "String,Function" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1185, + "description": "

Returns a new array that excludes the passed value. The default\nimplementation returns an array regardless of the receiver type.\nIf the receiver does not contain the value it returns the original array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'b', 'a', 'c'];\narr.without('a');  // ['b', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "without", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/array/proxy.ts", + "line": 120, + "description": "

The content array. Must be an object that implements Array and/or\nMutableArray.

\n", + "itemtype": "property", + "name": "content", + "type": "EmberArray", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array/proxy" + }, + { + "file": "packages/@ember/array/proxy.ts", + "line": 129, + "description": "

The array that the proxy pretends to be. In the default ArrayProxy\nimplementation, this and content are the same. Subclasses of ArrayProxy\ncan override this property to provide things like sorting and filtering.

\n", + "itemtype": "property", + "name": "arrangedContent", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array/proxy" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 356, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 430, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 505, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 523, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 253, + "description": "

Required. You must implement this method to apply this mixin.

\n

Your array must support the length property. Your replace methods should\nset this property whenever it changes.

\n", + "itemtype": "property", + "name": "length", + "type": "Number", + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 304, + "description": "

This is the handler for the special array content property. If you get\nthis property, it will return this. If you set this property to a new\narray, it will replace the current content.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let peopleToMoon = ['Armstrong', 'Aldrin'];\n\npeopleToMoon.get('[]'); // ['Armstrong', 'Aldrin']\n\npeopleToMoon.set('[]', ['Collins']); // ['Collins']\npeopleToMoon.get('[]'); // ['Collins']
\n
\n
\n \n", + "itemtype": "property", + "name": "[]", + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 324, + "description": "

The first object in the array, or undefined if the array is empty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let vowels = ['a', 'e', 'i', 'o', 'u'];\nvowels.firstObject; // 'a'\n\nvowels.shiftObject();\nvowels.firstObject; // 'e'\n\nvowels.reverseObjects();\nvowels.firstObject; // 'u'\n\nvowels.clear();\nvowels.firstObject; // undefined
\n
\n
\n \n", + "itemtype": "property", + "name": "firstObject", + "return": { + "description": "The first object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 346, + "description": "

The last object in the array, or undefined if the array is empty.

\n", + "itemtype": "property", + "name": "lastObject", + "return": { + "description": "The last object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "ArrayProxy", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-5.3.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/array/proxy", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-BasicContainer.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-BasicContainer.json new file mode 100644 index 000000000..fc859feef --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-BasicContainer.json @@ -0,0 +1,102 @@ +{ + "data": { + "id": "ember-5.3.0-BasicContainer", + "type": "class", + "attributes": { + "name": "BasicContainer", + "shortname": "BasicContainer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Owner" + ], + "module": "@ember/owner", + "namespace": "", + "file": "packages/@ember/-internals/owner/index.ts", + "line": 189, + "description": "

The common interface for the ability to lookup() or get the factoryFor an\nitem, shared by the Owner and ContainerProxy interfaces.

\n", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 198, + "description": "

Given a fullName return a corresponding instance.

\n

The default behavior is for lookup to return a singleton instance.\nThe singleton is scoped to the container, allowing multiple containers\nto all have their own locally scoped singletons.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter');\n\ntwitter instanceof Twitter; // => true\n\n// by default the container will return singletons\nlet twitter2 = container.lookup('api:twitter');\ntwitter2 instanceof Twitter; // => true\n\ntwitter === twitter2; //=> true
\n
\n
\n \n

If singletons are not wanted an optional flag can be provided at lookup.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter', { singleton: false });\nlet twitter2 = container.lookup('api:twitter', { singleton: false });\n\ntwitter === twitter2; //=> false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "lookup", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "RegisterOptions" + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "BasicContainer", + "module": "@ember/owner" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 247, + "description": "

Given a FullName, of the form "type:name" return a FactoryManager.

\n

This method returns a manager which can be used for introspection of the\nfactory's class or for the creation of factory instances with initial\nproperties. The manager is an object with the following properties:

\n
    \n
  • class - The registered or resolved class.
  • \n
  • create - A function that will create an instance of the class with\nany dependencies injected.
  • \n
\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(otherInstance);\n// the owner is commonly the `applicationInstance`, and can be accessed via\n// an instance initializer.\n\nlet factory = owner.factoryFor('service:bespoke');\n\nfactory.class;\n// The registered or resolved class. For example when used with an Ember-CLI\n// app, this would be the default export from `app/services/bespoke.js`.\n\nlet instance = factory.create({\n  someProperty: 'an initial property value'\n});\n// Create an instance with any injections and the passed options as\n// initial properties.
\n
\n
\n \n

Any instances created via the factory's .create() method must be destroyed\nmanually by the caller of .create(). Typically, this is done during the creating\nobjects own destroy or willDestroy methods.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "factoryFor", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "FactoryManager" + }, + "class": "BasicContainer", + "module": "@ember/owner" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-5.3.0-ContainerProxy" + } + ] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/owner", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-BasicRegistry.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-BasicRegistry.json new file mode 100644 index 000000000..f200837cd --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-BasicRegistry.json @@ -0,0 +1,81 @@ +{ + "data": { + "id": "ember-5.3.0-BasicRegistry", + "type": "class", + "attributes": { + "name": "BasicRegistry", + "shortname": "BasicRegistry", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Owner" + ], + "module": "@ember/owner", + "namespace": "", + "file": "packages/@ember/-internals/owner/index.ts", + "line": 98, + "description": "

The common interface for the ability to register() an item, shared by the\nOwner and RegistryProxy interfaces.

\n", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 107, + "description": "

Registers a factory that can be used for dependency injection (with\ninject) or for service lookup. Each factory is registered with\na full name including two parts: type:name.

\n

A simple example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Orange = EmberObject.extend();\nApp.register('fruit:favorite', App.Orange);
\n
\n
\n \n

Ember will resolve factories from the App namespace automatically.\nFor example App.CarsController will be discovered and returned if\nan application requests controller:cars.

\n

An example of registering a controller with a non-standard name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Application from '@ember/application';\nimport Controller from '@ember/controller';\n\nlet App = Application.create();\nlet Session = Controller.extend();\n\nApp.register('controller:session', Session);\n\n// The Session controller can now be treated like a normal controller,\n// despite its non-standard name.\nApp.ApplicationController = Controller.extend({\n  needs: ['session']\n});
\n
\n
\n \n

Registered factories are instantiated by having create\ncalled on them. Additionally they are singletons, each time\nthey are looked up they return the same instance.

\n

Some examples modifying that default behavior:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Person = EmberObject.extend();\nApp.Orange = EmberObject.extend();\nApp.Email = EmberObject.extend();\nApp.session = EmberObject.create();\n\nApp.register('model:user', App.Person, { singleton: false });\nApp.register('fruit:favorite', App.Orange);\nApp.register('communication:main', App.Email, { singleton: false });\nApp.register('session', App.session, { instantiate: false });
\n
\n
\n \n", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "type:name (e.g., 'model:user')", + "type": "String" + }, + { + "name": "factory", + "description": "(e.g., App.Person)", + "type": "Factory|object" + }, + { + "name": "options", + "description": "(optional) disable instantiation or singleton usage", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "BasicRegistry", + "module": "@ember/owner" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-5.3.0-RegistryProxy" + } + ] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/owner", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-BucketCache.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-BucketCache.json new file mode 100644 index 000000000..842ad6903 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-BucketCache.json @@ -0,0 +1,45 @@ +{ + "data": { + "id": "ember-5.3.0-BucketCache", + "type": "class", + "attributes": { + "name": "BucketCache", + "shortname": "BucketCache", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/renderer", + "namespace": "", + "file": "packages/@ember/routing/lib/cache.ts", + "line": 1, + "description": "

A two-tiered cache with support for fallback values when doing lookups.\nUses "buckets" and then "keys" to cache values.

\n", + "access": "private", + "tagname": "", + "methods": [], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/renderer", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-Component.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-Component.json new file mode 100644 index 000000000..055a90513 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-Component.json @@ -0,0 +1,1587 @@ +{ + "data": { + "id": "ember-5.3.0-Component", + "type": "class", + "attributes": { + "name": "Component", + "shortname": "Component", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/component", + "namespace": "", + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 187, + "description": "

A component is a reusable UI element that consists of a .hbs template and an\noptional JavaScript class that defines its behavior. For example, someone\nmight make a button in the template and handle the click behavior in the\nJavaScript file that shares the same name as the template.

\n

Components are broken down into two categories:

\n
    \n
  • Components without JavaScript, that are based only on a template. These\nare called Template-only or TO components.
  • \n
  • Components with JavaScript, which consist of a template and a backing\nclass.
  • \n
\n

Ember ships with two types of JavaScript classes for components:

\n
    \n
  1. Glimmer components, imported from @glimmer/component, which are the\ndefault component's for Ember Octane (3.15) and more recent editions.
  2. \n
  3. Classic components, imported from @ember/component, which were the\ndefault for older editions of Ember (pre 3.15).
  4. \n
\n

Below is the documentation for Classic components. If you are looking for the\nAPI documentation for Template-only or Glimmer components, it is\navailable here.

\n

Defining a Classic Component

\n

If you want to customize the component in order to handle events, transform\narguments or maintain internal state, you implement a subclass of Component.

\n

One example is to add computed properties to your component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  displayName: computed('person.title', 'person.firstName', 'person.lastName', function() {\n    let { title, firstName, lastName } = this.person;\n\n    if (title) {\n      return `${title} ${lastName}`;\n    } else {\n      return `${firstName} ${lastName}`;\n    }\n  })\n});
\n
\n
\n \n

And then use it in the component's template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{this.displayName}}</h1>\n{{yield}}
\n
\n
\n \n

Customizing a Classic Component's HTML Element in JavaScript

\n

HTML Tag

\n

The default HTML tag name used for a component's HTML representation is div.\nThis can be customized by setting the tagName property.

\n

Consider the following component class:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
paragraph.js
1\n2\n3\n4\n5\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'em'\n});
\n
\n
\n \n

When invoked, this component would produce output that looks something like\nthis:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<em id="ember1" class="ember-view"></em>
\n
\n
\n \n

HTML class Attribute

\n

The HTML class attribute of a component's tag can be set by providing a\nclassNames property that is set to an array of strings:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  classNames: ['my-class', 'my-other-class']\n});
\n
\n
\n \n

Invoking this component will produce output that looks like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view my-class my-other-class"></div>
\n
\n
\n \n

class attribute values can also be set by providing a classNameBindings\nproperty set to an array of properties names for the component. The return\nvalue of these properties will be added as part of the value for the\ncomponents's class attribute. These properties can be computed properties:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\nimport { computed } from '@ember/object';\n\nexport default Component.extend({\n  classNames: ['my-class', 'my-other-class'],\n  classNameBindings: ['propertyA', 'propertyB'],\n\n  propertyA: 'from-a',\n  propertyB: computed(function() {\n    if (someLogic) { return 'from-b'; }\n  })\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view my-class my-other-class from-a from-b"></div>
\n
\n
\n \n

Note that classNames and classNameBindings is in addition to the class\nattribute passed with the angle bracket invocation syntax. Therefore, if this\ncomponent was invoked like so:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyWidget class="from-invocation" />
\n
\n
\n \n

The resulting HTML will look similar to this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="from-invocation ember-view my-class my-other-class from-a from-b"></div>
\n
\n
\n \n

If the value of a class name binding returns a boolean the property name\nitself will be used as the class name if the property is true. The class name\nwill not be added if the value is false or undefined.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  classNameBindings: ['hovered'],\n\n  hovered: true\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view hovered"></div>
\n
\n
\n \n

Custom Class Names for Boolean Values

\n

When using boolean class name bindings you can supply a string value other\nthan the property name for use as the class HTML attribute by appending the\npreferred value after a ":" character when defining the binding:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  classNameBindings: ['awesome:so-very-cool'],\n\n  awesome: true\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view so-very-cool"></div>
\n
\n
\n \n

Boolean value class name bindings whose property names are in a\ncamelCase-style format will be converted to a dasherized format:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  classNameBindings: ['isUrgent'],\n\n  isUrgent: true\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view is-urgent"></div>
\n
\n
\n \n

Class name bindings can also refer to object values that are found by\ntraversing a path relative to the component itself:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Component from '@ember/component';\nimport EmberObject from '@ember/object';\n\nexport default Component.extend({\n  classNameBindings: ['messages.empty'],\n\n  messages: EmberObject.create({\n    empty: true\n  })\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view empty"></div>
\n
\n
\n \n

If you want to add a class name for a property which evaluates to true and\nand a different class name if it evaluates to false, you can pass a binding\nlike this:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  classNameBindings: ['isEnabled:enabled:disabled'],\n  isEnabled: true\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view enabled"></div>
\n
\n
\n \n

When isEnabled is false, the resulting HTML representation looks like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view disabled"></div>
\n
\n
\n \n

This syntax offers the convenience to add a class if a property is false:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\n// Applies no class when isEnabled is true and class 'disabled' when isEnabled is false\nexport default Component.extend({\n  classNameBindings: ['isEnabled::disabled'],\n  isEnabled: true\n});
\n
\n
\n \n

Invoking this component when the isEnabled property is true will produce\nHTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view"></div>
\n
\n
\n \n

Invoking it when the isEnabled property on the component is false will\nproduce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div id="ember1" class="ember-view disabled"></div>
\n
\n
\n \n

Updates to the value of a class name binding will result in automatic update\nof the HTML class attribute in the component's rendered HTML\nrepresentation. If the value becomes false or undefined the class name\nwill be removed.

\n

Both classNames and classNameBindings are concatenated properties. See\nEmberObject documentation for more\ninformation about concatenated properties.

\n

Other HTML Attributes

\n

The HTML attribute section of a component's tag can be set by providing an\nattributeBindings property set to an array of property names on the component.\nThe return value of these properties will be used as the value of the component's\nHTML associated attribute:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
anchor.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'a',\n  attributeBindings: ['href'],\n\n  href: 'http://google.com'\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<a id="ember1" class="ember-view" href="http://google.com"></a>
\n
\n
\n \n

One property can be mapped on to another by placing a ":" between\nthe source property and the destination property:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
anchor.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'a',\n  attributeBindings: ['url:href'],\n\n  url: 'http://google.com'\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<a id="ember1" class="ember-view" href="http://google.com"></a>
\n
\n
\n \n

HTML attributes passed with angle bracket invocations will take precedence\nover those specified in attributeBindings. Therefore, if this component was\ninvoked like so:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyAnchor href="http://bing.com" @url="http://google.com" />
\n
\n
\n \n

The resulting HTML will looks like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<a id="ember1" class="ember-view" href="http://bing.com"></a>
\n
\n
\n \n

Note that the href attribute is ultimately set to http://bing.com,\ndespite it having attribute binidng to the url property, which was\nset to http://google.com.

\n

Namespaced attributes (e.g. xlink:href) are supported, but have to be\nmapped, since : is not a valid character for properties in Javascript:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
use.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'use',\n  attributeBindings: ['xlinkHref:xlink:href'],\n\n  xlinkHref: '#triangle'\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<use xlink:href="#triangle"></use>
\n
\n
\n \n

If the value of a property monitored by attributeBindings is a boolean, the\nattribute will be present or absent depending on the value:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
input.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'input',\n  attributeBindings: ['disabled'],\n\n  disabled: false\n});
\n
\n
\n \n

Invoking this component will produce HTML that looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<input id="ember1" class="ember-view" />
\n
\n
\n \n

attributeBindings can refer to computed properties:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
input.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Component from '@ember/component';\nimport { computed } from '@ember/object';\n\nexport default Component.extend({\n  tagName: 'input',\n  attributeBindings: ['disabled'],\n\n  disabled: computed(function() {\n    if (someLogic) {\n      return true;\n    } else {\n      return false;\n    }\n  })\n});
\n
\n
\n \n

To prevent setting an attribute altogether, use null or undefined as the\nvalue of the property used in attributeBindings:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
input.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  tagName: 'form',\n  attributeBindings: ['novalidate'],\n  novalidate: null\n});
\n
\n
\n \n

Updates to the property of an attribute binding will result in automatic\nupdate of the HTML attribute in the component's HTML output.

\n

attributeBindings is a concatenated property. See\nEmberObject documentation for more\ninformation about concatenated properties.

\n

Layouts

\n

The layout property can be used to dynamically specify a template associated\nwith a component class, instead of relying on Ember to link together a\ncomponent class and a template based on file names.

\n

In general, applications should not use this feature, but it's commonly used\nin addons for historical reasons.

\n

The layout property should be set to the default export of a template\nmodule, which is the name of a template file without the .hbs extension.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>Person's Title</h1>\n<div class='details'>{{yield}}</div>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.js
1\n2\n3\n4\n5\n6\n
  import Component from '@ember/component';\n  import layout from '../templates/components/person-profile';\n\n  export default Component.extend({\n    layout\n  });
\n
\n
\n \n

If you invoke the component:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<PersonProfile>\n  <h2>Chief Basket Weaver</h2>\n  <h3>Fisherman Industries</h3>\n</PersonProfile>
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
{{#person-profile}}\n  <h2>Chief Basket Weaver</h2>\n  <h3>Fisherman Industries</h3>\n{{/person-profile}}
\n
\n
\n \n

It will result in the following HTML output:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<h1>Person's Title</h1>\n  <div class="details">\n  <h2>Chief Basket Weaver</h2>\n  <h3>Fisherman Industries</h3>\n</div>
\n
\n
\n \n

Handling Browser Events

\n

Components can respond to user-initiated events in one of three ways: passing\nactions with angle bracket invocation, adding event handler methods to the\ncomponent's class, or adding actions to the component's template.

\n

Passing Actions With Angle Bracket Invocation

\n

For one-off events specific to particular instance of a component, it is possible\nto pass actions to the component's element using angle bracket invocation syntax.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<MyWidget {{action 'firstWidgetClicked'}} />\n\n<MyWidget {{action 'secondWidgetClicked'}} />
\n
\n
\n \n

In this case, when the first component is clicked on, Ember will invoke the\nfirstWidgetClicked action. When the second component is clicked on, Ember\nwill invoke the secondWidgetClicked action instead.

\n

Besides {{action}}, it is also possible to pass any arbitrary element modifiers\nusing the angle bracket invocation syntax.

\n

Event Handler Methods

\n

Components can also respond to user-initiated events by implementing a method\nthat matches the event name. This approach is appropriate when the same event\nshould be handled by all instances of the same component.

\n

An event object will be passed as the argument to the event handler method.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
widget.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  click(event) {\n    // `event.target` is either the component's element or one of its children\n    let tag = event.target.tagName.toLowerCase();\n    console.log('clicked on a `<${tag}>` HTML element!');\n  }\n});
\n
\n
\n \n

In this example, whenever the user clicked anywhere inside the component, it\nwill log a message to the console.

\n

It is possible to handle event types other than click by implementing the\nfollowing event handler methods. In addition, custom events can be registered\nby using Application.customEvents.

\n

Touch events:

\n
    \n
  • touchStart
  • \n
  • touchMove
  • \n
  • touchEnd
  • \n
  • touchCancel
  • \n
\n

Keyboard events:

\n
    \n
  • keyDown
  • \n
  • keyUp
  • \n
  • keyPress
  • \n
\n

Mouse events:

\n
    \n
  • mouseDown
  • \n
  • mouseUp
  • \n
  • contextMenu
  • \n
  • click
  • \n
  • doubleClick
  • \n
  • focusIn
  • \n
  • focusOut
  • \n
\n

Form events:

\n
    \n
  • submit
  • \n
  • change
  • \n
  • focusIn
  • \n
  • focusOut
  • \n
  • input
  • \n
\n

Drag and drop events:

\n
    \n
  • dragStart
  • \n
  • drag
  • \n
  • dragEnter
  • \n
  • dragLeave
  • \n
  • dragOver
  • \n
  • dragEnd
  • \n
  • drop
  • \n
\n

{{action}} Helper

\n

Instead of handling all events of a particular type anywhere inside the\ncomponent's element, you may instead want to limit it to a particular\nelement in the component's template. In this case, it would be more\nconvenient to implement an action instead.

\n

For example, you could implement the action hello for the person-profile\ncomponent:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  actions: {\n    hello(name) {\n      console.log("Hello", name);\n    }\n  }\n});
\n
\n
\n \n

And then use it in the component's template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n3\n4\n5\n
<h1>{{@person.name}}</h1>\n\n<button {{action 'hello' @person.name}}>\n  Say Hello to {{@person.name}}\n</button>
\n
\n
\n \n

When the user clicks the button, Ember will invoke the hello action,\npassing in the current value of @person.name as an argument.

\n

See Ember.Templates.helpers.action.

\n", + "extends": "Ember.CoreView", + "uses": [ + "Ember.ViewStateSupport", + "Ember.ViewMixin", + "Ember.ActionSupport", + "Ember.ClassNamesSupport", + "Ember.TargetActionSupport" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 42, + "description": "

Called when the attributes passed into the component have been updated.\n Called both during the initial render of a container and during a rerender.\n Can be used in place of an observer; code placed here will be executed\n every time any attribute updates.

\n", + "itemtype": "method", + "name": "didReceiveAttrs", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 63, + "description": "

Called after a component has been rendered, both on initial render and\n in subsequent rerenders.

\n", + "itemtype": "method", + "name": "didRender", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 80, + "description": "

Called before a component has been rendered, both on initial render and\n in subsequent rerenders.

\n", + "itemtype": "method", + "name": "willRender", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 97, + "description": "

Called when the attributes passed into the component have been changed.\n Called only during a rerender, not during an initial render.

\n", + "itemtype": "method", + "name": "didUpdateAttrs", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 114, + "description": "

Called when the component is about to update and rerender itself.\n Called only during a rerender, not during an initial render.

\n", + "itemtype": "method", + "name": "willUpdate", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 131, + "description": "

Called when the component has updated and rerendered itself.\n Called only during a rerender, not during an initial render.

\n", + "itemtype": "method", + "name": "didUpdate", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 962, + "description": "

Normally, Ember's component model is "write-only". The component takes a\nbunch of attributes that it got passed in, and uses them to render its\ntemplate.

\n

One nice thing about this model is that if you try to set a value to the\nsame thing as last time, Ember (through HTMLBars) will avoid doing any\nwork on the DOM.

\n

This is not just a performance optimization. If an attribute has not\nchanged, it is important not to clobber the element's "hidden state".\nFor example, if you set an input's value to the same value as before,\nit will clobber selection state and cursor position. In other words,\nsetting an attribute is not always idempotent.

\n

This method provides a way to read an element's attribute and also\nupdate the last value Ember knows about at the same time. This makes\nsetting an attribute idempotent.

\n

In particular, what this means is that if you get an <input> element's\nvalue attribute and then re-render the template with the same value,\nit will avoid clobbering the cursor and selection position.\nSince most attribute sets are idempotent in the browser, you typically\ncan get away with reading attributes using jQuery, but the most reliable\nway to do so is through this method.

\n", + "itemtype": "method", + "name": "readDOMAttr", + "params": [ + { + "name": "name", + "description": "the name of the attribute", + "type": "String" + } + ], + "return": { + "description": "String" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 35, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getRootViews", + "params": [ + { + "name": "owner", + "description": "", + "type": "Object" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 57, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewId", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 77, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewElement", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 109, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getChildViews", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 152, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewBounds", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 161, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewRange", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 176, + "description": "

getViewClientRects provides information about the position of the border\nbox edges of a view relative to the viewport.

\n

It is only intended to be used by development tools like the Ember Inspector\nand may not work on older browsers.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewClientRects", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 192, + "description": "

getViewBoundingClientRect provides information about the position of the\nbounding border box edges of a view relative to the viewport.

\n

It is only intended to be used by development tools like the Ember Inspector\nand may not work on older browsers.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewBoundingClientRect", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 208, + "description": "

Determines if the element matches the specified selector.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "matches", + "params": [ + { + "name": "el", + "description": "", + "type": "DOMElement" + }, + { + "name": "selector", + "description": "", + "type": "String" + } + ], + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/views/core_view.ts", + "line": 77, + "description": "

Override the default event firing from Evented to\nalso call methods with the given name.

\n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 93, + "description": "

Return the nearest ancestor that is an instance of the provided\nclass or mixin.

\n", + "itemtype": "method", + "name": "nearestOfType", + "params": [ + { + "name": "klass", + "description": "Subclass of Ember.View (or Ember.View itself),\nor an instance of Mixin.", + "type": "Class,Mixin" + } + ], + "return": { + "description": "Ember.View" + }, + "deprecated": true, + "deprecationMessage": "use `yield` and contextual components for composition instead.", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 121, + "description": "

Return the nearest ancestor that has a given property.

\n", + "itemtype": "method", + "name": "nearestWithProperty", + "params": [ + { + "name": "property", + "description": "A property name", + "type": "String" + } + ], + "return": { + "description": "Ember.View" + }, + "deprecated": true, + "deprecationMessage": "use `yield` and contextual components for composition instead.", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 141, + "description": "

Renders the view again. This will work regardless of whether the\nview is already in the DOM or not. If the view is in the DOM, the\nrendering process will be deferred to give bindings a chance\nto synchronize.

\n

If children were added during the rendering process using appendChild,\nrerender will remove them, because they will be added again\nif needed by the next render.

\n

In general, if the display of your view changes, you should modify\nthe DOM element directly instead of manually calling rerender, which can\nbe slow.

\n", + "itemtype": "method", + "name": "rerender", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 181, + "description": "

Appends the view's element to the specified parent element.

\n

Note that this method just schedules the view to be appended; the DOM\nelement will not be appended to the given element until all bindings have\nfinished synchronizing.

\n

This is not typically a function that you will need to call directly when\nbuilding your application. If you do need to use appendTo, be sure that\nthe target element you are providing is associated with an Application\nand does not have an ancestor element that is associated with an Ember view.

\n", + "itemtype": "method", + "name": "appendTo", + "params": [ + { + "name": "A", + "description": "selector, element, HTML string", + "type": "String|DOMElement" + } + ], + "return": { + "description": "receiver", + "type": "Ember.View" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 246, + "description": "

Appends the view's element to the document body. If the view does\nnot have an HTML representation yet\nthe element will be generated automatically.

\n

If your application uses the rootElement property, you must append\nthe view within that element. Rendering views outside of the rootElement\nis not supported.

\n

Note that this method just schedules the view to be appended; the DOM\nelement will not be appended to the document body until all bindings have\nfinished synchronizing.

\n", + "itemtype": "method", + "name": "append", + "return": { + "description": "receiver", + "type": "Ember.View" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 331, + "description": "

You must call destroy on a view to destroy the view (and all of its\nchild views). This will remove the view from any parent node, then make\nsure that the DOM element managed by the view can be released by the\nmemory manager.

\n", + "itemtype": "method", + "name": "destroy", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 405, + "description": "

Setup a view, but do not finish waking it up.

\n
    \n
  • configure childViews
  • \n
  • register the view with the global views hash, which is used for event\ndispatch
  • \n
\n", + "itemtype": "method", + "name": "init", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 439, + "description": "

Handle events from EventDispatcher

\n", + "itemtype": "method", + "name": "handleEvent", + "params": [ + { + "name": "eventName", + "description": "", + "type": "String" + }, + { + "name": "evt", + "description": "", + "type": "Event" + } + ], + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/target_action_support.ts", + "line": 52, + "description": "

Send an action with an actionContext to a target. The action, actionContext\nand target will be retrieved from properties of the object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { alias } from '@ember/object/computed';\n\nApp.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  target: alias('controller'),\n  action: 'save',\n  actionContext: alias('context'),\n  click() {\n    this.triggerAction(); // Sends the `save` action, along with the current context\n                          // to the current controller\n  }\n});
\n
\n
\n \n

The target, action, and actionContext can be provided as properties of\nan optional object argument to triggerAction as well.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  click() {\n    this.triggerAction({\n      action: 'save',\n      target: this.get('controller'),\n      actionContext: this.get('context')\n    }); // Sends the `save` action, along with the current context\n        // to the current controller\n  }\n});
\n
\n
\n \n

The actionContext defaults to the object you are mixing TargetActionSupport into.\nBut target and action must be specified either as properties or with the argument\nto triggerAction, or a combination:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { alias } from '@ember/object/computed';\n\nApp.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  target: alias('controller'),\n  click() {\n    this.triggerAction({\n      action: 'save'\n    }); // Sends the `save` action, along with a reference to `this`,\n        // to the current controller\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "triggerAction", + "params": [ + { + "name": "opts", + "description": "(optional, with the optional keys action, target and/or actionContext)", + "type": "Object" + } + ], + "return": { + "description": "true if the action was sent successfully and did not return false", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.TargetActionSupport" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 172, + "description": "

Triggers a named action on the ActionHandler. Any parameters\nsupplied after the actionName string will be passed as arguments\nto the action target function.

\n

If the ActionHandler has its target property set, actions may\nbubble to the target. Bubbling happens when an actionName can\nnot be found in the ActionHandler's actions hash or if the\naction target function returns true.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    playTheme() {\n      this.send('playMusic', 'theme.mp3');\n    },\n    playMusic(track) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "actionName", + "description": "The action to trigger", + "type": "String" + }, + { + "name": "context", + "description": "a context to send with the action", + "type": "*" + } + ], + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 51, + "description": "

Subscribes to a named event with given function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
person.on('didLoad', function() {\n  // fired once the person has loaded\n});
\n
\n
\n \n

An optional target can be passed in as the 2nd argument that will\nbe set as the "this" for the callback. This is a good way to give your\nfunction access to the object triggering the event. When the target\nparameter is used the callback method becomes the third argument.

\n", + "itemtype": "method", + "name": "on", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 78, + "description": "

Subscribes a function to a named event and then cancels the subscription\nafter the first time the event is triggered. It is good to use one when\nyou only care about the first time an event has taken place.

\n

This function takes an optional 2nd argument that will become the "this"\nvalue for the callback. When the target parameter is used the callback method\nbecomes the third argument.

\n", + "itemtype": "method", + "name": "one", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 100, + "description": "

Triggers a named event for the object. Any additional arguments\nwill be passed as parameters to the functions that are subscribed to the\nevent.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
person.on('didEat', function(food) {\n  console.log('person ate some ' + food);\n});\n\nperson.trigger('didEat', 'broccoli');\n\n// outputs: person ate some broccoli
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "args", + "description": "Optional arguments to pass on", + "type": "Object..." + } + ], + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 121, + "description": "

Cancels subscription for given name, target, and method.

\n", + "itemtype": "method", + "name": "off", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The target of the subscription", + "type": "Object" + }, + { + "name": "method", + "description": "The function or the name of a function of the subscription", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 137, + "description": "

Checks to see if object has any subscriptions for named event.

\n", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + } + ], + "return": { + "description": "does the object have a subscription for event", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/mixin.ts", + "line": 441, + "itemtype": "method", + "name": "mixin", + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "mixins", + "description": "", + "multiple": true + } + ], + "return": { + "description": "obj" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "@ember/object/mixin", + "inherited": true, + "inheritedFrom": "Mixin" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 322, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 541, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 568, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 576, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 164, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 212, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 229, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 247, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 333, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 354, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 371, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 388, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 403, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 433, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 453, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 497, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Component", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [ + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 53, + "description": "

Called when the attributes passed into the component have been updated.\n Called both during the initial render of a container and during a rerender.\n Can be used in place of an observer; code placed here will be executed\n every time any attribute updates.

\n", + "itemtype": "event", + "name": "didReceiveAttrs", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 72, + "description": "

Called after a component has been rendered, both on initial render and\n in subsequent rerenders.

\n", + "itemtype": "event", + "name": "didRender", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 89, + "description": "

Called before a component has been rendered, both on initial render and\n in subsequent rerenders.

\n", + "itemtype": "event", + "name": "willRender", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 106, + "description": "

Called when the attributes passed into the component have been changed.\n Called only during a rerender, not during an initial render.

\n", + "itemtype": "event", + "name": "didUpdateAttrs", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 123, + "description": "

Called when the component is about to update and rerender itself.\n Called only during a rerender, not during an initial render.

\n", + "itemtype": "event", + "name": "willUpdate", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 140, + "description": "

Called when the component has updated and rerendered itself.\n Called only during a rerender, not during an initial render.

\n", + "itemtype": "event", + "name": "didUpdate", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 300, + "description": "

Called when a view is going to insert an element into the DOM.

\n", + "itemtype": "event", + "name": "willInsertElement", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 308, + "description": "

Called when the element of the view has been inserted into the DOM.\nOverride this function to do any set up that requires an element\nin the document body.

\n

When a view has children, didInsertElement will be called on the\nchild view(s) first and on itself afterwards.

\n", + "itemtype": "event", + "name": "didInsertElement", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 321, + "description": "

Called when the view is about to rerender, but before anything has\nbeen torn down. This is a good opportunity to tear down any manual\nobservers you have installed based on the DOM state

\n", + "itemtype": "event", + "name": "willClearRender", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 345, + "description": "

Called when the element of the view is going to be destroyed. Override\nthis function to do any teardown that requires an element, like removing\nevent listeners.

\n

Please note: any property changes made during this event will have no\neffect on object observers.

\n", + "itemtype": "event", + "name": "willDestroyElement", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 358, + "description": "

Called after the element of the view is destroyed.

\n", + "itemtype": "event", + "name": "willDestroyElement", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 366, + "description": "

Called when the parentView property has changed.

\n", + "itemtype": "event", + "name": "parentViewDidChange", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + } + ], + "properties": [ + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 148, + "description": "

The HTML id of the component's element in the DOM. You can provide this\nvalue yourself but it must be unique (just as in HTML):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component elementId="a-really-cool-id"}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyComponent @elementId="a-really-cool-id" />
\n
\n
\n \n

If not manually set a default value will be provided by the framework.\nOnce rendered an element's elementId is considered immutable and you\nshould never change it. If you need to compute a dynamic value for the\nelementId, you should do this when the component or element is being\ninstantiated:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
export default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    var index = this.get('index');\n    this.set('elementId', `component-id${index}`);\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "elementId", + "type": "String", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 1022, + "description": "

Enables components to take a list of parameters as arguments.\n For example, a component that takes two parameters with the names\n name and age:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
 import Component from '@ember/component';\n\n let MyComponent = Component.extend();\n\n MyComponent.reopenClass({\n   positionalParams: ['name', 'age']\n });\n\n export default MyComponent;
\n
\n
\n \n

It can then be invoked like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
 {{my-component "John" 38}}
\n
\n
\n \n

The parameters can be referred to just like named parameters:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
 Name: {{name}}, Age: {{age}}.
\n
\n
\n \n

Using a string instead of an array allows for an arbitrary number of\n parameters:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
 import Component from '@ember/component';\n\n let MyComponent = Component.extend();\n\n MyComponent.reopenClass({\n   positionalParams: 'names'\n });\n\n export default MyComponent;
\n
\n
\n \n

It can then be invoked like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
 {{my-component "John" "Michael" "Scott"}}
\n
\n
\n \n

The parameters can then be referred to by enumerating over the list:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
 {{#each names as |name|}}{{name}}{{/each}}
\n
\n
\n \n", + "static": 1, + "access": "public", + "tagname": "", + "itemtype": "property", + "name": "positionalParams", + "since": "1.13.0", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 1143, + "description": "

Layout can be used to wrap content in a component.

\n", + "itemtype": "property", + "name": "layout", + "type": "Function", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 1151, + "description": "

The name of the layout to lookup if no layout is provided.\nBy default Component will lookup a template with this name in\nEmber.TEMPLATES (a shared global object).

\n", + "itemtype": "property", + "name": "layoutName", + "type": "String", + "default": "undefined", + "access": "private", + "tagname": "", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 1162, + "description": "

The WAI-ARIA role of the control represented by this view. For example, a\n button may have a role of type 'button', or a pane may have a role of\n type 'alertdialog'. This property is used by assistive software to help\n visually challenged users navigate rich web applications.

\n

The full list of valid WAI-ARIA roles is available at:\n https://www.w3.org/TR/wai-aria/#roles_categorization

\n", + "itemtype": "property", + "name": "ariaRole", + "type": "String", + "default": "undefined", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/views/lib/views/core_view.ts", + "line": 38, + "description": "

If the view is currently inserted into the DOM of a parent view, this\nproperty will point to the parent of the view.

\n", + "itemtype": "property", + "name": "parentView", + "type": "Ember.View", + "default": "null", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.CoreView" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 35, + "description": "

A list of properties of the view to apply as attributes. If the property\nis a string value, the value of that string will be applied as the value\nfor an attribute of the property's name.

\n

The following example creates a tag like <div priority="high" />.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['priority'],\n   priority: 'high'\n });
\n
\n
\n \n

If the value of the property is a Boolean, the attribute is treated as\nan HTML Boolean attribute. It will be present if the property is true\nand omitted if the property is false.

\n

The following example creates markup like <div visible />.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['visible'],\n   visible: true\n });
\n
\n
\n \n

If you would prefer to use a custom value instead of the property name,\nyou can create the same markup as the last example with a binding like\nthis:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['isVisible:visible'],\n   isVisible: true\n });
\n
\n
\n \n

This list of attributes is inherited from the component's superclasses,\nas well.

\n", + "itemtype": "property", + "name": "attributeBindings", + "type": "Array", + "default": "[]", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 166, + "description": "

Returns the current DOM element for the view.

\n", + "itemtype": "property", + "name": "element", + "type": "DOMElement", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 267, + "description": "

The HTML id of the view's element in the DOM. You can provide this\nvalue yourself but it must be unique (just as in HTML):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component elementId="a-really-cool-id"}}
\n
\n
\n \n

If not manually set a default value will be provided by the framework.

\n

Once rendered an element's elementId is considered immutable and you\nshould never change it. If you need to compute a dynamic value for the\nelementId, you should do this when the component or element is being\ninstantiated:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   init() {\n     this._super(...arguments);\n     let index = this.get('index');\n     this.set('elementId', 'component-id' + index);\n   }\n });
\n
\n
\n \n", + "itemtype": "property", + "name": "elementId", + "type": "String", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 378, + "description": "

Tag name for the view's outer element. The tag name is only used when an\nelement is first created. If you change the tagName for an element, you\nmust destroy and recreate the view element.

\n

By default, the render buffer will use a <div> tag for views.

\n

If the tagName is '', the view will be tagless, with no outer element.\nComponent properties that depend on the presence of an outer element, such\nas classNameBindings and attributeBindings, do not work with tagless\ncomponents. Tagless components cannot implement methods to handle events,\nand their element property has a null value.

\n", + "itemtype": "property", + "name": "tagName", + "type": "String", + "default": "null", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ViewMixin" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/child_views_support.ts", + "line": 14, + "description": "

Array of child views. You should never edit this array directly.

\n", + "itemtype": "property", + "name": "childViews", + "type": "Array", + "default": "[]", + "access": "private", + "tagname": "", + "class": "Component", + "module": "ember", + "inherited": true, + "inheritedFrom": "Ember.ClassNamesSupport" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/class_names_support.ts", + "line": 36, + "description": "

Standard CSS class names to apply to the view's outer element. This\nproperty automatically inherits any class names defined by the view's\nsuperclasses as well.

\n", + "itemtype": "property", + "name": "classNames", + "type": "Array", + "default": "['ember-view']", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ClassNamesSupport" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/class_names_support.ts", + "line": 48, + "description": "

A list of properties of the view to apply as class names. If the property\nis a string value, the value of that string will be applied as a class\nname.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// Applies the 'high' class to the view element\nimport Component from '@ember/component';\nComponent.extend({\n  classNameBindings: ['priority'],\n  priority: 'high'\n});
\n
\n
\n \n

If the value of the property is a Boolean, the name of that property is\nadded as a dasherized class name.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// Applies the 'is-urgent' class to the view element\nimport Component from '@ember/component';\nComponent.extend({\n  classNameBindings: ['isUrgent'],\n  isUrgent: true\n});
\n
\n
\n \n

If you would prefer to use a custom value instead of the dasherized\nproperty name, you can pass a binding like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// Applies the 'urgent' class to the view element\nimport Component from '@ember/component';\nComponent.extend({\n  classNameBindings: ['isUrgent:urgent'],\n  isUrgent: true\n});
\n
\n
\n \n

If you would like to specify a class that should only be added when the\nproperty is false, you can declare a binding like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// Applies the 'disabled' class to the view element\nimport Component from '@ember/component';\nComponent.extend({\n  classNameBindings: ['isEnabled::disabled'],\n  isEnabled: false\n});
\n
\n
\n \n

This list of properties is inherited from the component's superclasses as well.

\n", + "itemtype": "property", + "name": "classNameBindings", + "type": "Array", + "default": "[]", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ClassNamesSupport" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 27, + "description": "

The collection of functions, keyed by name, available on this\nActionHandler as action targets.

\n

These functions will be invoked when a matching {{action}} is triggered\nfrom within a template and the application's current route is this route.

\n

Actions can also be invoked from other parts of your application\nvia ActionHandler#send.

\n

The actions hash will inherit action handlers from\nthe actions hash defined on extended parent classes\nor mixins rather than just replace the entire hash, e.g.:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
banner.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/object/mixin';\n\nexport default Mixin.create({\n  actions: {\n    displayBanner(msg) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport CanDisplayBanner from '../mixins/can-display-banner';\n\nexport default Route.extend(CanDisplayBanner, {\n  actions: {\n    playMusic() {\n      // ...\n    }\n  }\n});\n\n// `WelcomeRoute`, when active, will be able to respond\n// to both actions, since the actions hash is merged rather\n// then replaced when extending mixins / parent classes.\nthis.send('displayBanner');\nthis.send('playMusic');
\n
\n
\n \n

Within a Controller, Route or Component's action handler,\nthe value of the this context is the Controller, Route or\nComponent object:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    myAction() {\n      this.controllerFor("song");\n      this.transitionTo("other.route");\n      ...\n    }\n  }\n});
\n
\n
\n \n

It is also possible to call this._super(...arguments) from within an\naction handler if it overrides a handler defined on a parent\nclass or mixin:

\n

Take for example the following routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
route.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/object/mixin';\n\nexport default Mixin.create({\n  actions: {\n    debugRouteInformation() {\n      console.debug("It's a-me, console.debug!");\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
debug.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Route from '@ember/routing/route';\nimport DebugRoute from '../mixins/debug-route';\n\nexport default Route.extend(DebugRoute, {\n  actions: {\n    debugRouteInformation() {\n      // also call the debugRouteInformation of mixed in DebugRoute\n      this._super(...arguments);\n\n      // show additional annoyance\n      window.alert(...);\n    }\n  }\n});
\n
\n
\n \n

Bubbling

\n

By default, an action will stop bubbling once a handler defined\non the actions hash handles it. To continue bubbling the action,\nyou must return true from the handler:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("album", function() {\n    this.route("song");\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/album.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying: function() {\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying() {\n      // ...\n\n      if (actionShouldAlsoBeTriggeredOnParentRoute) {\n        return true;\n      }\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "actions", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Component", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 356, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 430, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 505, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 523, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Component", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-5.3.0-Ember.CoreView", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/component", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-ComponentStateBucket.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-ComponentStateBucket.json new file mode 100644 index 000000000..128564f50 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-ComponentStateBucket.json @@ -0,0 +1,45 @@ +{ + "data": { + "id": "ember-5.3.0-ComponentStateBucket", + "type": "class", + "attributes": { + "name": "ComponentStateBucket", + "shortname": "ComponentStateBucket", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "", + "file": "packages/@ember/-internals/glimmer/lib/utils/curly-component-state-bucket.ts", + "line": 17, + "description": "

Represents the internal state of the component.

\n", + "access": "private", + "tagname": "", + "methods": [], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-ComputedProperty.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-ComputedProperty.json new file mode 100644 index 000000000..7ec9a7eb9 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-ComputedProperty.json @@ -0,0 +1,81 @@ +{ + "data": { + "id": "ember-5.3.0-ComputedProperty", + "type": "class", + "attributes": { + "name": "ComputedProperty", + "shortname": "ComputedProperty", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/-internals/metal/lib/computed.ts", + "line": 76, + "description": "

@computed is a decorator that turns a JavaScript getter and setter into a\ncomputed property, which is a cached, trackable value. By default the getter\nwill only be called once and the result will be cached. You can specify\nvarious properties that your computed property depends on. This will force the\ncached result to be cleared if the dependencies are modified, and lazily recomputed the next time something asks for it.

\n

In the following example we decorate a getter - fullName - by calling\ncomputed with the property dependencies (firstName and lastName) as\narguments. The fullName getter will be called once (regardless of how many\ntimes it is accessed) as long as its dependencies do not change. Once\nfirstName or lastName are updated any future calls to fullName will\nincorporate the new values, and any watchers of the value such as templates\nwill be updated:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @computed('firstName', 'lastName')\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n});\n\nlet tom = new Person('Tom', 'Dale');\n\ntom.fullName; // 'Tom Dale'
\n
\n
\n \n

You can also provide a setter, which will be used when updating the computed\nproperty. Ember's set function must be used to update the property\nsince it will also notify observers of the property:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @computed('firstName', 'lastName')\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n\n  set fullName(value) {\n    let [firstName, lastName] = value.split(' ');\n\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n});\n\nlet person = new Person();\n\nset(person, 'fullName', 'Peter Wagenet');\nperson.firstName; // 'Peter'\nperson.lastName;  // 'Wagenet'
\n
\n
\n \n

You can also pass a getter function or object with get and set functions\nas the last argument to the computed decorator. This allows you to define\ncomputed property macros:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import { computed } from '@ember/object';\n\nfunction join(...keys) {\n  return computed(...keys, function() {\n    return keys.map(key => this[key]).join(' ');\n  });\n}\n\nclass Person {\n  @join('firstName', 'lastName')\n  fullName;\n}
\n
\n
\n \n

Note that when defined this way, getters and setters receive the key of the\nproperty they are decorating as the first argument. Setters receive the value\nthey are setting to as the second argument instead. Additionally, setters must\nreturn the value that should be cached:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n
import { computed, set } from '@ember/object';\n\nfunction fullNameMacro(firstNameKey, lastNameKey) {\n  return computed(firstNameKey, lastNameKey, {\n    get() {\n      return `${this[firstNameKey]} ${this[lastNameKey]}`;\n    }\n\n    set(key, value) {\n      let [firstName, lastName] = value.split(' ');\n\n      set(this, firstNameKey, firstName);\n      set(this, lastNameKey, lastName);\n\n      return value;\n    }\n  });\n}\n\nclass Person {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @fullNameMacro('firstName', 'lastName') fullName;\n});\n\nlet person = new Person();\n\nset(person, 'fullName', 'Peter Wagenet');\nperson.firstName; // 'Peter'\nperson.lastName;  // 'Wagenet'
\n
\n
\n \n

Computed properties can also be used in classic classes. To do this, we\nprovide the getter and setter as the last argument like we would for a macro,\nand we assign it to a property on the class definition. This is an anonymous\ncomputed macro:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n
import EmberObject, { computed, set } from '@ember/object';\n\nlet Person = EmberObject.extend({\n  // these will be supplied by `create`\n  firstName: null,\n  lastName: null,\n\n  fullName: computed('firstName', 'lastName', {\n    get() {\n      return `${this.firstName} ${this.lastName}`;\n    }\n\n    set(key, value) {\n      let [firstName, lastName] = value.split(' ');\n\n      set(this, 'firstName', firstName);\n      set(this, 'lastName', lastName);\n\n      return value;\n    }\n  })\n});\n\nlet tom = Person.create({\n  firstName: 'Tom',\n  lastName: 'Dale'\n});\n\ntom.get('fullName') // 'Tom Dale'
\n
\n
\n \n

You can overwrite computed property without setters with a normal property (no\nlonger computed) that won't change if dependencies change. You can also mark\ncomputed property as .readOnly() and block all attempts to set it.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  constructor(firstName, lastName) {\n    set(this, 'firstName', firstName);\n    set(this, 'lastName', lastName);\n  }\n\n  @computed('firstName', 'lastName').readOnly()\n  get fullName() {\n    return `${this.firstName} ${this.lastName}`;\n  }\n});\n\nlet person = new Person();\nperson.set('fullName', 'Peter Wagenet'); // Uncaught Error: Cannot set read-only property "fullName" on object: <(...):emberXXX>
\n
\n
\n \n

Additional resources:

\n\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/computed.ts", + "line": 606, + "description": "

Call on a computed property to set it into read-only mode. When in this\nmode the computed property will throw an error when set.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { computed, set } from '@ember/object';\n\nclass Person {\n  @computed().readOnly()\n  get guid() {\n    return 'guid-guid-guid';\n  }\n}\n\nlet person = new Person();\nset(person, 'guid', 'new-guid'); // will throw an exception
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import EmberObject, { computed } from '@ember/object';\n\nlet Person = EmberObject.extend({\n  guid: computed(function() {\n    return 'guid-guid-guid';\n  }).readOnly()\n});\n\nlet person = Person.create();\nperson.set('guid', 'new-guid'); // will throw an exception
\n
\n
\n \n", + "itemtype": "method", + "name": "readOnly", + "return": { + "description": "this", + "type": "ComputedProperty" + }, + "chainable": 1, + "access": "public", + "tagname": "", + "class": "ComputedProperty", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/computed.ts", + "line": 656, + "description": "

In some cases, you may want to annotate computed properties with additional\nmetadata about how they function or what values they operate on. For example,\ncomputed property functions may close over variables that are then no longer\navailable for introspection. You can pass a hash of these values to a\ncomputed property.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { computed } from '@ember/object';\nimport Person from 'my-app/utils/person';\n\nclass Store {\n  @computed().meta({ type: Person })\n  get person() {\n    let personId = this.personId;\n    return Person.create({ id: personId });\n  }\n}
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { computed } from '@ember/object';\nimport Person from 'my-app/utils/person';\n\nconst Store = EmberObject.extend({\n  person: computed(function() {\n    let personId = this.get('personId');\n    return Person.create({ id: personId });\n  }).meta({ type: Person })\n});
\n
\n
\n \n

The hash that you pass to the meta() function will be saved on the\ncomputed property descriptor under the _meta key. Ember runtime\nexposes a public API for retrieving these values from classes,\nvia the metaForProperty() function.

\n", + "itemtype": "method", + "name": "meta", + "params": [ + { + "name": "meta", + "description": "", + "type": "Object" + } + ], + "chainable": 1, + "access": "public", + "tagname": "", + "class": "ComputedProperty", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-Container.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-Container.json new file mode 100644 index 000000000..b5ef7215a --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-Container.json @@ -0,0 +1,175 @@ +{ + "data": { + "id": "ember-5.3.0-Container", + "type": "class", + "attributes": { + "name": "Container", + "shortname": "Container", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "rsvp", + "namespace": "", + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 60, + "description": "

A container used to instantiate and cache objects.

\n

Every Container must be associated with a Registry, which is referenced\nto determine the factory and options that should be used to instantiate\nobjects.

\n

The public API for Container is still in flux and should not be considered\nstable.

\n", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 119, + "description": "

Given a fullName return a corresponding instance.\n The default behavior is for lookup to return a singleton instance.\nThe singleton is scoped to the container, allowing multiple containers\nto all have their own locally scoped singletons.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let registry = new Registry();\nlet container = registry.container();\n registry.register('api:twitter', Twitter);\n let twitter = container.lookup('api:twitter');\n twitter instanceof Twitter; // => true\n // by default the container will return singletons\nlet twitter2 = container.lookup('api:twitter');\ntwitter2 instanceof Twitter; // => true\n twitter === twitter2; //=> true
\n
\n
\n \n

If singletons are not wanted, an optional flag can be provided at lookup.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let registry = new Registry();\nlet container = registry.container();\n registry.register('api:twitter', Twitter);\n let twitter = container.lookup('api:twitter', { singleton: false });\nlet twitter2 = container.lookup('api:twitter', { singleton: false });\n twitter === twitter2; //=> false
\n
\n
\n \n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "lookup", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "RegisterOptions", + "optional": true + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 161, + "description": "

A depth first traversal, destroying the container, its descendant containers and all\ntheir managed objects.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "destroy", + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 178, + "description": "

Clear either the entire cache or just the cache for a particular key.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "reset", + "params": [ + { + "name": "fullName", + "description": "optional key to reset; if missing, resets everything", + "type": "String" + } + ], + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 195, + "description": "

Returns an object that can be used to provide an owner to a\nmanually created instance.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "ownerInjection", + "return": { + "description": "", + "type": "Object" + }, + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 208, + "description": "

Given a fullName, return the corresponding factory. The consumer of the factory\nis responsible for the destruction of any factory instances, as there is no\nway for the container to ensure instances are destroyed when it itself is\ndestroyed.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "factoryFor", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "Container", + "module": "rsvp" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 100, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "registry", + "type": "Registry", + "since": "1.11.0", + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 107, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "cache", + "type": "InheritingDict", + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 113, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "validationCache", + "type": "InheritingDict", + "class": "Container", + "module": "rsvp" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-rsvp", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-ContainerDebugAdapter.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-ContainerDebugAdapter.json new file mode 100644 index 000000000..8a20ce7fa --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-ContainerDebugAdapter.json @@ -0,0 +1,592 @@ +{ + "data": { + "id": "ember-5.3.0-ContainerDebugAdapter", + "type": "class", + "attributes": { + "name": "ContainerDebugAdapter", + "shortname": "ContainerDebugAdapter", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/debug/container-debug-adapter", + "namespace": "", + "file": "packages/@ember/debug/container-debug-adapter.ts", + "line": 13, + "description": "

The ContainerDebugAdapter helps the container and resolver interface\nwith tools that debug Ember such as the\nEmber Inspector\nfor Chrome and Firefox.

\n

This class can be extended by a custom resolver implementer\nto override some of the methods with library-specific code.

\n

The methods likely to be overridden are:

\n
    \n
  • canCatalogEntriesByType
  • \n
  • catalogEntriesByType
  • \n
\n

The adapter will need to be registered\nin the application's container as container-debug-adapter:main.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
Application.initializer({\n  name: "containerDebugAdapter",\n\n  initialize(application) {\n    application.register('container-debug-adapter:main', require('app/container-debug-adapter'));\n  }\n});
\n
\n
\n \n", + "extends": "EmberObject", + "since": "1.5.0", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/debug/container-debug-adapter.ts", + "line": 64, + "description": "

Returns true if it is possible to catalog a list of available\nclasses in the resolver for a given type.

\n", + "itemtype": "method", + "name": "canCatalogEntriesByType", + "params": [ + { + "name": "type", + "description": "The type. e.g. \"model\", \"controller\", \"route\".", + "type": "String" + } + ], + "return": { + "description": "whether a list is available for this type.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/debug/container-debug-adapter" + }, + { + "file": "packages/@ember/debug/container-debug-adapter.ts", + "line": 81, + "description": "

Returns the available classes a given type.

\n", + "itemtype": "method", + "name": "catalogEntriesByType", + "params": [ + { + "name": "type", + "description": "The type. e.g. \"model\", \"controller\", \"route\".", + "type": "String" + } + ], + "return": { + "description": "An array of strings.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/debug/container-debug-adapter" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 322, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 541, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 568, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 576, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 164, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 212, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 229, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 247, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 333, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 354, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 371, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 388, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 403, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 433, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 453, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 497, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/debug/container-debug-adapter.ts", + "line": 54, + "description": "

The resolver instance of the application\nbeing debugged. This property will be injected\non creation.

\n", + "itemtype": "property", + "name": "resolver", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/debug/container-debug-adapter" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 356, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 430, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 505, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 523, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "ContainerDebugAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-5.3.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/debug/container-debug-adapter", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-ContainerProxy.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-ContainerProxy.json new file mode 100644 index 000000000..ce508b0dc --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-ContainerProxy.json @@ -0,0 +1,108 @@ +{ + "data": { + "id": "ember-5.3.0-ContainerProxy", + "type": "class", + "attributes": { + "name": "ContainerProxy", + "shortname": "ContainerProxy", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/owner", + "namespace": "", + "file": "packages/@ember/-internals/owner/index.ts", + "line": 563, + "description": "

The interface for a container proxy, which is itself a private API used\nby the private ContainerProxyMixin as part of the base definition of\nEngineInstance.

\n", + "access": "private", + "tagname": "", + "extends": "BasicContainer", + "methods": [ + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 198, + "description": "

Given a fullName return a corresponding instance.

\n

The default behavior is for lookup to return a singleton instance.\nThe singleton is scoped to the container, allowing multiple containers\nto all have their own locally scoped singletons.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter');\n\ntwitter instanceof Twitter; // => true\n\n// by default the container will return singletons\nlet twitter2 = container.lookup('api:twitter');\ntwitter2 instanceof Twitter; // => true\n\ntwitter === twitter2; //=> true
\n
\n
\n \n

If singletons are not wanted an optional flag can be provided at lookup.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter', { singleton: false });\nlet twitter2 = container.lookup('api:twitter', { singleton: false });\n\ntwitter === twitter2; //=> false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "lookup", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "RegisterOptions" + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "ContainerProxy", + "module": "@ember/owner", + "inherited": true, + "inheritedFrom": "BasicContainer" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 247, + "description": "

Given a FullName, of the form "type:name" return a FactoryManager.

\n

This method returns a manager which can be used for introspection of the\nfactory's class or for the creation of factory instances with initial\nproperties. The manager is an object with the following properties:

\n
    \n
  • class - The registered or resolved class.
  • \n
  • create - A function that will create an instance of the class with\nany dependencies injected.
  • \n
\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(otherInstance);\n// the owner is commonly the `applicationInstance`, and can be accessed via\n// an instance initializer.\n\nlet factory = owner.factoryFor('service:bespoke');\n\nfactory.class;\n// The registered or resolved class. For example when used with an Ember-CLI\n// app, this would be the default export from `app/services/bespoke.js`.\n\nlet instance = factory.create({\n  someProperty: 'an initial property value'\n});\n// Create an instance with any injections and the passed options as\n// initial properties.
\n
\n
\n \n

Any instances created via the factory's .create() method must be destroyed\nmanually by the caller of .create(). Typically, this is done during the creating\nobjects own destroy or willDestroy methods.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "factoryFor", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "FactoryManager" + }, + "class": "ContainerProxy", + "module": "@ember/owner", + "inherited": true, + "inheritedFrom": "BasicContainer" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-5.3.0-BasicContainer", + "type": "class" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-5.3.0-ContainerProxyMixin" + } + ] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/owner", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-ContainerProxyMixin.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-ContainerProxyMixin.json new file mode 100644 index 000000000..75f667714 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-ContainerProxyMixin.json @@ -0,0 +1,118 @@ +{ + "data": { + "id": "ember-5.3.0-ContainerProxyMixin", + "type": "class", + "attributes": { + "name": "ContainerProxyMixin", + "shortname": "ContainerProxyMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "EngineInstance" + ], + "module": "ember", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 12, + "description": "

ContainerProxyMixin is used to provide public access to specific\ncontainer functionality.

\n", + "extends": "ContainerProxy", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 198, + "description": "

Given a fullName return a corresponding instance.

\n

The default behavior is for lookup to return a singleton instance.\nThe singleton is scoped to the container, allowing multiple containers\nto all have their own locally scoped singletons.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter');\n\ntwitter instanceof Twitter; // => true\n\n// by default the container will return singletons\nlet twitter2 = container.lookup('api:twitter');\ntwitter2 instanceof Twitter; // => true\n\ntwitter === twitter2; //=> true
\n
\n
\n \n

If singletons are not wanted an optional flag can be provided at lookup.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter', { singleton: false });\nlet twitter2 = container.lookup('api:twitter', { singleton: false });\n\ntwitter === twitter2; //=> false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "lookup", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "RegisterOptions" + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "ContainerProxyMixin", + "module": "@ember/owner", + "inherited": true, + "inheritedFrom": "BasicContainer" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 247, + "description": "

Given a FullName, of the form "type:name" return a FactoryManager.

\n

This method returns a manager which can be used for introspection of the\nfactory's class or for the creation of factory instances with initial\nproperties. The manager is an object with the following properties:

\n
    \n
  • class - The registered or resolved class.
  • \n
  • create - A function that will create an instance of the class with\nany dependencies injected.
  • \n
\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(otherInstance);\n// the owner is commonly the `applicationInstance`, and can be accessed via\n// an instance initializer.\n\nlet factory = owner.factoryFor('service:bespoke');\n\nfactory.class;\n// The registered or resolved class. For example when used with an Ember-CLI\n// app, this would be the default export from `app/services/bespoke.js`.\n\nlet instance = factory.create({\n  someProperty: 'an initial property value'\n});\n// Create an instance with any injections and the passed options as\n// initial properties.
\n
\n
\n \n

Any instances created via the factory's .create() method must be destroyed\nmanually by the caller of .create(). Typically, this is done during the creating\nobjects own destroy or willDestroy methods.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "factoryFor", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "FactoryManager" + }, + "class": "ContainerProxyMixin", + "module": "@ember/owner", + "inherited": true, + "inheritedFrom": "BasicContainer" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 25, + "description": "

The container stores state.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "__container__", + "type": "Ember.Container", + "class": "ContainerProxyMixin", + "module": "ember" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-5.3.0-ContainerProxy", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-CoreObject.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-CoreObject.json new file mode 100644 index 000000000..93b70573f --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-CoreObject.json @@ -0,0 +1,158 @@ +{ + "data": { + "id": "ember-5.3.0-CoreObject", + "type": "class", + "attributes": { + "name": "CoreObject", + "shortname": "CoreObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object/core", + "namespace": "", + "file": "packages/@ember/object/core.ts", + "line": 175, + "description": "

CoreObject is the base class for all Ember constructs. It establishes a\nclass system based on Ember's Mixin system, and provides the basis for the\nEmber Object Model. CoreObject should generally not be used directly,\ninstead you should use EmberObject.

\n

Usage

\n

You can define a class by extending from CoreObject using the extend\nmethod:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Person = CoreObject.extend({\n  name: 'Tomster',\n});
\n
\n
\n \n

For detailed usage, see the Object Model\nsection of the guides.

\n

Usage with Native Classes

\n

Native JavaScript class syntax can be used to extend from any CoreObject\nbased class:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
class Person extends CoreObject {\n  init() {\n    super.init(...arguments);\n    this.name = 'Tomster';\n  }\n}
\n
\n
\n \n

Some notes about class usage:

\n
    \n
  • new syntax is not currently supported with classes that extend from\nEmberObject or CoreObject. You must continue to use the create method\nwhen making new instances of classes, even if they are defined using native\nclass syntax. If you want to use new syntax, consider creating classes\nwhich do not extend from EmberObject or CoreObject. Ember features,\nsuch as computed properties and decorators, will still work with base-less\nclasses.
  • \n
  • Instead of using this._super(), you must use standard super syntax in\nnative classes. See the MDN docs on classes\nfor more details.
  • \n
  • Native classes support using constructors\nto set up newly-created instances. Ember uses these to, among other things,\nsupport features that need to retrieve other entities by name, like Service\ninjection and getOwner. To ensure your custom instance setup logic takes\nplace after this important work is done, avoid using the constructor in\nfavor of init.
  • \n
  • Properties passed to create will be available on the instance by the time\ninit runs, so any code that requires these values should work at that\ntime.
  • \n
  • Using native classes, and switching back to the old Ember Object model is\nfully supported.
  • \n
\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/object/core.ts", + "line": 322, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 541, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 568, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 576, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object/core" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/object/core.ts", + "line": 356, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 430, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 505, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 523, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "CoreObject", + "module": "@ember/object/core" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-5.3.0-Helper" + }, + { + "type": "class", + "id": "ember-5.3.0-EmberObject" + } + ] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/object/core", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-DataAdapter.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-DataAdapter.json new file mode 100644 index 000000000..9683dc256 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-DataAdapter.json @@ -0,0 +1,935 @@ +{ + "data": { + "id": "ember-5.3.0-DataAdapter", + "type": "class", + "attributes": { + "name": "DataAdapter", + "shortname": "DataAdapter", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/debug/data-adapter", + "namespace": "", + "file": "packages/@ember/debug/data-adapter.ts", + "line": 178, + "description": "

The DataAdapter helps a data persistence library\ninterface with tools that debug Ember such\nas the Ember Inspector\nfor Chrome and Firefox.

\n

This class will be extended by a persistence library\nwhich will override some of the methods with\nlibrary-specific code.

\n

The methods likely to be overridden are:

\n
    \n
  • getFilters
  • \n
  • detect
  • \n
  • columnsForType
  • \n
  • getRecords
  • \n
  • getRecordColumnValues
  • \n
  • getRecordKeywords
  • \n
  • getRecordFilterValues
  • \n
  • getRecordColor
  • \n
\n

The adapter will need to be registered\nin the application's container as dataAdapter:main.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
Application.initializer({\n  name: "data-adapter",\n\n  initialize: function(application) {\n    application.register('data-adapter:main', DS.DataAdapter);\n  }\n});
\n
\n
\n \n", + "extends": "EmberObject", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 305, + "description": "

Specifies how records can be filtered.\nRecords returned will need to have a filterValues\nproperty with a key for every name in the returned array.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getFilters", + "return": { + "description": "List of objects defining filters.\n The object should have a `name` and `desc` property.", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 322, + "description": "

Fetch the model types and observe them for changes.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "watchModelTypes", + "params": [ + { + "name": "typesAdded", + "description": "Callback to call to add types.\nTakes an array of objects containing wrapped types (returned from `wrapModelType`).", + "type": "Function" + }, + { + "name": "typesUpdated", + "description": "Callback to call when a type has changed.\nTakes an array of objects containing wrapped types.", + "type": "Function" + } + ], + "return": { + "description": "Method to call to remove all observers", + "type": "Function" + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 370, + "description": "

Fetch the records of a given type and observe them for changes.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "watchRecords", + "params": [ + { + "name": "modelName", + "description": "The model name.", + "type": "String" + }, + { + "name": "recordsAdded", + "description": "Callback to call to add records.\nTakes an array of objects containing wrapped records.\nThe object should have the following properties:\n columnValues: {Object} The key and value of a table cell.\n object: {Object} The actual record object.", + "type": "Function" + }, + { + "name": "recordsUpdated", + "description": "Callback to call when a record has changed.\nTakes an array of objects containing wrapped records.", + "type": "Function" + }, + { + "name": "recordsRemoved", + "description": "Callback to call when a record has removed.\nTakes an array of objects containing wrapped records.", + "type": "Function" + } + ], + "return": { + "description": "Method to call to remove all observers.", + "type": "Function" + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 442, + "description": "

Clear all observers before destruction

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "willDestroy", + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 460, + "description": "

Detect whether a class is a model.

\n

Test that against the model class\nof your persistence library.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "detect", + "return": { + "description": "boolean Whether the class is a model class or not." + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 474, + "description": "

Get the columns for a given model type.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "columnsForType", + "return": { + "description": "An array of columns of the following format:\n name: {String} The name of the column.\n desc: {String} Humanized description (what would show in a table column name).", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 487, + "description": "

Adds observers to a model type class.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "observeModelType", + "params": [ + { + "name": "modelName", + "description": "The model type name.", + "type": "String" + }, + { + "name": "typesUpdated", + "description": "Called when a type is modified.", + "type": "Function" + } + ], + "return": { + "description": "The function to call to remove observers.", + "type": "Function" + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 524, + "description": "

Wraps a given model type and observes changes to it.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "wrapModelType", + "params": [ + { + "name": "klass", + "description": "A model class.", + "type": "Class" + }, + { + "name": "modelName", + "description": "Name of the class.", + "type": "String" + } + ], + "return": { + "description": "The wrapped type has the following format:\n name: {String} The name of the type.\n count: {Integer} The number of records available.\n columns: {Columns} An array of columns to describe the record.\n object: {Class} The actual Model type class.", + "type": "Object" + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 548, + "description": "

Fetches all models defined in the application.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getModelTypes", + "return": { + "description": "Array of model types.", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 573, + "description": "

Loops over all namespaces and all objects\nattached to them.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_getObjectsOnNamespaces", + "return": { + "description": "Array of model type strings.", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 602, + "description": "

Fetches all loaded records for a given type.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getRecords", + "return": { + "description": "An array of records.\n This array will be observed for changes,\n so it should update when new records are added/removed.", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 615, + "description": "

Wraps a record and observers changes to it.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "wrapRecord", + "params": [ + { + "name": "record", + "description": "The record instance.", + "type": "Object" + } + ], + "return": { + "description": "The wrapped record. Format:\ncolumnValues: {Array}\nsearchKeywords: {Array}", + "type": "Object" + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 635, + "description": "

Gets the values for each column.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getRecordColumnValues", + "return": { + "description": "Keys should match column names defined\nby the model type.", + "type": "Object" + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 647, + "description": "

Returns keywords to match when searching records.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getRecordKeywords", + "return": { + "description": "Relevant keywords for search.", + "type": "Array" + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 658, + "description": "

Returns the values of filters defined by getFilters.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getRecordFilterValues", + "params": [ + { + "name": "record", + "description": "The record instance.", + "type": "Object" + } + ], + "return": { + "description": "The filter values.", + "type": "Object" + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 670, + "description": "

Each record can have a color that represents its state.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "getRecordColor", + "params": [ + { + "name": "record", + "description": "The record instance", + "type": "Object" + } + ], + "return": { + "description": "The records color.\n Possible options: black, red, blue, green.", + "type": "String" + }, + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 322, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 541, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 568, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 576, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 164, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 212, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 229, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 247, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 333, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 354, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 371, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 388, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 403, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 433, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 453, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 497, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 234, + "description": "

The container-debug-adapter which is used\nto list all models.

\n", + "itemtype": "property", + "name": "containerDebugAdapter", + "default": "undefined", + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 244, + "description": "

The number of attributes to send\nas columns. (Enough to make the record\nidentifiable).

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "attributeLimit", + "default": "3", + "since": "1.3.0", + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 256, + "description": "

Ember Data > v1.0.0-beta.18\nrequires string model names to be passed\naround instead of the actual factories.

\n

This is a stamp for the Ember Inspector\nto differentiate between the versions\nto be able to support older versions too.

\n", + "access": "public", + "tagname": "", + "itemtype": "property", + "name": "acceptsModelName", + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 270, + "description": "

Map from records arrays to RecordsWatcher instances

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "recordsWatchers", + "since": "3.26.0", + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 278, + "description": "

Map from records arrays to TypeWatcher instances

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "typeWatchers", + "since": "3.26.0", + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 286, + "description": "

Callback that is currently scheduled on backburner end to flush and check\nall active watchers.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "flushWatchers", + "since": "3.26.0", + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/debug/data-adapter.ts", + "line": 296, + "description": "

Stores all methods that clear observers.\nThese methods will be called on destruction.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "releaseMethods", + "since": "1.3.0", + "class": "DataAdapter", + "module": "@ember/debug/data-adapter" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 356, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 430, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 505, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 523, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "DataAdapter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-5.3.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/debug/data-adapter", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-Descriptor.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-Descriptor.json new file mode 100644 index 000000000..9933fe51e --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-Descriptor.json @@ -0,0 +1,113 @@ +{ + "data": { + "id": "ember-5.3.0-Descriptor", + "type": "class", + "attributes": { + "name": "Descriptor", + "shortname": "Descriptor", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/-internals/metal/lib/decorator.ts", + "line": 50, + "description": "

Objects of this type can implement an interface to respond to requests to\nget and set. The default implementation handles simple properties.

\n", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/metal/lib/decorator.ts", + "line": 157, + "description": "

Returns the CP descriptor associated with obj and keyName, if any.

\n", + "itemtype": "method", + "name": "descriptorForProperty", + "params": [ + { + "name": "obj", + "description": "the object to check", + "type": "Object" + }, + { + "name": "keyName", + "description": "the key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Descriptor" + }, + "access": "private", + "tagname": "", + "class": "Descriptor", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/decorator.ts", + "line": 185, + "description": "

Check whether a value is a decorator

\n", + "itemtype": "method", + "name": "isClassicDecorator", + "params": [ + { + "name": "possibleDesc", + "description": "the value to check", + "type": "Any" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Descriptor", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/decorator.ts", + "line": 197, + "description": "

Set a value as a decorator

\n", + "itemtype": "method", + "name": "setClassicDecorator", + "params": [ + { + "name": "decorator", + "description": "the value to mark as a decorator", + "type": "Function" + } + ], + "access": "private", + "tagname": "", + "class": "Descriptor", + "module": "@ember/object" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.@ember/controller.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.@ember/controller.json new file mode 100644 index 000000000..ea591bec5 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.@ember/controller.json @@ -0,0 +1,65 @@ +{ + "data": { + "id": "ember-5.3.0-Ember.@ember/controller", + "type": "class", + "attributes": { + "name": "Ember.@ember/controller", + "shortname": "@ember/controller", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/controller", + "namespace": "Ember", + "methods": [ + { + "file": "packages/@ember/controller/index.ts", + "line": 317, + "description": "

Creates a property that lazily looks up another controller in the container.\nCan only be used when defining another controller.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/controllers/post.js
1\n2\n3\n4\n5\n6\n7\n
import Controller, {\n  inject as controller\n} from '@ember/controller';\n\nexport default class PostController extends Controller {\n  @controller posts;\n}
\n
\n
\n \n

Classic Class Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/controllers/post.js
1\n2\n3\n4\n5\n6\n7\n
import Controller, {\n  inject as controller\n} from '@ember/controller';\n\nexport default Controller.extend({\n  posts: controller()\n});
\n
\n
\n \n

This example will create a posts property on the post controller that\nlooks up the posts controller in the container, making it easy to reference\nother controllers.

\n", + "itemtype": "method", + "name": "inject", + "static": 1, + "since": "1.10.0", + "params": [ + { + "name": "name", + "description": "(optional) name of the controller to inject, defaults to\n the property's name", + "type": "String" + } + ], + "return": { + "description": "injection decorator instance", + "type": "ComputedDecorator" + }, + "access": "public", + "tagname": "", + "class": "Ember.@ember/controller", + "module": "@ember/controller" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/controller", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.ActionHandler.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.ActionHandler.json new file mode 100644 index 000000000..d06855af0 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.ActionHandler.json @@ -0,0 +1,88 @@ +{ + "data": { + "id": "ember-5.3.0-Ember.ActionHandler", + "type": "class", + "attributes": { + "name": "Ember.ActionHandler", + "shortname": "Ember.ActionHandler", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Ember.CoreView", + "Ember.ControllerMixin" + ], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 9, + "description": "

Ember.ActionHandler is available on some familiar classes including\nRoute, Component, and Controller.\n(Internally the mixin is used by Ember.CoreView, Ember.ControllerMixin,\nand Route and available to the above classes through\ninheritance.)

\n", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 172, + "description": "

Triggers a named action on the ActionHandler. Any parameters\nsupplied after the actionName string will be passed as arguments\nto the action target function.

\n

If the ActionHandler has its target property set, actions may\nbubble to the target. Bubbling happens when an actionName can\nnot be found in the ActionHandler's actions hash or if the\naction target function returns true.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    playTheme() {\n      this.send('playMusic', 'theme.mp3');\n    },\n    playMusic(track) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "actionName", + "description": "The action to trigger", + "type": "String" + }, + { + "name": "context", + "description": "a context to send with the action", + "type": "*" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.ActionHandler", + "module": "ember", + "namespace": "Ember" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 27, + "description": "

The collection of functions, keyed by name, available on this\nActionHandler as action targets.

\n

These functions will be invoked when a matching {{action}} is triggered\nfrom within a template and the application's current route is this route.

\n

Actions can also be invoked from other parts of your application\nvia ActionHandler#send.

\n

The actions hash will inherit action handlers from\nthe actions hash defined on extended parent classes\nor mixins rather than just replace the entire hash, e.g.:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
banner.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/object/mixin';\n\nexport default Mixin.create({\n  actions: {\n    displayBanner(msg) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport CanDisplayBanner from '../mixins/can-display-banner';\n\nexport default Route.extend(CanDisplayBanner, {\n  actions: {\n    playMusic() {\n      // ...\n    }\n  }\n});\n\n// `WelcomeRoute`, when active, will be able to respond\n// to both actions, since the actions hash is merged rather\n// then replaced when extending mixins / parent classes.\nthis.send('displayBanner');\nthis.send('playMusic');
\n
\n
\n \n

Within a Controller, Route or Component's action handler,\nthe value of the this context is the Controller, Route or\nComponent object:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    myAction() {\n      this.controllerFor("song");\n      this.transitionTo("other.route");\n      ...\n    }\n  }\n});
\n
\n
\n \n

It is also possible to call this._super(...arguments) from within an\naction handler if it overrides a handler defined on a parent\nclass or mixin:

\n

Take for example the following routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
route.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/object/mixin';\n\nexport default Mixin.create({\n  actions: {\n    debugRouteInformation() {\n      console.debug("It's a-me, console.debug!");\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
debug.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Route from '@ember/routing/route';\nimport DebugRoute from '../mixins/debug-route';\n\nexport default Route.extend(DebugRoute, {\n  actions: {\n    debugRouteInformation() {\n      // also call the debugRouteInformation of mixed in DebugRoute\n      this._super(...arguments);\n\n      // show additional annoyance\n      window.alert(...);\n    }\n  }\n});
\n
\n
\n \n

Bubbling

\n

By default, an action will stop bubbling once a handler defined\non the actions hash handles it. To continue bubbling the action,\nyou must return true from the handler:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("album", function() {\n    this.route("song");\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/album.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying: function() {\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying() {\n      // ...\n\n      if (actionShouldAlsoBeTriggeredOnParentRoute) {\n        return true;\n      }\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "actions", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.ActionHandler", + "module": "ember", + "namespace": "Ember" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.ActionSupport.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.ActionSupport.json new file mode 100644 index 000000000..a51df9ee3 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.ActionSupport.json @@ -0,0 +1,46 @@ +{ + "data": { + "id": "ember-5.3.0-Ember.ActionSupport", + "type": "class", + "attributes": { + "name": "Ember.ActionSupport", + "shortname": "Ember.ActionSupport", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Component" + ], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/views/lib/mixins/action_support.ts", + "line": 8, + "access": "private", + "tagname": "", + "methods": [], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.ClassNamesSupport.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.ClassNamesSupport.json new file mode 100644 index 000000000..a130062b7 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.ClassNamesSupport.json @@ -0,0 +1,88 @@ +{ + "data": { + "id": "ember-5.3.0-Ember.ClassNamesSupport", + "type": "class", + "attributes": { + "name": "Ember.ClassNamesSupport", + "shortname": "Ember.ClassNamesSupport", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Component" + ], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/views/lib/mixins/class_names_support.ts", + "line": 10, + "access": "private", + "tagname": "", + "methods": [], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/views/lib/mixins/child_views_support.ts", + "line": 14, + "description": "

Array of child views. You should never edit this array directly.

\n", + "itemtype": "property", + "name": "childViews", + "type": "Array", + "default": "[]", + "access": "private", + "tagname": "", + "class": "Ember.ClassNamesSupport", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/class_names_support.ts", + "line": 36, + "description": "

Standard CSS class names to apply to the view's outer element. This\nproperty automatically inherits any class names defined by the view's\nsuperclasses as well.

\n", + "itemtype": "property", + "name": "classNames", + "type": "Array", + "default": "['ember-view']", + "access": "public", + "tagname": "", + "class": "Ember.ClassNamesSupport", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/class_names_support.ts", + "line": 48, + "description": "

A list of properties of the view to apply as class names. If the property\nis a string value, the value of that string will be applied as a class\nname.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// Applies the 'high' class to the view element\nimport Component from '@ember/component';\nComponent.extend({\n  classNameBindings: ['priority'],\n  priority: 'high'\n});
\n
\n
\n \n

If the value of the property is a Boolean, the name of that property is\nadded as a dasherized class name.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// Applies the 'is-urgent' class to the view element\nimport Component from '@ember/component';\nComponent.extend({\n  classNameBindings: ['isUrgent'],\n  isUrgent: true\n});
\n
\n
\n \n

If you would prefer to use a custom value instead of the dasherized\nproperty name, you can pass a binding like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// Applies the 'urgent' class to the view element\nimport Component from '@ember/component';\nComponent.extend({\n  classNameBindings: ['isUrgent:urgent'],\n  isUrgent: true\n});
\n
\n
\n \n

If you would like to specify a class that should only be added when the\nproperty is false, you can declare a binding like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// Applies the 'disabled' class to the view element\nimport Component from '@ember/component';\nComponent.extend({\n  classNameBindings: ['isEnabled::disabled'],\n  isEnabled: false\n});
\n
\n
\n \n

This list of properties is inherited from the component's superclasses as well.

\n", + "itemtype": "property", + "name": "classNameBindings", + "type": "Array", + "default": "[]", + "access": "public", + "tagname": "", + "class": "Ember.ClassNamesSupport", + "module": "ember", + "namespace": "Ember" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.Comparable.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.Comparable.json new file mode 100644 index 000000000..f10ff7e68 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.Comparable.json @@ -0,0 +1,75 @@ +{ + "data": { + "id": "ember-5.3.0-Ember.Comparable", + "type": "class", + "attributes": { + "name": "Ember.Comparable", + "shortname": "Ember.Comparable", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/runtime/lib/mixins/comparable.ts", + "line": 7, + "description": "

Implements some standard methods for comparing objects. Add this mixin to\nany class you create that can compare its instances.

\n

You should implement the compare() method.

\n", + "since": "Ember 0.9", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/comparable.ts", + "line": 22, + "description": "

Required. You must implement this method to apply this mixin.

\n

Override to return the result of the comparison of the two parameters. The\ncompare method should return:

\n
    \n
  • -1 if a < b
  • \n
  • 0 if a == b
  • \n
  • 1 if a > b
  • \n
\n

Default implementation raises an exception.

\n", + "itemtype": "method", + "name": "compare", + "params": [ + { + "name": "a", + "description": "the first object to compare", + "type": "Object" + }, + { + "name": "b", + "description": "the second object to compare", + "type": "Object" + } + ], + "return": { + "description": "the result of the comparison", + "type": "Number" + }, + "access": "private", + "tagname": "", + "class": "Ember.Comparable", + "module": "ember", + "namespace": "Ember" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.Controller.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.Controller.json new file mode 100644 index 000000000..9d810b180 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.Controller.json @@ -0,0 +1,729 @@ +{ + "data": { + "id": "ember-5.3.0-Ember.Controller", + "type": "class", + "attributes": { + "name": "Ember.Controller", + "shortname": "Controller", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/controller", + "namespace": "Ember", + "file": "packages/@ember/controller/index.ts", + "line": 308, + "extends": "EmberObject", + "uses": [ + "Ember.ControllerMixin" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/controller/index.ts", + "line": 91, + "description": "

Transition the application into another route. The route may\nbe either a single route or route path:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.transitionToRoute('blogPosts');\naController.transitionToRoute('blogPosts.recentEntries');
\n
\n
\n \n

Optionally supply a model for the route in question. The model\nwill be serialized into the URL using the serialize hook of\nthe route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.transitionToRoute('blogPost', aPost);
\n
\n
\n \n

If a literal is passed (such as a number or a string), it will\nbe treated as an identifier instead. In this case, the model\nhook of the route will be triggered:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.transitionToRoute('blogPost', 1);
\n
\n
\n \n

Multiple models will be applied last to first recursively up the\nroute tree.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route('blogPost', { path: ':blogPostId' }, function() {\n    this.route('blogComment', { path: ':blogCommentId', resetNamespace: true });\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.transitionToRoute('blogComment', aPost, aComment);\naController.transitionToRoute('blogComment', 1, 13);
\n
\n
\n \n

It is also possible to pass a URL (a string that starts with a\n/).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
aController.transitionToRoute('/');\naController.transitionToRoute('/blog/post/1/comment/13');\naController.transitionToRoute('/blog/posts?sort=title');
\n
\n
\n \n

An options hash with a queryParams property may be provided as\nthe final argument to add query parameters to the destination URL.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
aController.transitionToRoute('blogPost', 1, {\n  queryParams: { showComments: 'true' }\n});\n\n// if you just want to transition the query parameters without changing the route\naController.transitionToRoute({ queryParams: { sort: 'date' } });
\n
\n
\n \n

See also replaceRoute.

\n", + "itemtype": "method", + "name": "transitionToRoute", + "deprecated": true, + "deprecationMessage": "Use transitionTo from the Router service instead.", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used\n while transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/controller", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/controller/index.ts", + "line": 169, + "description": "

Transition into another route while replacing the current URL, if possible.\nThis will replace the current history entry instead of adding a new one.\nBeside that, it is identical to transitionToRoute in all other respects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('blogPosts');\naController.replaceRoute('blogPosts.recentEntries');
\n
\n
\n \n

Optionally supply a model for the route in question. The model\nwill be serialized into the URL using the serialize hook of\nthe route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.replaceRoute('blogPost', aPost);
\n
\n
\n \n

If a literal is passed (such as a number or a string), it will\nbe treated as an identifier instead. In this case, the model\nhook of the route will be triggered:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.replaceRoute('blogPost', 1);
\n
\n
\n \n

Multiple models will be applied last to first recursively up the\nroute tree.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route('blogPost', { path: ':blogPostId' }, function() {\n    this.route('blogComment', { path: ':blogCommentId', resetNamespace: true });\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('blogComment', aPost, aComment);\naController.replaceRoute('blogComment', 1, 13);
\n
\n
\n

It is also possible to pass a URL (a string that starts with a\n/).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('/');\naController.replaceRoute('/blog/post/1/comment/13');
\n
\n
\n \n", + "itemtype": "method", + "name": "replaceRoute", + "deprecated": true, + "deprecationMessage": "Use replaceWith from the Router service instead.", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used\nwhile transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\ncontaining a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/controller", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/controller/index.ts", + "line": 264, + "description": "

This property is updated to various different callback functions depending on\nthe current "state" of the backing route. It is used by\nController.prototype._qpChanged.

\n

The methods backing each state can be found in the Route.prototype._qp computed\nproperty return value (the .states property). The current values are listed here for\nthe sanity of future travelers:

\n
    \n
  • inactive - This state is used when this controller instance is not part of the active\nroute hierarchy. Set in Route.prototype._reset (a router.js microlib hook) and\nRoute.prototype.actions.finalizeQueryParamChange.
  • \n
  • active - This state is used when this controller instance is part of the active\nroute hierarchy. Set in Route.prototype.actions.finalizeQueryParamChange.
  • \n
  • allowOverrides - This state is used in Route.prototype.setup (route.js microlib hook).
  • \n
\n", + "itemtype": "method", + "name": "_qpDelegate", + "access": "private", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/controller", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/controller/index.ts", + "line": 285, + "description": "

During Route#setup observers are created to invoke this method\nwhen any of the query params declared in Controller#queryParams property\nare changed.

\n

When invoked this method uses the currently active query param update delegate\n(see Controller.prototype._qpDelegate for details) and invokes it with\nthe QP key/value being changed.

\n", + "itemtype": "method", + "name": "_qpChanged", + "access": "private", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/controller", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 322, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 541, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 568, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 576, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 164, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 212, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 229, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 247, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 333, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 354, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 371, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 388, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 403, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 433, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 453, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 497, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 172, + "description": "

Triggers a named action on the ActionHandler. Any parameters\nsupplied after the actionName string will be passed as arguments\nto the action target function.

\n

If the ActionHandler has its target property set, actions may\nbubble to the target. Bubbling happens when an actionName can\nnot be found in the ActionHandler's actions hash or if the\naction target function returns true.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    playTheme() {\n      this.send('playMusic', 'theme.mp3');\n    },\n    playMusic(track) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "actionName", + "description": "The action to trigger", + "type": "String" + }, + { + "name": "context", + "description": "a context to send with the action", + "type": "*" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/controller/index.ts", + "line": 36, + "description": "

The object to which actions from the view should be sent.

\n

For example, when a Handlebars template uses the {{action}} helper,\nit will attempt to send the action to the view's controller's target.

\n

By default, the value of the target property is set to the router, and\nis injected when a controller is instantiated. This injection is applied\nas part of the application's initialization process. In most cases the\ntarget property will automatically be set to the logical consumer of\nactions for the controller.

\n", + "itemtype": "property", + "name": "target", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/controller", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/controller/index.ts", + "line": 54, + "description": "

The controller's current model. When retrieving or modifying a controller's\nmodel, this property should be used instead of the content property.

\n", + "itemtype": "property", + "name": "model", + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/controller", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/controller/index.ts", + "line": 63, + "description": "

Defines which query parameters the controller accepts.\nIf you give the names ['category','page'] it will bind\nthe values of these query parameters to the variables\nthis.category and this.page.

\n

By default, query parameters are parsed as strings. This\nmay cause unexpected behavior if a query parameter is used with toggleProperty,\nbecause the initial value set for param=false will be the string "false", which is truthy.

\n

To avoid this, you may specify that the query parameter should be parsed as a boolean\nby using the following verbose form with a type property:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
  queryParams: [{\n    category: {\n      type: 'boolean'\n    }\n  }]
\n
\n
\n \n

Available values for the type parameter are 'boolean', 'number', 'array', and 'string'.\nIf query param type is not specified, it will default to 'string'.

\n", + "itemtype": "property", + "name": "queryParams", + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/controller", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ControllerMixin" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 356, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 430, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 505, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 523, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 27, + "description": "

The collection of functions, keyed by name, available on this\nActionHandler as action targets.

\n

These functions will be invoked when a matching {{action}} is triggered\nfrom within a template and the application's current route is this route.

\n

Actions can also be invoked from other parts of your application\nvia ActionHandler#send.

\n

The actions hash will inherit action handlers from\nthe actions hash defined on extended parent classes\nor mixins rather than just replace the entire hash, e.g.:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
banner.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/object/mixin';\n\nexport default Mixin.create({\n  actions: {\n    displayBanner(msg) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport CanDisplayBanner from '../mixins/can-display-banner';\n\nexport default Route.extend(CanDisplayBanner, {\n  actions: {\n    playMusic() {\n      // ...\n    }\n  }\n});\n\n// `WelcomeRoute`, when active, will be able to respond\n// to both actions, since the actions hash is merged rather\n// then replaced when extending mixins / parent classes.\nthis.send('displayBanner');\nthis.send('playMusic');
\n
\n
\n \n

Within a Controller, Route or Component's action handler,\nthe value of the this context is the Controller, Route or\nComponent object:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    myAction() {\n      this.controllerFor("song");\n      this.transitionTo("other.route");\n      ...\n    }\n  }\n});
\n
\n
\n \n

It is also possible to call this._super(...arguments) from within an\naction handler if it overrides a handler defined on a parent\nclass or mixin:

\n

Take for example the following routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
route.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/object/mixin';\n\nexport default Mixin.create({\n  actions: {\n    debugRouteInformation() {\n      console.debug("It's a-me, console.debug!");\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
debug.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Route from '@ember/routing/route';\nimport DebugRoute from '../mixins/debug-route';\n\nexport default Route.extend(DebugRoute, {\n  actions: {\n    debugRouteInformation() {\n      // also call the debugRouteInformation of mixed in DebugRoute\n      this._super(...arguments);\n\n      // show additional annoyance\n      window.alert(...);\n    }\n  }\n});
\n
\n
\n \n

Bubbling

\n

By default, an action will stop bubbling once a handler defined\non the actions hash handles it. To continue bubbling the action,\nyou must return true from the handler:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("album", function() {\n    this.route("song");\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/album.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying: function() {\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying() {\n      // ...\n\n      if (actionShouldAlsoBeTriggeredOnParentRoute) {\n        return true;\n      }\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "actions", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.Controller", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-5.3.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/controller", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.ControllerMixin.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.ControllerMixin.json new file mode 100644 index 000000000..785d2ff72 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.ControllerMixin.json @@ -0,0 +1,228 @@ +{ + "data": { + "id": "ember-5.3.0-Ember.ControllerMixin", + "type": "class", + "attributes": { + "name": "Ember.ControllerMixin", + "shortname": "Ember.ControllerMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Ember.Controller" + ], + "module": "@ember/controller", + "namespace": "Ember", + "file": "packages/@ember/controller/index.ts", + "line": 24, + "uses": [ + "Ember.ActionHandler" + ], + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/controller/index.ts", + "line": 91, + "description": "

Transition the application into another route. The route may\nbe either a single route or route path:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.transitionToRoute('blogPosts');\naController.transitionToRoute('blogPosts.recentEntries');
\n
\n
\n \n

Optionally supply a model for the route in question. The model\nwill be serialized into the URL using the serialize hook of\nthe route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.transitionToRoute('blogPost', aPost);
\n
\n
\n \n

If a literal is passed (such as a number or a string), it will\nbe treated as an identifier instead. In this case, the model\nhook of the route will be triggered:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.transitionToRoute('blogPost', 1);
\n
\n
\n \n

Multiple models will be applied last to first recursively up the\nroute tree.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route('blogPost', { path: ':blogPostId' }, function() {\n    this.route('blogComment', { path: ':blogCommentId', resetNamespace: true });\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.transitionToRoute('blogComment', aPost, aComment);\naController.transitionToRoute('blogComment', 1, 13);
\n
\n
\n \n

It is also possible to pass a URL (a string that starts with a\n/).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
aController.transitionToRoute('/');\naController.transitionToRoute('/blog/post/1/comment/13');\naController.transitionToRoute('/blog/posts?sort=title');
\n
\n
\n \n

An options hash with a queryParams property may be provided as\nthe final argument to add query parameters to the destination URL.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
aController.transitionToRoute('blogPost', 1, {\n  queryParams: { showComments: 'true' }\n});\n\n// if you just want to transition the query parameters without changing the route\naController.transitionToRoute({ queryParams: { sort: 'date' } });
\n
\n
\n \n

See also replaceRoute.

\n", + "itemtype": "method", + "name": "transitionToRoute", + "deprecated": true, + "deprecationMessage": "Use transitionTo from the Router service instead.", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used\n while transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "@ember/controller", + "namespace": "Ember" + }, + { + "file": "packages/@ember/controller/index.ts", + "line": 169, + "description": "

Transition into another route while replacing the current URL, if possible.\nThis will replace the current history entry instead of adding a new one.\nBeside that, it is identical to transitionToRoute in all other respects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('blogPosts');\naController.replaceRoute('blogPosts.recentEntries');
\n
\n
\n \n

Optionally supply a model for the route in question. The model\nwill be serialized into the URL using the serialize hook of\nthe route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.replaceRoute('blogPost', aPost);
\n
\n
\n \n

If a literal is passed (such as a number or a string), it will\nbe treated as an identifier instead. In this case, the model\nhook of the route will be triggered:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
aController.replaceRoute('blogPost', 1);
\n
\n
\n \n

Multiple models will be applied last to first recursively up the\nroute tree.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route('blogPost', { path: ':blogPostId' }, function() {\n    this.route('blogComment', { path: ':blogCommentId', resetNamespace: true });\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('blogComment', aPost, aComment);\naController.replaceRoute('blogComment', 1, 13);
\n
\n
\n

It is also possible to pass a URL (a string that starts with a\n/).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
aController.replaceRoute('/');\naController.replaceRoute('/blog/post/1/comment/13');
\n
\n
\n \n", + "itemtype": "method", + "name": "replaceRoute", + "deprecated": true, + "deprecationMessage": "Use replaceWith from the Router service instead.", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used\nwhile transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\ncontaining a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "@ember/controller", + "namespace": "Ember" + }, + { + "file": "packages/@ember/controller/index.ts", + "line": 264, + "description": "

This property is updated to various different callback functions depending on\nthe current "state" of the backing route. It is used by\nController.prototype._qpChanged.

\n

The methods backing each state can be found in the Route.prototype._qp computed\nproperty return value (the .states property). The current values are listed here for\nthe sanity of future travelers:

\n
    \n
  • inactive - This state is used when this controller instance is not part of the active\nroute hierarchy. Set in Route.prototype._reset (a router.js microlib hook) and\nRoute.prototype.actions.finalizeQueryParamChange.
  • \n
  • active - This state is used when this controller instance is part of the active\nroute hierarchy. Set in Route.prototype.actions.finalizeQueryParamChange.
  • \n
  • allowOverrides - This state is used in Route.prototype.setup (route.js microlib hook).
  • \n
\n", + "itemtype": "method", + "name": "_qpDelegate", + "access": "private", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "@ember/controller", + "namespace": "Ember" + }, + { + "file": "packages/@ember/controller/index.ts", + "line": 285, + "description": "

During Route#setup observers are created to invoke this method\nwhen any of the query params declared in Controller#queryParams property\nare changed.

\n

When invoked this method uses the currently active query param update delegate\n(see Controller.prototype._qpDelegate for details) and invokes it with\nthe QP key/value being changed.

\n", + "itemtype": "method", + "name": "_qpChanged", + "access": "private", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "@ember/controller", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 172, + "description": "

Triggers a named action on the ActionHandler. Any parameters\nsupplied after the actionName string will be passed as arguments\nto the action target function.

\n

If the ActionHandler has its target property set, actions may\nbubble to the target. Bubbling happens when an actionName can\nnot be found in the ActionHandler's actions hash or if the\naction target function returns true.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    playTheme() {\n      this.send('playMusic', 'theme.mp3');\n    },\n    playMusic(track) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "actionName", + "description": "The action to trigger", + "type": "String" + }, + { + "name": "context", + "description": "a context to send with the action", + "type": "*" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/controller/index.ts", + "line": 36, + "description": "

The object to which actions from the view should be sent.

\n

For example, when a Handlebars template uses the {{action}} helper,\nit will attempt to send the action to the view's controller's target.

\n

By default, the value of the target property is set to the router, and\nis injected when a controller is instantiated. This injection is applied\nas part of the application's initialization process. In most cases the\ntarget property will automatically be set to the logical consumer of\nactions for the controller.

\n", + "itemtype": "property", + "name": "target", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "@ember/controller", + "namespace": "Ember" + }, + { + "file": "packages/@ember/controller/index.ts", + "line": 54, + "description": "

The controller's current model. When retrieving or modifying a controller's\nmodel, this property should be used instead of the content property.

\n", + "itemtype": "property", + "name": "model", + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "@ember/controller", + "namespace": "Ember" + }, + { + "file": "packages/@ember/controller/index.ts", + "line": 63, + "description": "

Defines which query parameters the controller accepts.\nIf you give the names ['category','page'] it will bind\nthe values of these query parameters to the variables\nthis.category and this.page.

\n

By default, query parameters are parsed as strings. This\nmay cause unexpected behavior if a query parameter is used with toggleProperty,\nbecause the initial value set for param=false will be the string "false", which is truthy.

\n

To avoid this, you may specify that the query parameter should be parsed as a boolean\nby using the following verbose form with a type property:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
  queryParams: [{\n    category: {\n      type: 'boolean'\n    }\n  }]
\n
\n
\n \n

Available values for the type parameter are 'boolean', 'number', 'array', and 'string'.\nIf query param type is not specified, it will default to 'string'.

\n", + "itemtype": "property", + "name": "queryParams", + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "@ember/controller", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 27, + "description": "

The collection of functions, keyed by name, available on this\nActionHandler as action targets.

\n

These functions will be invoked when a matching {{action}} is triggered\nfrom within a template and the application's current route is this route.

\n

Actions can also be invoked from other parts of your application\nvia ActionHandler#send.

\n

The actions hash will inherit action handlers from\nthe actions hash defined on extended parent classes\nor mixins rather than just replace the entire hash, e.g.:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
banner.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/object/mixin';\n\nexport default Mixin.create({\n  actions: {\n    displayBanner(msg) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport CanDisplayBanner from '../mixins/can-display-banner';\n\nexport default Route.extend(CanDisplayBanner, {\n  actions: {\n    playMusic() {\n      // ...\n    }\n  }\n});\n\n// `WelcomeRoute`, when active, will be able to respond\n// to both actions, since the actions hash is merged rather\n// then replaced when extending mixins / parent classes.\nthis.send('displayBanner');\nthis.send('playMusic');
\n
\n
\n \n

Within a Controller, Route or Component's action handler,\nthe value of the this context is the Controller, Route or\nComponent object:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    myAction() {\n      this.controllerFor("song");\n      this.transitionTo("other.route");\n      ...\n    }\n  }\n});
\n
\n
\n \n

It is also possible to call this._super(...arguments) from within an\naction handler if it overrides a handler defined on a parent\nclass or mixin:

\n

Take for example the following routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
route.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/object/mixin';\n\nexport default Mixin.create({\n  actions: {\n    debugRouteInformation() {\n      console.debug("It's a-me, console.debug!");\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
debug.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Route from '@ember/routing/route';\nimport DebugRoute from '../mixins/debug-route';\n\nexport default Route.extend(DebugRoute, {\n  actions: {\n    debugRouteInformation() {\n      // also call the debugRouteInformation of mixed in DebugRoute\n      this._super(...arguments);\n\n      // show additional annoyance\n      window.alert(...);\n    }\n  }\n});
\n
\n
\n \n

Bubbling

\n

By default, an action will stop bubbling once a handler defined\non the actions hash handles it. To continue bubbling the action,\nyou must return true from the handler:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("album", function() {\n    this.route("song");\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/album.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying: function() {\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying() {\n      // ...\n\n      if (actionShouldAlsoBeTriggeredOnParentRoute) {\n        return true;\n      }\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "actions", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.ControllerMixin", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/controller", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.CoreView.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.CoreView.json new file mode 100644 index 000000000..2649846a6 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.CoreView.json @@ -0,0 +1,933 @@ +{ + "data": { + "id": "ember-5.3.0-Ember.CoreView", + "type": "class", + "attributes": { + "name": "Ember.CoreView", + "shortname": "Ember.CoreView", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/views/lib/views/core_view.ts", + "line": 9, + "description": "

Ember.CoreView is an abstract class that exists to give view-like behavior\nto both Ember's main view class Component and other classes that don't need\nthe full functionality of Component.

\n

Unless you have specific needs for CoreView, you will use Component\nin your applications.

\n", + "extends": "EmberObject", + "deprecated": true, + "deprecationMessage": "Use `Component` instead.", + "uses": [ + "Evented", + "Ember.ActionHandler" + ], + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 35, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getRootViews", + "params": [ + { + "name": "owner", + "description": "", + "type": "Object" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 57, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewId", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 77, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewElement", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 109, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getChildViews", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 152, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewBounds", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 161, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewRange", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 176, + "description": "

getViewClientRects provides information about the position of the border\nbox edges of a view relative to the viewport.

\n

It is only intended to be used by development tools like the Ember Inspector\nand may not work on older browsers.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewClientRects", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 192, + "description": "

getViewBoundingClientRect provides information about the position of the\nbounding border box edges of a view relative to the viewport.

\n

It is only intended to be used by development tools like the Ember Inspector\nand may not work on older browsers.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getViewBoundingClientRect", + "params": [ + { + "name": "view", + "description": "", + "type": "Ember.View" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/utils.ts", + "line": 208, + "description": "

Determines if the element matches the specified selector.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "matches", + "params": [ + { + "name": "el", + "description": "", + "type": "DOMElement" + }, + { + "name": "selector", + "description": "", + "type": "String" + } + ], + "class": "Ember.CoreView", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/views/core_view.ts", + "line": 77, + "description": "

Override the default event firing from Evented to\nalso call methods with the given name.

\n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Ember.CoreView", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 51, + "description": "

Subscribes to a named event with given function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
person.on('didLoad', function() {\n  // fired once the person has loaded\n});
\n
\n
\n \n

An optional target can be passed in as the 2nd argument that will\nbe set as the "this" for the callback. This is a good way to give your\nfunction access to the object triggering the event. When the target\nparameter is used the callback method becomes the third argument.

\n", + "itemtype": "method", + "name": "on", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 78, + "description": "

Subscribes a function to a named event and then cancels the subscription\nafter the first time the event is triggered. It is good to use one when\nyou only care about the first time an event has taken place.

\n

This function takes an optional 2nd argument that will become the "this"\nvalue for the callback. When the target parameter is used the callback method\nbecomes the third argument.

\n", + "itemtype": "method", + "name": "one", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 100, + "description": "

Triggers a named event for the object. Any additional arguments\nwill be passed as parameters to the functions that are subscribed to the\nevent.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
person.on('didEat', function(food) {\n  console.log('person ate some ' + food);\n});\n\nperson.trigger('didEat', 'broccoli');\n\n// outputs: person ate some broccoli
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "args", + "description": "Optional arguments to pass on", + "type": "Object..." + } + ], + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 121, + "description": "

Cancels subscription for given name, target, and method.

\n", + "itemtype": "method", + "name": "off", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The target of the subscription", + "type": "Object" + }, + { + "name": "method", + "description": "The function or the name of a function of the subscription", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 137, + "description": "

Checks to see if object has any subscriptions for named event.

\n", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + } + ], + "return": { + "description": "does the object have a subscription for event", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 172, + "description": "

Triggers a named action on the ActionHandler. Any parameters\nsupplied after the actionName string will be passed as arguments\nto the action target function.

\n

If the ActionHandler has its target property set, actions may\nbubble to the target. Bubbling happens when an actionName can\nnot be found in the ActionHandler's actions hash or if the\naction target function returns true.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    playTheme() {\n      this.send('playMusic', 'theme.mp3');\n    },\n    playMusic(track) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "actionName", + "description": "The action to trigger", + "type": "String" + }, + { + "name": "context", + "description": "a context to send with the action", + "type": "*" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 322, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 541, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 568, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 576, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 164, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 212, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 229, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 247, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 333, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 354, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 371, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 388, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 403, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 433, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 453, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 497, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/views/lib/views/core_view.ts", + "line": 38, + "description": "

If the view is currently inserted into the DOM of a parent view, this\nproperty will point to the parent of the view.

\n", + "itemtype": "property", + "name": "parentView", + "type": "Ember.View", + "default": "null", + "access": "private", + "tagname": "", + "class": "Ember.CoreView", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 27, + "description": "

The collection of functions, keyed by name, available on this\nActionHandler as action targets.

\n

These functions will be invoked when a matching {{action}} is triggered\nfrom within a template and the application's current route is this route.

\n

Actions can also be invoked from other parts of your application\nvia ActionHandler#send.

\n

The actions hash will inherit action handlers from\nthe actions hash defined on extended parent classes\nor mixins rather than just replace the entire hash, e.g.:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
banner.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/object/mixin';\n\nexport default Mixin.create({\n  actions: {\n    displayBanner(msg) {\n      // ...\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/welcome.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport CanDisplayBanner from '../mixins/can-display-banner';\n\nexport default Route.extend(CanDisplayBanner, {\n  actions: {\n    playMusic() {\n      // ...\n    }\n  }\n});\n\n// `WelcomeRoute`, when active, will be able to respond\n// to both actions, since the actions hash is merged rather\n// then replaced when extending mixins / parent classes.\nthis.send('displayBanner');\nthis.send('playMusic');
\n
\n
\n \n

Within a Controller, Route or Component's action handler,\nthe value of the this context is the Controller, Route or\nComponent object:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    myAction() {\n      this.controllerFor("song");\n      this.transitionTo("other.route");\n      ...\n    }\n  }\n});
\n
\n
\n \n

It is also possible to call this._super(...arguments) from within an\naction handler if it overrides a handler defined on a parent\nclass or mixin:

\n

Take for example the following routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
route.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/object/mixin';\n\nexport default Mixin.create({\n  actions: {\n    debugRouteInformation() {\n      console.debug("It's a-me, console.debug!");\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
debug.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Route from '@ember/routing/route';\nimport DebugRoute from '../mixins/debug-route';\n\nexport default Route.extend(DebugRoute, {\n  actions: {\n    debugRouteInformation() {\n      // also call the debugRouteInformation of mixed in DebugRoute\n      this._super(...arguments);\n\n      // show additional annoyance\n      window.alert(...);\n    }\n  }\n});
\n
\n
\n \n

Bubbling

\n

By default, an action will stop bubbling once a handler defined\non the actions hash handles it. To continue bubbling the action,\nyou must return true from the handler:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("album", function() {\n    this.route("song");\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/album.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying: function() {\n    }\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
song.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default Route.extend({\n  actions: {\n    startPlaying() {\n      // ...\n\n      if (actionShouldAlsoBeTriggeredOnParentRoute) {\n        return true;\n      }\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "actions", + "type": "Object", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ActionHandler" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 356, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 430, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 505, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 523, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Ember.CoreView", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-5.3.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-5.3.0-Component" + } + ] + }, + "module": { + "data": { + "id": "ember-5.3.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.EventDispatcher.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.EventDispatcher.json new file mode 100644 index 000000000..970b92138 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.EventDispatcher.json @@ -0,0 +1,659 @@ +{ + "data": { + "id": "ember-5.3.0-Ember.EventDispatcher", + "type": "class", + "attributes": { + "name": "Ember.EventDispatcher", + "shortname": "Ember.EventDispatcher", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.ts", + "line": 18, + "description": "

Ember.EventDispatcher handles delegating browser events to their\ncorresponding Ember.Views. For example, when you click on a view,\nEmber.EventDispatcher ensures that that view's mouseDown method gets\ncalled.

\n", + "access": "private", + "tagname": "", + "extends": "EmberObject", + "methods": [ + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.ts", + "line": 113, + "description": "

Sets up event listeners for standard browser events.

\n

This will be called after the browser sends a DOMContentReady event. By\ndefault, it will set up all of the listeners on the document body. If you\nwould like to register the listeners on a different element, set the event\ndispatcher's root property.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setup", + "params": [ + { + "name": "addedEvents", + "description": "", + "type": "Object" + } + ], + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.ts", + "line": 207, + "description": "

Setup event listeners for the given browser event name

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupHandlerForBrowserEvent", + "params": [ + { + "name": "event", + "description": "the name of the event in the browser" + } + ], + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.ts", + "line": 220, + "description": "

Setup event listeners for the given Ember event name (camel case)

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupHandlerForEmberEvent", + "params": [ + { + "name": "eventName", + "description": "" + } + ], + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.ts", + "line": 237, + "description": "

Registers an event listener on the rootElement. If the given event is\ntriggered, the provided event handler will be triggered on the target view.

\n

If the target view does not implement the event handler, or if the handler\nreturns false, the parent view will be called. The event will continue to\nbubble to each successive parent view until it reaches the top.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupHandler", + "params": [ + { + "name": "rootElement", + "description": "", + "type": "Element" + }, + { + "name": "event", + "description": "the name of the event in the browser", + "type": "String" + }, + { + "name": "eventName", + "description": "the name of the method to call on the view", + "type": "String" + } + ], + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 322, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 541, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 568, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 576, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 164, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 212, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 229, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 247, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 333, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 354, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 371, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 388, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 403, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 433, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 453, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 497, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/views/lib/system/action_manager.ts", + "line": 9, + "description": "

Global action id hash.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "registeredActions", + "type": "Object", + "class": "Ember.EventDispatcher", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.ts", + "line": 30, + "description": "

The set of events names (and associated handler function names) to be setup\nand dispatched by the EventDispatcher. Modifications to this list can be done\nat setup time, generally via the Application.customEvents hash.

\n

To add new events to be listened to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\n\nlet App = Application.create({\n  customEvents: {\n    paste: 'paste'\n  }\n});
\n
\n
\n \n

To prevent default events from being listened to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
import Application from '@ember/application';\n\nlet App = Application.create({\n  customEvents: {\n    mouseenter: null,\n    mouseleave: null\n  }\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "events", + "type": "Object", + "access": "private", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.ts", + "line": 90, + "description": "

The root DOM element to which event listeners should be attached. Event\nlisteners will be attached to the document unless this is overridden.

\n

Can be specified as a DOMElement or a selector string.

\n

The default body is a string since this may be evaluated before document.body\nexists in the DOM.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "rootElement", + "type": "DOMElement", + "default": "'body'", + "class": "Ember.EventDispatcher", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 356, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 430, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 505, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 523, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Ember.EventDispatcher", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-5.3.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.InjectedProperty.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.InjectedProperty.json new file mode 100644 index 000000000..7f4875eef --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.InjectedProperty.json @@ -0,0 +1,58 @@ +{ + "data": { + "id": "ember-5.3.0-Ember.InjectedProperty", + "type": "class", + "attributes": { + "name": "Ember.InjectedProperty", + "shortname": "Ember.InjectedProperty", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/metal/lib/injected_property.ts", + "line": 20, + "description": "

Read-only property that returns the result of a container lookup.

\n", + "is_constructor": 1, + "params": [ + { + "name": "type", + "description": "The container type the property will lookup", + "type": "String" + }, + { + "name": "nameOrDesc", + "description": "(optional) The name the property will lookup, defaults\n to the property's name", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "methods": [], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.MutableEnumerable.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.MutableEnumerable.json new file mode 100644 index 000000000..170fe8019 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.MutableEnumerable.json @@ -0,0 +1,48 @@ +{ + "data": { + "id": "ember-5.3.0-Ember.MutableEnumerable", + "type": "class", + "attributes": { + "name": "Ember.MutableEnumerable", + "shortname": "Ember.MutableEnumerable", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/enumerable/mutable.ts", + "line": 8, + "description": "

The methods in this mixin have been moved to MutableArray. This mixin has\nbeen intentionally preserved to avoid breaking MutableEnumerable.detect\nchecks until the community migrates away from them.

\n", + "uses": [ + "Enumerable" + ], + "access": "private", + "tagname": "", + "methods": [], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.NativeArray.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.NativeArray.json new file mode 100644 index 000000000..1a30c0825 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.NativeArray.json @@ -0,0 +1,1636 @@ +{ + "data": { + "id": "ember-5.3.0-Ember.NativeArray", + "type": "class", + "attributes": { + "name": "Ember.NativeArray", + "shortname": "Ember.NativeArray", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "", + "file": "packages/@ember/array/index.ts", + "line": 2062, + "description": "

The NativeArray mixin contains the properties needed to make the native\nArray support MutableArray and all of its dependent APIs. Unless you\nhave EmberENV.EXTEND_PROTOTYPES or EmberENV.EXTEND_PROTOTYPES.Array set to\nfalse, this will be applied automatically. Otherwise you can apply the mixin\nat anytime by calling Ember.NativeArray.apply(Array.prototype).

\n", + "uses": [ + "Observable", + "MutableArray" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 164, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 212, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 229, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 247, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 333, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 354, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 371, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 388, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 403, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 433, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 453, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 497, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1484, + "description": "

Required. You must implement this method to apply this mixin.

\n

This is one of the primitives you must implement to support Array.\nYou should replace amt objects started at idx with the objects in the\npassed array.

\n

Note that this method is expected to validate the type(s) of objects that it expects.

\n", + "itemtype": "method", + "name": "replace", + "params": [ + { + "name": "idx", + "description": "Starting index in the array to replace. If\n idx >= length, then append to the end of the array.", + "type": "Number" + }, + { + "name": "amt", + "description": "Number of elements that should be removed from\n the array, starting at *idx*.", + "type": "Number" + }, + { + "name": "objects", + "description": "An optional array of zero or more objects that should be\n inserted into the array at *idx*", + "type": "EmberArray", + "optional": true + } + ], + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1503, + "description": "

Remove all elements from the array. This is useful if you\nwant to reuse an existing array without having to recreate it.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue'];\n\ncolors.length;  // 3\ncolors.clear(); // []\ncolors.length;  // 0
\n
\n
\n \n", + "itemtype": "method", + "name": "clear", + "return": { + "description": "An empty Array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1520, + "description": "

This will use the primitive replace() method to insert an object at the\nspecified index.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.insertAt(2, 'yellow');  // ['red', 'green', 'yellow', 'blue']\ncolors.insertAt(5, 'orange');  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "insertAt", + "params": [ + { + "name": "idx", + "description": "index of insert the object at.", + "type": "Number" + }, + { + "name": "object", + "description": "object to insert", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1538, + "description": "

Remove an object at the specified index using the replace() primitive\nmethod. You can pass either a single index, or a start and a length.

\n

If you pass a start and length that is beyond the\nlength this method will throw an assertion.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue', 'yellow', 'orange'];\n\ncolors.removeAt(0);     // ['green', 'blue', 'yellow', 'orange']\ncolors.removeAt(2, 2);  // ['green', 'blue']\ncolors.removeAt(4, 2);  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "removeAt", + "params": [ + { + "name": "start", + "description": "index, start of range", + "type": "Number" + }, + { + "name": "len", + "description": "length of passing range", + "type": "Number" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1560, + "description": "

Push the object onto the end of the array. Works just like push() but it\nis KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green'];\n\ncolors.pushObject('black');     // ['red', 'green', 'black']\ncolors.pushObject(['yellow']);  // ['red', 'green', ['yellow']]
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObject", + "params": [ + { + "name": "obj", + "description": "object to push", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1577, + "description": "

Add the objects in the passed array to the end of the array. Defers\nnotifying observers of the change until all objects are added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
let colors = ['red'];\n\ncolors.pushObjects(['yellow', 'orange']);  // ['red', 'yellow', 'orange']
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "Array" + } + ], + "return": { + "description": "receiver", + "type": "MutableArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1593, + "description": "

Pop object from array or nil if none are left. Works just like pop() but\nit is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.popObject();   // 'blue'\nconsole.log(colors);  // ['red', 'green']
\n
\n
\n \n", + "itemtype": "method", + "name": "popObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1609, + "description": "

Shift an object from start of array or nil if none are left. Works just\nlike shift() but it is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.shiftObject();  // 'red'\nconsole.log(colors);   // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "shiftObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1625, + "description": "

Unshift an object to start of array. Works just like unshift() but it is\nKVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObject('yellow');    // ['yellow', 'red']\ncolors.unshiftObject(['black']);   // [['black'], 'yellow', 'red']
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObject", + "params": [ + { + "name": "obj", + "description": "object to unshift", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1642, + "description": "

Adds the named objects to the beginning of the array. Defers notifying\nobservers until all objects have been added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObjects(['black', 'white']);   // ['black', 'white', 'red']\ncolors.unshiftObjects('yellow'); // Type Error: 'undefined' is not a function
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "Enumerable" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1659, + "description": "

Reverse objects in the array. Works just like reverse() but it is\nKVO-compliant.

\n", + "itemtype": "method", + "name": "reverseObjects", + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1668, + "description": "

Replace all the receiver's content with content of the argument.\nIf argument is an empty array receiver will be cleared.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.setObjects(['black', 'white']);  // ['black', 'white']\ncolors.setObjects([]);                  // []
\n
\n
\n \n", + "itemtype": "method", + "name": "setObjects", + "params": [ + { + "name": "objects", + "description": "array whose content will be used for replacing\n the content of the receiver", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver with the new content", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1686, + "description": "

Remove all occurrences of an object in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let cities = ['Chicago', 'Berlin', 'Lima', 'Chicago'];\n\ncities.removeObject('Chicago');  // ['Berlin', 'Lima']\ncities.removeObject('Lima');     // ['Berlin']\ncities.removeObject('Tokyo')     // ['Berlin']
\n
\n
\n \n", + "itemtype": "method", + "name": "removeObject", + "params": [ + { + "name": "obj", + "description": "object to remove", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1703, + "description": "

Removes each object in the passed array from the receiver.

\n", + "itemtype": "method", + "name": "removeObjects", + "params": [ + { + "name": "objects", + "description": "the objects to remove", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1712, + "description": "

Push the object onto the end of the array if it is not already\npresent in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let cities = ['Chicago', 'Berlin'];\n\ncities.addObject('Lima');    // ['Chicago', 'Berlin', 'Lima']\ncities.addObject('Berlin');  // ['Chicago', 'Berlin', 'Lima']
\n
\n
\n \n", + "itemtype": "method", + "name": "addObject", + "params": [ + { + "name": "obj", + "description": "object to add, if not already present", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1729, + "description": "

Adds each object in the passed array to the receiver.

\n", + "itemtype": "method", + "name": "addObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add.", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "MutableArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 263, + "description": "

Returns the object at the given index. If the given index is negative\nor is greater or equal than the array length, returns undefined.

\n

This is one of the primitives you must implement to support EmberArray.\nIf your object supports retrieving the value of an array item using get()\n(i.e. myArray.get(0)), then you do not need to implement this method\nyourself.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectAt(0);   // 'a'\narr.objectAt(3);   // 'd'\narr.objectAt(-1);  // undefined\narr.objectAt(4);   // undefined\narr.objectAt(5);   // undefined
\n
\n
\n \n", + "itemtype": "method", + "name": "objectAt", + "params": [ + { + "name": "idx", + "description": "The index of the item to return.", + "type": "Number" + } + ], + "return": { + "description": "item at index or undefined", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 288, + "description": "

This returns the objects at the specified indexes, using objectAt.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectsAt([0, 1, 2]);  // ['a', 'b', 'c']\narr.objectsAt([2, 3, 4]);  // ['c', 'd', undefined]
\n
\n
\n \n", + "itemtype": "method", + "name": "objectsAt", + "params": [ + { + "name": "indexes", + "description": "An array of indexes of items to return.", + "type": "Array" + } + ], + "return": { + "description": "", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 354, + "description": "

Returns a new array that is a slice of the receiver. This implementation\nuses the observable array methods to retrieve the objects for the new\nslice.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = ['red', 'green', 'blue'];\n\narr.slice(0);       // ['red', 'green', 'blue']\narr.slice(0, 2);    // ['red', 'green']\narr.slice(1, 100);  // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "slice", + "params": [ + { + "name": "beginIndex", + "description": "(Optional) index to begin slicing from.", + "type": "Number" + }, + { + "name": "endIndex", + "description": "(Optional) index to end the slice at (but not included).", + "type": "Number" + } + ], + "return": { + "description": "New array with specified slice", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 374, + "description": "

Used to determine the passed object's first occurrence in the array.\nReturns the index if found, -1 if no match is found.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.indexOf('a');       //  0\narr.indexOf('z');       // -1\narr.indexOf('a', 2);    //  4\narr.indexOf('a', -1);   //  4, equivalent to indexOf('a', 4)\narr.indexOf('a', -100); //  0, searches entire array\narr.indexOf('b', 3);    // -1\narr.indexOf('a', 100);  // -1\n\nlet people = [{ name: 'Zoey' }, { name: 'Bob' }]\nlet newPerson = { name: 'Tom' };\npeople = [newPerson, ...people, newPerson];\n\npeople.indexOf(newPerson);     //  0\npeople.indexOf(newPerson, 1);  //  3\npeople.indexOf(newPerson, -4); //  0\npeople.indexOf(newPerson, 10); // -1
\n
\n
\n \n", + "itemtype": "method", + "name": "indexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "index or -1 if not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 412, + "description": "

Returns the index of the given object's last occurrence.

\n
    \n
  • If no startAt argument is given, the search starts from\nthe last position.
  • \n
  • If it's greater than or equal to the length of the array,\nthe search starts from the last position.
  • \n
  • If it's negative, it is taken as the offset from the end\nof the array i.e. startAt + array.length.
  • \n
  • If it's any other positive number, will search backwards\nfrom that index of the array.
  • \n
\n

Returns -1 if no match is found.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.lastIndexOf('a');       //  4\narr.lastIndexOf('z');       // -1\narr.lastIndexOf('a', 2);    //  0\narr.lastIndexOf('a', -1);   //  4\narr.lastIndexOf('a', -3);   //  0\narr.lastIndexOf('b', 3);    //  1\narr.lastIndexOf('a', 100);  //  4
\n
\n
\n \n", + "itemtype": "method", + "name": "lastIndexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search from\nbackwards, defaults to `(array.length - 1)`", + "type": "Number" + } + ], + "return": { + "description": "The last index of the `object` in the array or -1\nif not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 447, + "description": "

Iterates through the array, calling the passed function on each\nitem. This method corresponds to the forEach() method defined in\nJavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
let foods = [\n  { name: 'apple', eaten: false },\n  { name: 'banana', eaten: false },\n  { name: 'carrot', eaten: false }\n];\n\nfoods.forEach((food) => food.eaten = true);\n\nlet output = '';\nfoods.forEach((item, index, array) =>\n  output += `${index + 1}/${array.length} ${item.name}\\n`;\n);\nconsole.log(output);\n// 1/3 apple\n// 2/3 banana\n// 3/3 carrot
\n
\n
\n \n", + "itemtype": "method", + "name": "forEach", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 498, + "description": "

Alias for mapBy.

\n

Returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.getEach('name');\n// ['Joe', 'Matt'];\n\npeople.getEach('nonexistentProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "getEach", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 520, + "description": "

Sets the value on the named property for each member. This is more\nergonomic than using other methods defined on this helper. If the object\nimplements Observable, the value will be changed to set(), otherwise\nit will be set directly. null objects are skipped.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.setEach('zipCode', '10011');\n// [{name: 'Joe', zipCode: '10011'}, {name: 'Matt', zipCode: '10011'}];
\n
\n
\n \n", + "itemtype": "method", + "name": "setEach", + "params": [ + { + "name": "key", + "description": "The key to set", + "type": "String" + }, + { + "name": "value", + "description": "The object to set", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 540, + "description": "

Maps all of the items in the enumeration to another value, returning\na new array. This method corresponds to map() defined in JavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
function(item, index, array);\nlet arr = [1, 2, 3, 4, 5, 6];\n\narr.map(element => element * element);\n// [1, 4, 9, 16, 25, 36];\n\narr.map((element, index) => element + index);\n// [1, 3, 5, 7, 9, 11];
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the mapped value.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n", + "itemtype": "method", + "name": "map", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 578, + "description": "

Similar to map, this specialized function returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.mapBy('name');\n// ['Joe', 'Matt'];\n\npeople.mapBy('unknownProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "mapBy", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 599, + "description": "

Returns a new array with all of the items in the enumeration that the provided\ncallback function returns true for. This method corresponds to Array.prototype.filter().

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All parameters are optional. The function should return true to include the item\nin the results, and false otherwise.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nlet people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n\npeople.filter(isAdult); // returns [{ name: 'Joan', age: 45 }];
\n
\n
\n \n

Note that in addition to a callback, you can pass an optional target object\nthat will be set as this on the context. This is a good way to give your\niterator function access to the current object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
function isAdultAndEngineer(person) {\n  return person.age > 18 && this.engineering;\n}\n\nclass AdultsCollection {\n  engineering = false;\n\n  constructor(opts = {}) {\n    super(...arguments);\n\n    this.engineering = opts.engineering;\n    this.people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n  }\n}\n\nlet collection = new AdultsCollection({ engineering: true });\ncollection.people.filter(isAdultAndEngineer, { target: collection });
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A filtered array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 662, + "description": "

Returns an array with all of the items in the enumeration where the passed\nfunction returns false. This method is the inverse of filter().

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration
  • \n
  • array is the array itself.
  • \n
\n

It should return a falsey value to include the item in the results.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as "this" on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\nconst nonFruits = food.reject(function(thing) {\n  return thing.isFruit;\n}); // [{food: 'bread', isFruit: false}]
\n
\n
\n \n", + "itemtype": "method", + "name": "reject", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A rejected array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 706, + "description": "

Filters the array by the property and an optional value. If a value is given, it returns\nthe items that have said value for the property. If not, it returns all the items that\nhave a truthy value for the property.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let things = Ember.A([{ food: 'apple', isFruit: true }, { food: 'beans', isFruit: false }]);\n\nthings.filterBy('food', 'beans'); // [{ food: 'beans', isFruit: false }]\nthings.filterBy('isFruit'); // [{ food: 'apple', isFruit: true }]
\n
\n
\n \n", + "itemtype": "method", + "name": "filterBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "filtered array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 727, + "description": "

Returns an array with the items that do not have truthy values for the provided key.\nYou can pass an optional second argument with a target value to reject for the key.\nOtherwise this will reject objects where the provided property evaluates to false.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
  let food = [\n    { name: "apple", isFruit: true },\n    { name: "carrot", isFruit: false },\n    { name: "bread", isFruit: false },\n  ];\n  food.rejectBy('isFruit'); // [{ name: "carrot", isFruit: false }, { name: "bread", isFruit: false }]\n  food.rejectBy('name', 'carrot'); // [{ name: "apple", isFruit: true }}, { name: "bread", isFruit: false }]
\n
\n
\n \n", + "itemtype": "method", + "name": "rejectBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "rejected array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 751, + "description": "

Returns the first item in the array for which the callback returns true.\nThis method is similar to the find() method defined in ECMAScript 2015.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the true to include the item in the results, false\notherwise.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let users = [\n  { id: 1, name: 'Yehuda' },\n  { id: 2, name: 'Tom' },\n  { id: 3, name: 'Melanie' },\n  { id: 4, name: 'Leah' }\n];\n\nusers.find((user) => user.name == 'Tom'); // [{ id: 2, name: 'Tom' }]\nusers.find(({ id }) => id == 3); // [{ id: 3, name: 'Melanie' }]
\n
\n
\n \n", + "itemtype": "method", + "name": "find", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Found item or `undefined`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 801, + "description": "

Returns the first item with a property matching the passed value. You\ncan pass an optional second argument with the target value. Otherwise\nthis will match any property that evaluates to true.

\n

This method works much like the more generic find() method.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
let users = [\n  { id: 1, name: 'Yehuda', isTom: false },\n  { id: 2, name: 'Tom', isTom: true },\n  { id: 3, name: 'Melanie', isTom: false },\n  { id: 4, name: 'Leah', isTom: false }\n];\n\nusers.findBy('id', 4); // { id: 4, name: 'Leah', isTom: false }\nusers.findBy('name', 'Melanie'); // { id: 3, name: 'Melanie', isTom: false }\nusers.findBy('isTom'); // { id: 2, name: 'Tom', isTom: true }
\n
\n
\n \n", + "itemtype": "method", + "name": "findBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "found item or `undefined`", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 831, + "description": "

Returns true if the passed function returns true for every item in the\nenumeration. This corresponds with the Array.prototype.every() method defined in ES5.

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All params are optional. The method should return true or false.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nconst people = Ember.A([{ name: 'John', age: 24 }, { name: 'Joan', age: 45 }]);\nconst areAllAdults = people.every(isAdult);
\n
\n
\n \n", + "itemtype": "method", + "name": "every", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 872, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for all items in the array. This method is often simpler/faster\nthan using a callback.

\n

Note that like the native Array.every, isEvery will return true when called\non any empty array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
class Language {\n  constructor(name, isProgrammingLanguage) {\n    this.name = name;\n    this.programmingLanguage = isProgrammingLanguage;\n  }\n}\n\nconst compiledLanguages = [\n  new Language('Java', true),\n  new Language('Go', true),\n  new Language('Rust', true)\n]\n\nconst languagesKnownByMe = [\n  new Language('Javascript', true),\n  new Language('English', false),\n  new Language('Ruby', true)\n]\n\ncompiledLanguages.isEvery('programmingLanguage'); // true\nlanguagesKnownByMe.isEvery('programmingLanguage'); // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isEvery", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 912, + "description": "

The any() method executes the callback function once for each element\npresent in the array until it finds the one where callback returns a truthy\nvalue (i.e. true). If such an element is found, any() immediately returns\ntrue. Otherwise, any() returns false.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array object itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. It can be a good way\nto give your iterator function access to an object in cases where an ES6\narrow function would not be appropriate.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let includesManager = people.any(this.findPersonInManagersList, this);\n\nlet includesStockHolder = people.any(person => {\n  return this.findPersonInStockHoldersList(person)\n});\n\nif (includesManager || includesStockHolder) {\n  Paychecks.addBiggerBonus();\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "any", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "`true` if the passed function returns `true` for any item", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 955, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for any item in the array. This method is often simpler/faster\nthan using a callback.

\n

Example usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\n\nfood.isAny('isFruit'); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isAny", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 981, + "description": "

This will combine the values of the array into a single value. It\nis a useful way to collect a summary value from an array. This\ncorresponds to the reduce() method defined in JavaScript 1.8.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(previousValue, item, index, array);
\n
\n
\n \n
    \n
  • previousValue is the value returned by the last call to the iterator.
  • \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Return the new cumulative value.

\n

In addition to the callback you can also pass an initialValue. An error\nwill be raised if you do not pass an initial value and the enumerator is\nempty.

\n

Note that unlike the other methods, this method does not allow you to\npass a target object to set as this for the callback. It's part of the\nspec. Sorry.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
  let numbers = [1, 2, 3, 4, 5];\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }); // 15 (1 + 2 + 3 + 4 + 5)\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }, -15); // 0 (-15 + 1 + 2 + 3 + 4 + 5)\n\n\n  let binaryValues = [true, false, false];\n\n  binaryValues.reduce(function(truthValue, current) {\n    return truthValue && current;\n  }); // false (true && false && false)
\n
\n
\n \n", + "itemtype": "method", + "name": "reduce", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "initialValue", + "description": "Initial value for the reduce", + "type": "Object" + } + ], + "return": { + "description": "The reduced value.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1039, + "description": "

Invokes the named method on every object in the receiver that\nimplements it. This method corresponds to the implementation in\nPrototype 1.6.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
class Person {\n  name = null;\n\n  constructor(name) {\n    this.name = name;\n  }\n\n  greet(prefix='Hello') {\n    return `${prefix} ${this.name}`;\n  }\n}\n\nlet people = [new Person('Joe'), new Person('Matt')];\n\npeople.invoke('greet'); // ['Hello Joe', 'Hello Matt']\npeople.invoke('greet', 'Bonjour'); // ['Bonjour Joe', 'Bonjour Matt']
\n
\n
\n \n", + "itemtype": "method", + "name": "invoke", + "params": [ + { + "name": "methodName", + "description": "the name of the method", + "type": "String" + }, + { + "name": "args", + "description": "optional arguments to pass as well.", + "type": "Object..." + } + ], + "return": { + "description": "return values from calling invoke.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1073, + "description": "

Simply converts the object into a genuine array. The order is not\nguaranteed. Corresponds to the method implemented by Prototype.

\n", + "itemtype": "method", + "name": "toArray", + "return": { + "description": "the object as an array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1082, + "description": "

Returns a copy of the array with all null and undefined elements removed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', null, 'c', undefined];\narr.compact();  // ['a', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "compact", + "return": { + "description": "the array without null and undefined elements.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1095, + "description": "

Used to determine if the array contains the passed object.\nReturns true if found, false otherwise.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n

This method has the same behavior of JavaScript's Array.includes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
[1, 2, 3].includes(2);     // true\n[1, 2, 3].includes(4);     // false\n[1, 2, 3].includes(3, 2);  // true\n[1, 2, 3].includes(3, 3);  // false\n[1, 2, 3].includes(3, -1); // true\n[1, 2, 3].includes(1, -1); // false\n[1, 2, 3].includes(1, -4); // true\n[1, 2, NaN].includes(NaN); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "includes", + "params": [ + { + "name": "object", + "description": "The object to search for.", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "`true` if object is found in the array.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1125, + "description": "

Sorts the array by the keys specified in the argument.

\n

You may provide multiple arguments to sort by multiple properties.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
   let colors = [\n { name: 'red', weight: 500 },\n { name: 'green', weight: 600 },\n { name: 'blue', weight: 500 }\n];\n\n   colors.sortBy('name');\n   // [{name: 'blue', weight: 500}, {name: 'green', weight: 600}, {name: 'red', weight: 500}]\n\n   colors.sortBy('weight', 'name');\n   // [{name: 'blue', weight: 500}, {name: 'red', weight: 500}, {name: 'green', weight: 600}]
\n
\n
\n \n", + "itemtype": "method", + "name": "sortBy", + "params": [ + { + "name": "property", + "description": "name(s) to sort on", + "type": "String" + } + ], + "return": { + "description": "The sorted array.", + "type": "Array" + }, + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1150, + "description": "

Returns a new array that contains only unique values. The default\nimplementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'a', 'b', 'b'];\narr.uniq();  // ['a', 'b']
\n
\n
\n \n

This only works on primitive data types, e.g. Strings, Numbers, etc.

\n", + "itemtype": "method", + "name": "uniq", + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1166, + "description": "

Returns a new array that contains only items containing a unique property value.\nThe default implementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }];\narr.uniqBy('value');  // [{ value: 'a' }, { value: 'b' }]\n\nlet arr = [2.2, 2.1, 3.2, 3.3];\narr.uniqBy(Math.floor);  // [2.2, 3.2];
\n
\n
\n \n", + "itemtype": "method", + "name": "uniqBy", + "params": [ + { + "name": "key", + "description": "", + "type": "String,Function" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1185, + "description": "

Returns a new array that excludes the passed value. The default\nimplementation returns an array regardless of the receiver type.\nIf the receiver does not contain the value it returns the original array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'b', 'a', 'c'];\narr.without('a');  // ['b', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "without", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/array/index.ts", + "line": 253, + "description": "

Required. You must implement this method to apply this mixin.

\n

Your array must support the length property. Your replace methods should\nset this property whenever it changes.

\n", + "itemtype": "property", + "name": "length", + "type": "Number", + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 304, + "description": "

This is the handler for the special array content property. If you get\nthis property, it will return this. If you set this property to a new\narray, it will replace the current content.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let peopleToMoon = ['Armstrong', 'Aldrin'];\n\npeopleToMoon.get('[]'); // ['Armstrong', 'Aldrin']\n\npeopleToMoon.set('[]', ['Collins']); // ['Collins']\npeopleToMoon.get('[]'); // ['Collins']
\n
\n
\n \n", + "itemtype": "property", + "name": "[]", + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 324, + "description": "

The first object in the array, or undefined if the array is empty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let vowels = ['a', 'e', 'i', 'o', 'u'];\nvowels.firstObject; // 'a'\n\nvowels.shiftObject();\nvowels.firstObject; // 'e'\n\nvowels.reverseObjects();\nvowels.firstObject; // 'u'\n\nvowels.clear();\nvowels.firstObject; // undefined
\n
\n
\n \n", + "itemtype": "property", + "name": "firstObject", + "return": { + "description": "The first object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 346, + "description": "

The last object in the array, or undefined if the array is empty.

\n", + "itemtype": "property", + "name": "lastObject", + "return": { + "description": "The last object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "Ember.NativeArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.ProxyMixin.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.ProxyMixin.json new file mode 100644 index 000000000..543c7fb6e --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.ProxyMixin.json @@ -0,0 +1,76 @@ +{ + "data": { + "id": "ember-5.3.0-Ember.ProxyMixin", + "type": "class", + "attributes": { + "name": "Ember.ProxyMixin", + "shortname": "Ember.ProxyMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "ObjectProxy" + ], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/runtime/lib/mixins/-proxy.ts", + "line": 63, + "description": "

Ember.ProxyMixin forwards all properties not defined by the proxy itself\nto a proxied content object. See ObjectProxy for more details.

\n", + "access": "private", + "tagname": "", + "methods": [], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/-proxy.ts", + "line": 72, + "description": "

The object whose properties will be forwarded.

\n", + "itemtype": "property", + "name": "content", + "type": "{unknown}", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.ProxyMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/-proxy.ts", + "line": 94, + "description": "

The object whose properties will be forwarded.

\n", + "itemtype": "property", + "name": "content", + "type": "{unknown}", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.ProxyMixin", + "module": "ember", + "namespace": "Ember" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.String.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.String.json new file mode 100644 index 000000000..9665c2e8a --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.String.json @@ -0,0 +1,92 @@ +{ + "data": { + "id": "ember-5.3.0-Ember.String", + "type": "class", + "attributes": { + "name": "Ember.String", + "shortname": "String", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/string/index.ts", + "line": 42, + "description": "

Defines string helper methods used internally in ember-source.

\n", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/string/index.ts", + "line": 49, + "description": "

Replaces underscores, spaces, or camelCase with dashes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { dasherize } from '@ember/-internals/string';\n\ndasherize('innerHTML');                // 'inner-html'\ndasherize('action_name');              // 'action-name'\ndasherize('css-class-name');           // 'css-class-name'\ndasherize('my favorite items');        // 'my-favorite-items'\ndasherize('privateDocs/ownerInvoice';  // 'private-docs/owner-invoice'
\n
\n
\n \n", + "itemtype": "method", + "name": "dasherize", + "params": [ + { + "name": "str", + "description": "The string to dasherize.", + "type": "String" + } + ], + "return": { + "description": "the dasherized string.", + "type": "String" + }, + "access": "private", + "tagname": "", + "class": "Ember.String", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/string/index.ts", + "line": 71, + "description": "

Returns the UpperCamelCase form of a string.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import { classify } from '@ember/string';\n\nclassify('innerHTML');                   // 'InnerHTML'\nclassify('action_name');                 // 'ActionName'\nclassify('css-class-name');              // 'CssClassName'\nclassify('my favorite items');           // 'MyFavoriteItems'\nclassify('private-docs/owner-invoice');  // 'PrivateDocs/OwnerInvoice'
\n
\n
\n \n", + "itemtype": "method", + "name": "classify", + "params": [ + { + "name": "str", + "description": "the string to classify", + "type": "String" + } + ], + "return": { + "description": "the classified string", + "type": "String" + }, + "access": "private", + "tagname": "", + "class": "Ember.String", + "module": "ember", + "namespace": "Ember" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.TargetActionSupport.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.TargetActionSupport.json new file mode 100644 index 000000000..bf82a4a42 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.TargetActionSupport.json @@ -0,0 +1,101 @@ +{ + "data": { + "id": "ember-5.3.0-Ember.TargetActionSupport", + "type": "class", + "attributes": { + "name": "Ember.TargetActionSupport", + "shortname": "Ember.TargetActionSupport", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Component" + ], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/runtime/lib/mixins/target_action_support.ts", + "line": 11, + "description": "

Ember.TargetActionSupport is a mixin that can be included in a class\nto add a triggerAction method with semantics similar to the Handlebars\n{{action}} helper. In normal Ember usage, the {{action}} helper is\nusually the best choice. This mixin is most often useful when you are\ndoing more complex event handling in Components.

\n", + "extends": "Mixin", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/target_action_support.ts", + "line": 52, + "description": "

Send an action with an actionContext to a target. The action, actionContext\nand target will be retrieved from properties of the object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { alias } from '@ember/object/computed';\n\nApp.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  target: alias('controller'),\n  action: 'save',\n  actionContext: alias('context'),\n  click() {\n    this.triggerAction(); // Sends the `save` action, along with the current context\n                          // to the current controller\n  }\n});
\n
\n
\n \n

The target, action, and actionContext can be provided as properties of\nan optional object argument to triggerAction as well.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  click() {\n    this.triggerAction({\n      action: 'save',\n      target: this.get('controller'),\n      actionContext: this.get('context')\n    }); // Sends the `save` action, along with the current context\n        // to the current controller\n  }\n});
\n
\n
\n \n

The actionContext defaults to the object you are mixing TargetActionSupport into.\nBut target and action must be specified either as properties or with the argument\nto triggerAction, or a combination:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { alias } from '@ember/object/computed';\n\nApp.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {\n  target: alias('controller'),\n  click() {\n    this.triggerAction({\n      action: 'save'\n    }); // Sends the `save` action, along with a reference to `this`,\n        // to the current controller\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "triggerAction", + "params": [ + { + "name": "opts", + "description": "(optional, with the optional keys action, target and/or actionContext)", + "type": "Object" + } + ], + "return": { + "description": "true if the action was sent successfully and did not return false", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Ember.TargetActionSupport", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/object/mixin.ts", + "line": 441, + "itemtype": "method", + "name": "mixin", + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "mixins", + "description": "", + "multiple": true + } + ], + "return": { + "description": "obj" + }, + "access": "private", + "tagname": "", + "class": "Ember.TargetActionSupport", + "module": "@ember/object/mixin", + "inherited": true, + "inheritedFrom": "Mixin" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-5.3.0-Mixin", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.Templates.components.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.Templates.components.json new file mode 100644 index 000000000..26cf54f08 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.Templates.components.json @@ -0,0 +1,81 @@ +{ + "data": { + "id": "ember-5.3.0-Ember.Templates.components", + "type": "class", + "attributes": { + "name": "Ember.Templates.components", + "shortname": "Ember.Templates.components", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/components/input.ts", + "line": 67, + "description": "

The Input component lets you create an HTML <input> element.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Input @value="987" />
\n
\n
\n \n

creates an <input> element with type="text" and value set to 987.

\n

Text field

\n

If no type argument is specified, a default of type 'text' is used.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
Search:\n<Input @value={{this.searchWord}} />
\n
\n
\n \n

In this example, the initial value in the <input> will be set to the value of\nthis.searchWord. If the user changes the text, the value of this.searchWord will also be\nupdated.

\n

Actions

\n

The Input component takes a number of arguments with callbacks that are invoked in response to\nuser events.

\n
    \n
  • enter
  • \n
  • insert-newline
  • \n
  • escape-press
  • \n
  • focus-in
  • \n
  • focus-out
  • \n
  • key-down
  • \n
  • key-press
  • \n
  • key-up
  • \n
\n

These callbacks are passed to Input like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Input @value={{this.searchWord}} @enter={{this.query}} />
\n
\n
\n \n

Starting with Ember Octane, we recommend using the {{on}} modifier to call actions\non specific events, such as the input event.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
<label for="input-name">Name:</label>\n<Input\n  @id="input-name"\n  @value={{this.name}}\n  {{on "input" this.validateName}}\n/>
\n
\n
\n \n

The event name (e.g. focusout, input, keydown) always follows the casing\nthat the HTML standard uses.

\n

<input> HTML Attributes to Avoid

\n

In most cases, if you want to pass an attribute to the underlying HTML <input> element, you\ncan pass the attribute directly, just like any other Ember component.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Input @type="text" size="10" />
\n
\n
\n \n

In this example, the size attribute will be applied to the underlying <input> element in the\noutputted HTML.

\n

However, there are a few attributes where you must use the @ version.

\n
    \n
  • @type: This argument is used to control which Ember component is used under the hood
  • \n
  • @value: The @value argument installs a two-way binding onto the element. If you wanted a\none-way binding, use <input> with the value property and the input event instead.
  • \n
  • @checked (for checkboxes): like @value, the @checked argument installs a two-way binding\nonto the element. If you wanted a one-way binding, use <input type="checkbox"> with\nchecked and the input event instead.
  • \n
\n

Checkbox

\n

To create an <input type="checkbox">:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
Emberize Everything:\n<Input @type="checkbox" @checked={{this.isEmberized}} name="isEmberized" />
\n
\n
\n \n

This will bind the checked state of this checkbox to the value of isEmberized -- if either one\nchanges, it will be reflected in the other.

\n", + "itemtype": "method", + "name": "Input", + "params": [ + { + "name": "options", + "description": "", + "type": "Hash" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.components", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/components/link-to.ts", + "line": 43, + "description": "

The LinkTo component renders a link to the supplied routeName passing an optionally\nsupplied model to the route as its model context of the route. The block for LinkTo\nbecomes the contents of the rendered element:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery'>\n  Great Hamster Photos\n</LinkTo>
\n
\n
\n \n

This will result in:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos">\n  Great Hamster Photos\n</a>
\n
\n
\n \n

Disabling the LinkTo component

\n

The LinkTo component can be disabled by using the disabled argument. A disabled link\ndoesn't result in a transition when activated, and adds the disabled class to the <a>\nelement.

\n

(The class name to apply to the element can be overridden by using the disabledClass\nargument)

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery' @disabled={{true}}>\n  Great Hamster Photos\n</LinkTo>
\n
\n
\n \n

Handling href

\n

<LinkTo> will use your application's Router to fill the element's href property with a URL\nthat matches the path to the supplied routeName.

\n

Handling current route

\n

The LinkTo component will apply a CSS class name of 'active' when the application's current\nroute matches the supplied routeName. For example, if the application's current route is\n'photoGallery.recent', then the following invocation of LinkTo:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery.recent'>\n  Great Hamster Photos\n</LinkTo>
\n
\n
\n \n

will result in

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos/this-week" class="active">\n  Great Hamster Photos\n</a>
\n
\n
\n \n

The CSS class used for active classes can be customized by passing an activeClass argument:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery.recent' @activeClass="current-url">\n  Great Hamster Photos\n</LinkTo>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos/this-week" class="current-url">\n  Great Hamster Photos\n</a>
\n
\n
\n \n\n

If you need a link to be 'active' even when it doesn't match the current route, you can use the\ncurrent-when argument.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery' @current-when='photos'>\n  Photo Gallery\n</LinkTo>
\n
\n
\n \n

This may be helpful for keeping links active for:

\n
    \n
  • non-nested routes that are logically related
  • \n
  • some secondary menu approaches
  • \n
  • 'top navigation' with 'sub navigation' scenarios
  • \n
\n

A link will be active if current-when is true or the current\nroute is the route this link would transition to.

\n

To match multiple routes 'space-separate' the routes:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='gallery' @current-when='photos drawings paintings'>\n  Art Gallery\n</LinkTo>
\n
\n
\n \n

Supplying a model

\n

An optional model argument can be used for routes whose\npaths contain dynamic segments. This argument will become\nthe model context of the linked route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
Router.map(function() {\n  this.route("photoGallery", {path: "hamster-photos/:photo_id"});\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery' @model={{this.aPhoto}}>\n  {{aPhoto.title}}\n</LinkTo>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos/42">\n  Tomster\n</a>
\n
\n
\n \n

Supplying multiple models

\n

For deep-linking to route paths that contain multiple\ndynamic segments, the models argument can be used.

\n

As the router transitions through the route path, each\nsupplied model argument will become the context for the\nroute with the dynamic segments:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
Router.map(function() {\n  this.route("photoGallery", { path: "hamster-photos/:photo_id" }, function() {\n    this.route("comment", {path: "comments/:comment_id"});\n  });\n});
\n
\n
\n \n

This argument will become the model context of the linked route:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery.comment' @models={{array this.aPhoto this.comment}}>\n  {{comment.body}}\n</LinkTo>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos/42/comments/718">\n  A+++ would snuggle again.\n</a>
\n
\n
\n \n

Supplying an explicit dynamic segment value

\n

If you don't have a model object available to pass to LinkTo,\nan optional string or integer argument can be passed for routes whose\npaths contain dynamic segments. This argument will become the value\nof the dynamic segment:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
Router.map(function() {\n  this.route("photoGallery", { path: "hamster-photos/:photo_id" });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery' @model={{aPhotoId}}>\n  {{this.aPhoto.title}}\n</LinkTo>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos/42">\n  Tomster\n</a>
\n
\n
\n \n

When transitioning into the linked route, the model hook will\nbe triggered with parameters including this passed identifier.

\n

Supplying query parameters

\n

If you need to add optional key-value pairs that appear to the right of the ? in a URL,\nyou can use the query argument.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<LinkTo @route='photoGallery' @query={{hash page=1 per_page=20}}>\n  Great Hamster Photos\n</LinkTo>
\n
\n
\n \n

This will result in:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<a href="/hamster-photos?page=1&per_page=20">\n  Great Hamster Photos\n</a>
\n
\n
\n \n", + "itemtype": "method", + "name": "LinkTo", + "access": "public", + "tagname": "", + "class": "Ember.Templates.components", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/components/textarea.ts", + "line": 10, + "description": "

The Textarea component inserts a new instance of <textarea> tag into the template.

\n

The @value argument provides the content of the <textarea>.

\n

This template:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Textarea @value="A bunch of text" />
\n
\n
\n \n

Would result in the following HTML:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<textarea class="ember-text-area">\n  A bunch of text\n</textarea>
\n
\n
\n \n

The @value argument is two-way bound. If the user types text into the textarea, the @value\nargument is updated. If the @value argument is updated, the text in the textarea is updated.

\n

In the following example, the writtenWords property on the component will be updated as the user\ntypes 'Lots of text' into the text area of their browser's window.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
editor.js
1\n2\n3\n4\n5\n6\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class WordEditorComponent extends Component {\n  @tracked writtenWords = "Lots of text that IS bound";\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Textarea @value={{writtenWords}} />
\n
\n
\n \n

Would result in the following HTML:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<textarea class="ember-text-area">\n  Lots of text that IS bound\n</textarea>
\n
\n
\n \n

If you wanted a one way binding, you could use the <textarea> element directly, and use the\nvalue DOM property and the input event.

\n

Actions

\n

The Textarea component takes a number of arguments with callbacks that are invoked in\nresponse to user events.

\n
    \n
  • enter
  • \n
  • insert-newline
  • \n
  • escape-press
  • \n
  • focus-in
  • \n
  • focus-out
  • \n
  • key-press
  • \n
\n

These callbacks are passed to Textarea like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Textarea @value={{this.searchWord}} @enter={{this.query}} />
\n
\n
\n \n

Classic Invocation Syntax

\n

The Textarea component can also be invoked using curly braces, just like any other Ember\ncomponent.

\n

For example, this is an invocation using angle-bracket notation:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<Textarea @value={{this.searchWord}} @enter={{this.query}} />
\n
\n
\n \n

You could accomplish the same thing using classic invocation:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{textarea value=this.searchWord enter=this.query}}
\n
\n
\n \n

The main difference is that angle-bracket invocation supports any HTML attribute using HTML\nattribute syntax, because attributes and arguments have different syntax when using angle-bracket\ninvocation. Curly brace invocation, on the other hand, only has a single syntax for arguments,\nand components must manually map attributes onto component arguments.

\n

When using classic invocation with {{textarea}}, only the following attributes are mapped onto\narguments:

\n
    \n
  • rows
  • \n
  • cols
  • \n
  • name
  • \n
  • selectionEnd
  • \n
  • selectionStart
  • \n
  • autocomplete
  • \n
  • wrap
  • \n
  • lang
  • \n
  • dir
  • \n
  • value
  • \n
\n

Classic layout and layoutName properties

\n

Because HTML textarea elements do not contain inner HTML the layout and\nlayoutName properties will not be applied.

\n", + "itemtype": "method", + "name": "Textarea", + "access": "public", + "tagname": "", + "class": "Ember.Templates.components", + "module": "@ember/component" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/routing", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.Templates.helpers.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.Templates.helpers.json new file mode 100644 index 000000000..59b43cd6e --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.Templates.helpers.json @@ -0,0 +1,426 @@ +{ + "data": { + "id": "ember-5.3.0-Ember.Templates.helpers", + "type": "class", + "attributes": { + "name": "Ember.Templates.helpers", + "shortname": "Ember.Templates.helpers", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "", + "file": "packages/@ember/-internals/glimmer/index.ts", + "line": 86, + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/components/input.ts", + "line": 46, + "description": "

See Ember.Templates.components.Input.

\n", + "itemtype": "method", + "name": "input", + "params": [ + { + "name": "options", + "description": "", + "type": "Hash" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/components/link-to.ts", + "line": 255, + "description": "

See Ember.Templates.components.LinkTo.

\n", + "itemtype": "method", + "name": "link-to", + "see": [ + "{Ember.Templates.components.LinkTo}" + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "@ember/routing" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/components/textarea.ts", + "line": 123, + "description": "

See Ember.Templates.components.Textarea.

\n", + "itemtype": "method", + "name": "textarea", + "see": [ + "{Ember.Templates.components.Textarea}" + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/action.ts", + "line": 18, + "description": "

The {{action}} helper provides a way to pass triggers for behavior (usually\njust a function) between components, and into components from controllers.

\n

Passing functions with the action helper

\n

There are three contexts an action helper can be used in. The first two\ncontexts to discuss are attribute context, and Handlebars value context.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
{{! An example of attribute context }}\n<div onclick={{action "save"}}></div>\n{{! Examples of Handlebars value context }}\n{{input on-input=(action "save")}}\n{{yield (action "refreshData") andAnotherParam}}
\n
\n
\n \n

In these contexts,\nthe helper is called a "closure action" helper. Its behavior is simple:\nIf passed a function name, read that function off the actions property\nof the current context. Once that function is read, or immediately if a function was\npassed, create a closure over that function and any arguments.\nThe resulting value of an action helper used this way is simply a function.

\n

For example, in the attribute context:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
{{! An example of attribute context }}\n<div onclick={{action "save"}}></div>
\n
\n
\n \n

The resulting template render logic would be:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
var div = document.createElement('div');\nvar actionFunction = (function(context){\n  return function() {\n    return context.actions.save.apply(context, arguments);\n  };\n})(context);\ndiv.onclick = actionFunction;
\n
\n
\n \n

Thus when the div is clicked, the action on that context is called.\nBecause the actionFunction is just a function, closure actions can be\npassed between components and still execute in the correct context.

\n

Here is an example action handler on a component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\n\nexport default class extends Component {\n  @action\n  save() {\n    this.model.save();\n  }\n}
\n
\n
\n \n

Actions are always looked up on the actions property of the current context.\nThis avoids collisions in the naming of common actions, such as destroy.\nTwo options can be passed to the action helper when it is used in this way.

\n
    \n
  • target=someProperty will look to someProperty instead of the current\ncontext for the actions hash. This can be useful when targeting a\nservice for actions.
  • \n
  • value="target.value" will read the path target.value off the first\nargument to the action when it is called and rewrite the first argument\nto be that value. This is useful when attaching actions to event listeners.
  • \n
\n

Invoking an action

\n

Closure actions curry both their scope and any arguments. When invoked, any\nadditional arguments are added to the already curried list.\nActions are presented in JavaScript as callbacks, and are\ninvoked like any other JavaScript function.

\n

For example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
name.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\n\nexport default class extends Component {\n  @action\n  setName(model, name) {\n    model.set('name', name);\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
name.hbs
1\n
{{input on-input=(action (action 'setName' @model) value="target.value")}}
\n
\n
\n \n

The first argument (@model) was curried over, and the run-time argument (event)\nbecomes a second argument. Action calls can be nested this way because each simply\nreturns a function. Any function can be passed to the {{action}} helper, including\nother actions.

\n

Actions invoked with sendAction have the same currying behavior as demonstrated\nwith on-input above. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
input.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\n\nexport default class extends Component {\n  @action\n  setName(model, name) {\n    model.set('name', name);\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyInput @submit={{action 'setName' @model}} />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-input submit=(action 'setName' @model)}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  click() {\n    // Note that model is not passed, it was curried in the template\n    this.submit('bob');\n  }\n});
\n
\n
\n \n

Attaching actions to DOM elements

\n

The third context of the {{action}} helper can be called "element space".\nFor example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
{{! An example of element space }}\n<div {{action "save"}}></div>
\n
\n
\n \n

Used this way, the {{action}} helper provides a useful shortcut for\nregistering an HTML element in a template for a single DOM event and\nforwarding that interaction to the template's context (controller or component).\nIf the context of a template is a controller, actions used this way will\nbubble to routes when the controller does not implement the specified action.\nOnce an action hits a route, it will bubble through the route hierarchy.

\n

Event Propagation

\n

{{action}} helpers called in element space can control event bubbling. Note\nthat the closure style actions cannot.

\n

Events triggered through the action helper will automatically have\n.preventDefault() called on them. You do not need to do so in your event\nhandlers. If you need to allow event propagation (to handle file inputs for\nexample) you can supply the preventDefault=false option to the {{action}} helper:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<div {{action "sayHello" preventDefault=false}}>\n  <input type="file" />\n  <input type="checkbox" />\n</div>
\n
\n
\n \n

To disable bubbling, pass bubbles=false to the helper:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<button {{action 'edit' post bubbles=false}}>Edit</button>
\n
\n
\n \n

To disable bubbling with closure style actions you must create your own\nwrapper helper that makes use of event.stopPropagation():

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<div onclick={{disable-bubbling (action "sayHello")}}>Hello</div>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
bubbling.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { helper } from '@ember/component/helper';\n\nexport function disableBubbling([action]) {\n  return function(event) {\n    event.stopPropagation();\n    return action(event);\n  };\n}\nexport default helper(disableBubbling);
\n
\n
\n \n

If you need the default handler to trigger you should either register your\nown event handler, or use event methods on your view class. See\n"Responding to Browser Events"\nin the documentation for Component for more information.

\n

Specifying DOM event type

\n

{{action}} helpers called in element space can specify an event type.\nBy default the {{action}} helper registers for DOM click events. You can\nsupply an on option to the helper to specify a different DOM event name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<div {{action "anActionName" on="doubleClick"}}>\n  click me\n</div>
\n
\n
\n \n

See "Event Names" for a list of\nacceptable DOM event names.

\n

Specifying whitelisted modifier keys

\n

{{action}} helpers called in element space can specify modifier keys.\nBy default the {{action}} helper will ignore click events with pressed modifier\nkeys. You can supply an allowedKeys option to specify which keys should not be ignored.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<div {{action "anActionName" allowedKeys="alt"}}>\n  click me\n</div>
\n
\n
\n \n

This way the action will fire when clicking with the alt key pressed down.\nAlternatively, supply "any" to the allowedKeys option to accept any combination of modifier keys.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<div {{action "anActionName" allowedKeys="any"}}>\n  click me with any key pressed\n</div>
\n
\n
\n \n

Specifying a Target

\n

A target option can be provided to the helper to change\nwhich object will receive the method call. This option must be a path\nto an object, accessible in the current context:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n
<div {{action "anActionName" target=someService}}>\n  click me\n</div>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/controllers/application.js
1\n2\n3\n4\n5\n6\n
import Controller from '@ember/controller';\nimport { service } from '@ember/service';\n\nexport default class extends Controller {\n  @service someService;\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "action", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/component.ts", + "line": 5, + "description": "

The {{component}} helper lets you add instances of Component to a\ntemplate. See Component for\nadditional information on how a Component functions.\n{{component}}'s primary use is for cases where you want to dynamically\nchange which type of component is rendered as the state of your application\nchanges. This helper has three modes: inline, block, and nested.

\n

Inline Form

\n

Given the following template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/application.hbs
1\n
{{component this.infographicComponentName}}
\n
\n
\n \n

And the following application code:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/controllers/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Controller from '@ember/controller';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class ApplicationController extends Controller {\n  @tracked isMarketOpen = 'live-updating-chart'\n\n  get infographicComponentName() {\n    return this.isMarketOpen ? 'live-updating-chart' : 'market-close-summary';\n  }\n}
\n
\n
\n \n

The live-updating-chart component will be appended when isMarketOpen is\ntrue, and the market-close-summary component will be appended when\nisMarketOpen is false. If the value changes while the app is running,\nthe component will be automatically swapped out accordingly.\nNote: You should not use this helper when you are consistently rendering the same\ncomponent. In that case, use standard component syntax, for example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<LiveUpdatingChart />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
{{live-updating-chart}}
\n
\n
\n \n

Block Form

\n

Using the block form of this helper is similar to using the block form\nof a component. Given the following application template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n
{{#component this.infographicComponentName}}\n  Last update: {{this.lastUpdateTimestamp}}\n{{/component}}
\n
\n
\n \n

The following controller code:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/controllers/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Controller from '@ember/controller';\nimport { computed } from '@ember/object';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class ApplicationController extends Controller {\n  @tracked isMarketOpen = 'live-updating-chart'\n\n  get lastUpdateTimestamp() {\n    return new Date();\n  }\n\n  get infographicComponentName() {\n    return this.isMarketOpen ? 'live-updating-chart' : 'market-close-summary';\n  }\n}
\n
\n
\n \n

And the following component template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
chart.hbs
1\n2\n
{{! chart }}\n{{yield}}
\n
\n
\n \n

The Last Update: {{this.lastUpdateTimestamp}} will be rendered in place of the {{yield}}.

\n

Nested Usage

\n

The component helper can be used to package a component path with initial attrs.\nThe included attrs can then be merged during the final invocation.\nFor example, given a person-form component with the following template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
form.hbs
1\n2\n3\n
{{yield (hash\n  nameInput=(component "my-input-component" value=@model.name placeholder="First Name")\n)}}
\n
\n
\n \n

When yielding the component via the hash helper, the component is invoked directly.\nSee the following snippet:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<PersonForm as |form|>\n  <form.nameInput @placeholder="Username" />\n</PersonForm>
\n
\n
\n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#person-form as |form|}}\n  {{form.nameInput placeholder="Username"}}\n{{/person-form}}
\n
\n
\n

Which outputs an input whose value is already bound to model.name and placeholder\nis "Username".

\n

When yielding the component without the hash helper use the component helper.\nFor example, below is a full-name component template:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{yield (component "my-input-component" value=@model.name placeholder="Name")}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<FullName as |field|>\n  {{component field placeholder="Full name"}}\n</FullName>
\n
\n
\n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#full-name as |field|}}\n  {{component field placeholder="Full name"}}\n{{/full-name}}
\n
\n
\n ", + "itemtype": "method", + "name": "component", + "since": "1.11.0", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/each-in.ts", + "line": 13, + "description": "

The {{#each}} helper loops over elements in a collection. It is an extension\nof the base Handlebars {{#each}} helper.

\n

The default behavior of {{#each}} is to yield its inner block once for every\nitem in an array passing the item as the first block parameter.

\n

Assuming the @developers argument contains this array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
[{ name: 'Yehuda' },{ name: 'Tom' }, { name: 'Paul' }];
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<ul>\n  {{#each @developers as |person|}}\n    <li>Hello, {{person.name}}!</li>\n  {{/each}}\n</ul>
\n
\n
\n \n

The same rules apply to arrays of primitives.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
['Yehuda', 'Tom', 'Paul']
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<ul>\n  {{#each @developerNames as |name|}}\n    <li>Hello, {{name}}!</li>\n  {{/each}}\n</ul>
\n
\n
\n \n

During iteration, the index of each item in the array is provided as a second block\nparameter.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<ul>\n  {{#each @developers as |person index|}}\n    <li>Hello, {{person.name}}! You're number {{index}} in line</li>\n  {{/each}}\n</ul>
\n
\n
\n \n

Specifying Keys

\n

In order to improve rendering speed, Ember will try to reuse the DOM elements\nwhere possible. Specifically, if the same item is present in the array both\nbefore and after the change, its DOM output will be reused.

\n

The key option is used to tell Ember how to determine if the items in the\narray being iterated over with {{#each}} has changed between renders. By\ndefault the item's object identity is used.

\n

This is usually sufficient, so in most cases, the key option is simply not\nneeded. However, in some rare cases, the objects' identities may change even\nthough they represent the same underlying data.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
people.map(person => {\n  return { ...person, type: 'developer' };\n});
\n
\n
\n \n

In this case, each time the people array is map-ed over, it will produce\nan new array with completely different objects between renders. In these cases,\nyou can help Ember determine how these objects related to each other with the\nkey option:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<ul>\n  {{#each @developers key="name" as |person|}}\n    <li>Hello, {{person.name}}!</li>\n  {{/each}}\n</ul>
\n
\n
\n \n

By doing so, Ember will use the value of the property specified (person.name\nin the example) to find a "match" from the previous render. That is, if Ember\nhas previously seen an object from the @developers array with a matching\nname, its DOM elements will be re-used.

\n

There are two special values for key:

\n
    \n
  • @index - The index of the item in the array.
  • \n
  • @identity - The item in the array itself.
  • \n
\n

{{else}} condition

\n

{{#each}} can have a matching {{else}}. The contents of this block will render\nif the collection is empty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
<ul>\n  {{#each @developers as |person|}}\n    <li>{{person.name}} is available!</li>\n  {{else}}\n    <li>Sorry, nobody is available for this task.</li>\n  {{/each}}\n</ul>
\n
\n
\n \n", + "itemtype": "method", + "name": "each", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/each-in.ts", + "line": 124, + "description": "

The {{each-in}} helper loops over properties on an object.

\n

For example, given this component definition:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
details.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\n\nexport default class extends Component {\n  @tracked developer = {\n    "name": "Shelly Sails",\n    "age": 42\n  };\n}
\n
\n
\n \n

This template would display all properties on the developer\nobject in a list:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
details.hbs
1\n2\n3\n4\n5\n
<ul>\n  {{#each-in this.developer as |key value|}}\n    <li>{{key}}: {{value}}</li>\n  {{/each-in}}\n</ul>
\n
\n
\n \n

Outputting their name and age:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<ul>\n  <li>name: Shelly Sails</li>\n  <li>age: 42</li>\n</ul>
\n
\n
\n \n", + "itemtype": "method", + "name": "each-in", + "access": "public", + "tagname": "", + "since": "2.1.0", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/helper.ts", + "line": 5, + "description": "

Use the {{helper}} helper to create contextual helper so\nthat it can be passed around as first-class values in templates.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
{{#let (helper "join-words" "foo" "bar" separator=" ") as |foo-bar|}}\n\n  {{!-- this is equivalent to invoking `{{join-words "foo" "bar" separator=" "}}` --}}\n  {{foo-bar}}\n\n  {{!-- this will pass the helper itself into the component, instead of invoking it now --}}\n  <MyComponent @helper={{helper foo-bar "baz"}} />\n\n  {{!-- this will yield the helper itself ("contextual helper"), instead of invoking it now --}}\n  {{yield foo-bar}}\n{{/let}}
\n
\n
\n \n

Arguments

\n

The {{helper}} helper works similarly to the {{component}} and\n{{modifier}} helper:

\n
    \n
  • When passed a string (e.g. (helper "foo")) as the first argument,\nit will produce an opaque, internal "helper definition" object\nthat can be passed around and invoked elsewhere.

    \n
  • \n
  • Any additional positional and/or named arguments (a.k.a. params and hash)\nwill be stored ("curried") inside the definition object, such that, when invoked,\nthese arguments will be passed along to the referenced helper.

    \n
  • \n
\n", + "itemtype": "method", + "name": "helper", + "access": "public", + "tagname": "", + "since": "3.27.0", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/if-unless.ts", + "line": 5, + "description": "

The if helper allows you to conditionally render one of two branches,\ndepending on the "truthiness" of a property.\nFor example the following values are all falsey: false, undefined, null, "", 0, NaN or an empty array.

\n

This helper has two forms, block and inline.

\n

Block form

\n

You can use the block form of if to conditionally render a section of the template.

\n

To use it, pass the conditional value to the if helper,\nusing the block form to wrap the section of template you want to conditionally render.\nLike so:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Weather />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/weather.hbs
1\n2\n3\n4\n
{{! will not render because greeting is undefined}}\n{{#if @isRaining}}\n  Yes, grab an umbrella!\n{{/if}}
\n
\n
\n \n

You can also define what to show if the property is falsey by using\nthe else helper.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/weather.hbs
1\n2\n3\n4\n5\n
{{#if @isRaining}}\n  Yes, grab an umbrella!\n{{else}}\n  No, it's lovely outside!\n{{/if}}
\n
\n
\n \n

You are also able to combine else and if helpers to create more complex\nconditional logic.

\n

For the following template:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/weather.hbs
1\n2\n3\n4\n5\n6\n7\n
{{#if @isRaining}}\n  Yes, grab an umbrella!\n{{else if @isCold}}\n  Grab a coat, it's chilly!\n{{else}}\n  No, it's lovely outside!\n{{/if}}
\n
\n
\n \n

If you call it by saying isCold is true:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Weather @isCold={{true}} />
\n
\n
\n \n

Then Grab a coat, it's chilly! will be rendered.

\n

Inline form

\n

The inline if helper conditionally renders a single property or string.

\n

In this form, the if helper receives three arguments, the conditional value,\nthe value to render when truthy, and the value to render when falsey.

\n

For example, if useLongGreeting is truthy, the following:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Greeting @useLongGreeting={{true}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/greeting.hbs
1\n
{{if @useLongGreeting "Hello" "Hi"}} Alex
\n
\n
\n \n

Will render:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Hello Alex
\n
\n
\n \n

One detail to keep in mind is that both branches of the if helper will be evaluated,\nso if you have {{if condition "foo" (expensive-operation "bar"),\nexpensive-operation will always calculate.

\n", + "itemtype": "method", + "name": "if", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/if-unless.ts", + "line": 97, + "description": "

The unless helper is the inverse of the if helper. It displays if a value\nis falsey ("not true" or "is false"). Example values that will display with\nunless: false, undefined, null, "", 0, NaN or an empty array.

\n

Inline form

\n

The inline unless helper conditionally renders a single property or string.\nThis helper acts like a ternary operator. If the first property is falsy,\nthe second argument will be displayed, otherwise, the third argument will be\ndisplayed

\n

For example, if you pass a falsey useLongGreeting to the Greeting component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Greeting @useLongGreeting={{false}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/greeting.hbs
1\n
{{unless @useLongGreeting "Hi" "Hello"}} Ben
\n
\n
\n \n

Then it will display:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Hi Ben
\n
\n
\n \n

Block form

\n

Like the if helper, the unless helper also has a block form.

\n

The following will not render anything:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Greeting />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/greeting.hbs
1\n2\n3\n
{{#unless @greeting}}\n  No greeting was found. Why not set one?\n{{/unless}}
\n
\n
\n \n

You can also use an else helper with the unless block. The\nelse will display if the value is truthy.

\n

If you have the following component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
in.hbs
1\n2\n3\n4\n5\n
{{#unless @userData}}\n  Please login.\n{{else}}\n  Welcome back!\n{{/unless}}
\n
\n
\n \n

Calling it with a truthy userData:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<LoggedIn @userData={{hash username="Zoey"}} />
\n
\n
\n \n

Will render:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Welcome back!
\n
\n
\n \n

and calling it with a falsey userData:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<LoggedIn @userData={{false}} />
\n
\n
\n \n

Will render:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Please login.
\n
\n
\n \n", + "itemtype": "method", + "name": "unless", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/log.ts", + "line": 5, + "description": "

log allows you to output the value of variables in the current rendering\ncontext. log also accepts primitive types such as strings or numbers.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{log "myVariable:" myVariable }}
\n
\n
\n \n", + "itemtype": "method", + "name": "log", + "params": [ + { + "name": "params", + "description": "", + "type": "Array" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/modifier.ts", + "line": 5, + "description": "

Use the {{modifier}} helper to create contextual modifier so\nthat it can be passed around as first-class values in templates.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
{{#let (modifier "click-outside" click=this.submit) as |on-click-outside|}}\n\n  {{!-- this is equivalent to `<MyComponent {{click-outside click=this.submit}} />` --}}\n  <MyComponent {{on-click-outside}} />\n\n  {{!-- this will pass the modifier itself into the component, instead of invoking it now --}}\n  <MyComponent @modifier={{modifier on-click-outside "extra" "args"}} />\n\n  {{!-- this will yield the modifier itself ("contextual modifier"), instead of invoking it now --}}\n  {{yield on-click-outside}}\n{{/let}}
\n
\n
\n \n

Arguments

\n

The {{modifier}} helper works similarly to the {{component}} and\n{{helper}} helper:

\n
    \n
  • When passed a string (e.g. (modifier "foo")) as the first argument,\nit will produce an opaque, internal "modifier definition" object\nthat can be passed around and invoked elsewhere.

    \n
  • \n
  • Any additional positional and/or named arguments (a.k.a. params and hash)\nwill be stored ("curried") inside the definition object, such that, when invoked,\nthese arguments will be passed along to the referenced modifier.

    \n
  • \n
\n", + "itemtype": "method", + "name": "modifier", + "access": "public", + "tagname": "", + "since": "3.27.0", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/mut.ts", + "line": 9, + "description": "

The mut helper lets you clearly specify that a child Component can update the\n(mutable) value passed to it, which will change the value of the parent component.

\n

To specify that a parameter is mutable, when invoking the child Component:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyChild @childClickCount={{fn (mut totalClicks)}} />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-child childClickCount=(mut totalClicks)}}
\n
\n
\n \n

The child Component can then modify the parent's value just by modifying its own\nproperty:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// my-child.js\nexport default Component.extend({\n  click() {\n    this.incrementProperty('childClickCount');\n  }\n});
\n
\n
\n \n

Note that for curly components ({{my-component}}) the bindings are already mutable,\nmaking the mut unnecessary.

\n

Additionally, the mut helper can be combined with the fn helper to\nmutate a value. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyChild @childClickCount={{this.totalClicks}} @click-count-change={{fn (mut totalClicks))}} />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-child childClickCount=totalClicks click-count-change=(fn (mut totalClicks))}}
\n
\n
\n \n

The child Component would invoke the function with the new click value:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
// my-child.js\nexport default Component.extend({\n  click() {\n    this.get('click-count-change')(this.get('childClickCount') + 1);\n  }\n});
\n
\n
\n \n

The mut helper changes the totalClicks value to what was provided as the fn argument.

\n

The mut helper, when used with fn, will return a function that\nsets the value passed to mut to its first argument. As an example, we can create a\nbutton that increments a value passing the value directly to the fn:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
{{! inc helper is not provided by Ember }}\n<button onclick={{fn (mut count) (inc count)}}>\n  Increment count\n</button>
\n
\n
\n \n", + "itemtype": "method", + "name": "mut", + "params": [ + { + "name": "attr", + "description": "the \"two-way\" attribute that can be modified.", + "type": "Object", + "optional": true + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/page-title.ts", + "line": 5, + "description": "

page-title allows you to set the title of any page in your application and\nappend additional titles for each route. For complete documentation, see\nhttps://github.com/ember-cli/ember-page-title.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{page-title "My Page Title" }}
\n
\n
\n \n", + "itemtype": "method", + "name": "page-title", + "params": [ + { + "name": "param", + "description": "", + "type": "String" + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/readonly.ts", + "line": 9, + "description": "

The readonly helper let's you specify that a binding is one-way only,\ninstead of two-way.\nWhen you pass a readonly binding from an outer context (e.g. parent component),\nto to an inner context (e.g. child component), you are saying that changing that\nproperty in the inner context does not change the value in the outer context.

\n

To specify that a binding is read-only, when invoking the child Component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.js
1\n2\n3\n
export default Component.extend({\n  totalClicks: 3\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log totalClicks}} // -> 3\n<MyChild @childClickCount={{readonly totalClicks}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-child childClickCount=(readonly totalClicks)}}
\n
\n
\n

Now, when you update childClickCount:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
child.js
1\n2\n3\n4\n5\n
export default Component.extend({\n  click() {\n    this.incrementProperty('childClickCount');\n  }\n});
\n
\n
\n \n

The value updates in the child component, but not the parent component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
child.hbs
1\n
{{log childClickCount}} //-> 4
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log totalClicks}} //-> 3\n<MyChild @childClickCount={{readonly totalClicks}} />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log totalClicks}} //-> 3\n{{my-child childClickCount=(readonly totalClicks)}}
\n
\n
\n \n

Objects and Arrays

\n

When passing a property that is a complex object (e.g. object, array) instead of a primitive object (e.g. number, string),\nonly the reference to the object is protected using the readonly helper.\nThis means that you can change properties of the object both on the parent component, as well as the child component.\nThe readonly binding behaves similar to the const keyword in JavaScript.

\n

Let's look at an example:

\n

First let's set up the parent component:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  clicks: null,\n\n  init() {\n    this._super(...arguments);\n    this.set('clicks', { total: 3 });\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log clicks.total}} //-> 3\n<MyChild @childClicks={{readonly clicks}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log clicks.total}} //-> 3\n{{my-child childClicks=(readonly clicks)}}
\n
\n
\n \n

Now, if you update the total property of childClicks:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
child.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  click() {\n    this.get('clicks').incrementProperty('total');\n  }\n});
\n
\n
\n \n

You will see the following happen:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log clicks.total}} //-> 4\n<MyChild @childClicks={{readonly clicks}} />
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
parent.hbs
1\n2\n
{{log clicks.total}} //-> 4\n{{my-child childClicks=(readonly clicks)}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
child.hbs
1\n
{{log childClicks.total}} //-> 4
\n
\n
\n \n", + "itemtype": "method", + "name": "readonly", + "params": [ + { + "name": "attr", + "description": "the read-only attribute.", + "type": "Object", + "optional": true + } + ], + "access": "private", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/unbound.ts", + "line": 10, + "description": "

The {{unbound}} helper disconnects the one-way binding of a property,\nessentially freezing its value at the moment of rendering. For example,\nin this example the display of the variable name will not change even\nif it is set with a new value:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{unbound this.name}}
\n
\n
\n \n

Like any helper, the unbound helper can accept a nested helper expression.\nThis allows for custom helpers to be rendered unbound:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
{{unbound (some-custom-helper)}}\n{{unbound (capitalize this.name)}}\n{{! You can use any helper, including unbound, in a nested expression }}\n{{capitalize (unbound this.name)}}
\n
\n
\n \n

The unbound helper only accepts a single argument, and it return an\nunbound value.

\n", + "itemtype": "method", + "name": "unbound", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helpers/unique-id.ts", + "line": 5, + "description": "

Use the {{unique-id}} helper to generate a unique ID string suitable for use as\nan ID attribute in the DOM.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<input id={{unique-id}} type="email" />
\n
\n
\n \n

Each invocation of {{unique-id}} will return a new, unique ID string.\nYou can use the let helper to create an ID that can be reused within a template.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
{{#let (unique-id) as |emailId|}}\n  <label for={{emailId}}>Email address</label>\n  <input id={{emailId}} type="email" />\n{{/let}}
\n
\n
\n \n", + "itemtype": "method", + "name": "unique-id", + "since": "4.4.0", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/modifiers/on.ts", + "line": 5, + "description": "

The {{on}} modifier lets you easily add event listeners (it uses\nEventTarget.addEventListener\ninternally).

\n

For example, if you'd like to run a function on your component when a <button>\nin the components template is clicked you might do something like:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
post.hbs
1\n
<button {{on 'click' this.saveLike}}>Like this post!</button>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\n\nexport default class LikePostComponent extends Component {\n  @action\n  saveLike() {\n    // someone likes your post!\n    // better send a request off to your server...\n  }\n}
\n
\n
\n \n

Arguments

\n

{{on}} accepts two positional arguments, and a few named arguments.

\n

The positional arguments are:

\n
    \n
  • event -- the name to use when calling addEventListener
  • \n
  • callback -- the function to be passed to addEventListener
  • \n
\n

The named arguments are:

\n
    \n
  • capture -- a true value indicates that events of this type will be dispatched\nto the registered listener before being dispatched to any EventTarget beneath it\nin the DOM tree.
  • \n
  • once -- indicates that the listener should be invoked at most once after being\nadded. If true, the listener would be automatically removed when invoked.
  • \n
  • passive -- if true, indicates that the function specified by listener will never\ncall preventDefault(). If a passive listener does call preventDefault(), the user\nagent will do nothing other than generate a console warning. See\nImproving scrolling performance with passive listeners\nto learn more.
  • \n
\n

The callback function passed to {{on}} will receive any arguments that are passed\nto the event handler. Most commonly this would be the event itself.

\n

If you would like to pass additional arguments to the function you should use\nthe {{fn}} helper.

\n

For example, in our example case above if you'd like to pass in the post that\nwas being liked when the button is clicked you could do something like:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
post.hbs
1\n
<button {{on 'click' (fn this.saveLike @post)}}>Like this post!</button>
\n
\n
\n \n

In this case, the saveLike function will receive two arguments: the click event\nand the value of @post.

\n

Function Context

\n

In the example above, we used @action to ensure that likePost is\nproperly bound to the items-list, but let's explore what happens if we\nleft out @action:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
post.js
1\n2\n3\n4\n5\n6\n7\n
import Component from '@glimmer/component';\n\nexport default class LikePostComponent extends Component {\n  saveLike() {\n    // ...snip...\n  }\n}
\n
\n
\n \n

In this example, when the button is clicked saveLike will be invoked,\nit will not have access to the component instance. In other\nwords, it will have no this context, so please make sure your functions\nare bound (via @action or other means) before passing into on!

\n", + "itemtype": "method", + "name": "on", + "access": "public", + "tagname": "", + "since": "3.11.0", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/syntax/in-element.ts", + "line": 5, + "description": "

The in-element helper renders its block content outside of the regular flow,\ninto a DOM element given by its destinationElement positional argument.

\n

Common use cases - often referred to as "portals" or "wormholes" - are rendering\ndropdowns, modals or tooltips close to the root of the page to bypass CSS overflow\nrules, or to render content to parts of the page that are outside of the control\nof the Ember app itself (e.g. embedded into a static or server rendered HTML page).

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#in-element this.destinationElement}}\n  <div>Some content</div>\n{{/in-element}}
\n
\n
\n \n

Arguments

\n

{{in-element}} requires a single positional argument:

\n
    \n
  • destinationElement -- the DOM element to render into. It must exist at the time\nof rendering.
  • \n
\n

It also supports an optional named argument:

\n
    \n
  • insertBefore -- by default the DOM element's content is replaced when used as\ndestinationElement. Passing null to insertBefore changes the behaviour to\nappend the block content to the end of any existing content. Any other value than\nnull is currently not supported.

    \n

    For example:

    \n
    \n
    \n
    \n \n \n \n \n \n \n \n
    1\n2\n3\n
      {{#in-element this.destinationElement insertBefore=null}}\n    <div>Some content</div>\n  {{/in-element}}
    \n
    \n
    \n \n
  • \n
\n", + "itemtype": "method", + "name": "in-element", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/syntax/let.ts", + "line": 5, + "description": "

The let helper receives one or more positional arguments and yields\nthem out as block params.

\n

This allows the developer to introduce shorter names for certain computations\nin the template.

\n

This is especially useful if you are passing properties to a component\nthat receives a lot of options and you want to clean up the invocation.

\n

For the following example, the template receives a post object with\ncontent and title properties.

\n

We are going to call the my-post component, passing a title which is\nthe title of the post suffixed with the name of the blog, the content\nof the post, and a series of options defined in-place.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
{{#let\n    (concat post.title ' | The Ember.js Blog')\n    post.content\n    (hash\n      theme="high-contrast"\n      enableComments=true\n    )\n    as |title content options|\n}}\n  <MyPost @title={{title}} @content={{content}} @options={{options}} />\n{{/let}}
\n
\n
\n \n

or

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
{{#let\n    (concat post.title ' | The Ember.js Blog')\n    post.content\n    (hash\n      theme="high-contrast"\n      enableComments=true\n    )\n    as |title content options|\n}}\n  {{my-post title=title content=content options=options}}\n{{/let}}
\n
\n
\n \n", + "itemtype": "method", + "name": "let", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/syntax/mount.ts", + "line": 16, + "description": "

The {{mount}} helper lets you embed a routeless engine in a template.\nMounting an engine will cause an instance to be booted and its application\ntemplate to be rendered.

\n

For example, the following template mounts the ember-chat engine:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
{{! application.hbs }}\n{{mount "ember-chat"}}
\n
\n
\n \n

Additionally, you can also pass in a model argument that will be\nset as the engines model. This can be an existing object:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<div>\n  {{mount 'admin' model=userSettings}}\n</div>
\n
\n
\n

Or an inline hash, and you can even pass components:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
<div>\n  <h1>Application template!</h1>\n  {{mount 'admin' model=(hash\n      title='Secret Admin'\n      signInButton=(component 'sign-in-button')\n  )}}\n</div>
\n
\n
\n ", + "itemtype": "method", + "name": "mount", + "params": [ + { + "name": "name", + "description": "Name of the engine to mount.", + "type": "String" + }, + { + "name": "model", + "description": "Object that will be set as\n the model of the engine.", + "type": "Object", + "optional": true + } + ], + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/syntax/outlet.ts", + "line": 22, + "description": "

The {{outlet}} helper lets you specify where a child route will render in\nyour template. An important use of the {{outlet}} helper is in your\napplication's application.hbs file:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n4\n5\n6\n7\n8\n
<MyHeader />\n\n<div class="my-dynamic-content">\n  <!-- this content will change based on the current route, which depends on the current URL -->\n  {{outlet}}\n</div>\n\n<MyFooter />
\n
\n
\n \n

See the routing guide for more\ninformation on how your route interacts with the {{outlet}} helper.\nNote: Your content will not render if there isn't an {{outlet}} for it.

\n", + "itemtype": "method", + "name": "outlet", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/index.ts", + "line": 91, + "description": "

{{yield}} denotes an area of a template that will be rendered inside\nof another template.

\n

Use with Component

\n

When designing components {{yield}} is used to denote where, inside the component's\ntemplate, an optional block passed to the component should render:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n
<LabeledTextfield @value={{@model.name}}>\n  First name:\n</LabeledTextfield>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
textfield.hbs
1\n2\n3\n
<label>\n  {{yield}} <Input @value={{@value}} />\n</label>
\n
\n
\n \n

Result:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<label>\n  First name: <input type="text" />\n</label>
\n
\n
\n \n

Additionally you can yield properties into the context for use by the consumer:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n4\n5\n6\n
<LabeledTextfield @value={{@model.validation}} @validator={{this.firstNameValidator}} as |validationError|>\n  {{#if validationError}}\n    <p class="error">{{validationError}}</p>\n  {{/if}}\n  First name:\n</LabeledTextfield>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
textfield.hbs
1\n2\n3\n
<label>\n  {{yield this.validationError}} <Input @value={{@value}} />\n</label>
\n
\n
\n \n

Result:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<label>\n  <p class="error">First Name must be at least 3 characters long.</p>\n  First name: <input type="text" />\n</label>
\n
\n
\n \n

yield can also be used with the hash helper:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n4\n
<DateRanges @value={{@model.date}} as |range|>\n  Start date: {{range.start}}\n  End date: {{range.end}}\n</DateRanges>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
ranges.hbs
1\n2\n3\n
<div>\n  {{yield (hash start=@value.start end=@value.end)}}\n</div>
\n
\n
\n \n

Result:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<div>\n  Start date: July 1st\n  End date: July 30th\n</div>
\n
\n
\n \n

Multiple values can be yielded as block params:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n4\n5\n
<Banner @value={{@model}} as |title subtitle body|>\n  <h1>{{title}}</h1>\n  <h2>{{subtitle}}</h2>\n  {{body}}\n</Banner>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/banner.hbs
1\n2\n3\n
<div>\n  {{yield "Hello title" "hello subtitle" "body text"}}\n</div>
\n
\n
\n \n

Result:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<div>\n  <h1>Hello title</h1>\n  <h2>hello subtitle</h2>\n  body text\n</div>
\n
\n
\n \n

However, it is preferred to use the hash helper, as this can prevent breaking changes to your component and also simplify the api for the component.

\n

Multiple components can be yielded with the hash and component helper:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n4\n5\n
<Banner @value={{@model}} as |banner|>\n  <banner.Title>Banner title</banner.Title>\n  <banner.Subtitle>Banner subtitle</banner.Subtitle>\n  <banner.Body>A load of body text</banner.Body>\n</Banner>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/banner.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Title from './banner/title';\nimport Subtitle from './banner/subtitle';\nimport Body from './banner/body';\n\nexport default class Banner extends Component {\n  Title = Title;\n  Subtitle = Subtitle;\n  Body = Body;\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/banner.hbs
1\n2\n3\n4\n5\n6\n7\n
<div>\n  {{yield (hash\n    Title=this.Title\n    Subtitle=this.Subtitle\n    Body=(component this.Body defaultArg="some value")\n  )}}\n</div>
\n
\n
\n \n

Result:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<div>\n  <h1>Banner title</h1>\n  <h2>Banner subtitle</h2>\n  A load of body text\n</div>
\n
\n
\n \n

A benefit of using this pattern is that the user of the component can change the order the components are displayed.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n4\n5\n
<Banner @value={{@model}} as |banner|>\n  <banner.Subtitle>Banner subtitle</banner.Subtitle>\n  <banner.Title>Banner title</banner.Title>\n  <banner.Body>A load of body text</banner.Body>\n</Banner>
\n
\n
\n \n

Result:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<div>\n  <h2>Banner subtitle</h2>\n  <h1>Banner title</h1>\n  A load of body text\n</div>
\n
\n
\n \n

Another benefit to using yield with the hash and component helper\nis you can pass attributes and arguments to these components:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n2\n3\n4\n5\n
<Banner @value={{@model}} as |banner|>\n  <banner.Subtitle class="mb-1">Banner subtitle</banner.Subtitle>\n  <banner.Title @variant="loud">Banner title</banner.Title>\n  <banner.Body>A load of body text</banner.Body>\n</Banner>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/banner/subtitle.hbs
1\n2\n3\n4\n
{{!-- note the use of ..attributes --}}\n<h2 ...attributes>\n  {{yield}}\n</h2>
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/banner/title.hbs
1\n2\n3\n4\n5\n
{{#if (eq @variant "loud")}}\n    <h1 class="loud">{{yield}}</h1>\n{{else}}\n    <h1 class="quiet">{{yield}}</h1>\n{{/if}}
\n
\n
\n \n

Result:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
<div>\n  <h2 class="mb-1">Banner subtitle</h2>\n  <h1 class="loud">Banner title</h1>\n  A load of body text\n</div>
\n
\n
\n \n", + "itemtype": "method", + "name": "yield", + "params": [ + { + "name": "options", + "description": "", + "type": "Hash" + } + ], + "return": { + "description": "HTML string", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/index.ts", + "line": 303, + "description": "

{{(has-block)}} indicates if the component was invoked with a block.

\n

This component is invoked with a block:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#my-component}}\n  Hi Jen!\n{{/my-component}}
\n
\n
\n \n

This component is invoked without a block:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component}}
\n
\n
\n \n

Using angle bracket invocation, this looks like:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyComponent>Hi Jen!</MyComponent> {{! with a block}}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<MyComponent/> {{! without a block}}
\n
\n
\n \n

This is useful when you want to create a component that can optionally take a block\nand then render a default template when it is not invoked with a block.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.hbs
1\n2\n3\n4\n5\n
{{#if (has-block)}}\n  Welcome {{yield}}, we are happy you're here!\n{{else}}\n  Hey you! You're great!\n{{/if}}
\n
\n
\n \n", + "itemtype": "method", + "name": "has-block", + "params": [ + { + "name": "the", + "description": "name of the block. The name (at the moment) is either \"main\" or \"inverse\" (though only curly components support inverse)", + "type": "String" + } + ], + "return": { + "description": "`true` if the component was invoked with a block", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/index.ts", + "line": 348, + "description": "

{{(has-block-params)}} indicates if the component was invoked with block params.

\n

This component is invoked with block params:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#my-component as |favoriteFlavor|}}\n  Hi Jen!\n{{/my-component}}
\n
\n
\n \n

This component is invoked without block params:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#my-component}}\n  Hi Jenn!\n{{/my-component}}
\n
\n
\n \n

With angle bracket syntax, block params look like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<MyComponent as |favoriteFlavor|>\n  Hi Jen!\n</MyComponent>
\n
\n
\n \n

And without block params:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<MyComponent>\n  Hi Jen!\n</MyComponent>
\n
\n
\n \n

This is useful when you want to create a component that can render itself\ndifferently when it is not invoked with block params.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.hbs
1\n2\n3\n4\n5\n6\n7\n
{{#if (has-block-params)}}\n  Welcome {{yield this.favoriteFlavor}}, we're happy you're here and hope you\n  enjoy your favorite ice cream flavor.\n{{else}}\n  Welcome {{yield}}, we're happy you're here, but we're unsure what\n  flavor ice cream you would enjoy.\n{{/if}}
\n
\n
\n \n", + "itemtype": "method", + "name": "has-block-params", + "params": [ + { + "name": "the", + "description": "name of the block. The name (at the moment) is either \"main\" or \"inverse\" (though only curly components support inverse)", + "type": "String" + } + ], + "return": { + "description": "`true` if the component was invoked with block params", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/glimmer/index.ts", + "line": 403, + "description": "

Execute the debugger statement in the current template's context.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{debugger}}
\n
\n
\n \n

When using the debugger helper you will have access to a get function. This\nfunction retrieves values available in the context of the template.\nFor example, if you're wondering why a value {{foo}} isn't rendering as\nexpected within a template, you could place a {{debugger}} statement and,\nwhen the debugger; breakpoint is hit, you can attempt to retrieve this value:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
> get('foo')
\n
\n
\n

get is also aware of keywords. So in this situation

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#each this.items as |item|}}\n  {{debugger}}\n{{/each}}
\n
\n
\n \n

You'll be able to get values from the current item:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
> get('item.name')
\n
\n
\n

You can also access the context of the view to make sure it is the object that\nyou expect:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
> context
\n
\n
\n ", + "itemtype": "method", + "name": "debugger", + "access": "public", + "tagname": "", + "class": "Ember.Templates.helpers", + "module": "ember" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.Test.QUnitAdapter.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.Test.QUnitAdapter.json new file mode 100644 index 000000000..d80176dc7 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.Test.QUnitAdapter.json @@ -0,0 +1,96 @@ +{ + "data": { + "id": "ember-5.3.0-Ember.Test.QUnitAdapter", + "type": "class", + "attributes": { + "name": "Ember.Test.QUnitAdapter", + "shortname": "Ember.Test.QUnitAdapter", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "Ember.Test", + "file": "packages/ember-testing/lib/adapters/qunit.ts", + "line": 17, + "description": "

This class implements the methods defined by TestAdapter for the\nQUnit testing framework.

\n", + "extends": "TestAdapter", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/ember-testing/lib/adapters/adapter.ts", + "line": 20, + "description": "

This callback will be called whenever an async operation is about to start.

\n

Override this to call your framework's methods that handle async\noperations.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "asyncStart", + "class": "Ember.Test.QUnitAdapter", + "module": "@ember/test", + "inherited": true, + "inheritedFrom": "TestAdapter" + }, + { + "file": "packages/ember-testing/lib/adapters/adapter.ts", + "line": 31, + "description": "

This callback will be called whenever an async operation has completed.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "asyncEnd", + "class": "Ember.Test.QUnitAdapter", + "module": "@ember/test", + "inherited": true, + "inheritedFrom": "TestAdapter" + }, + { + "file": "packages/ember-testing/lib/adapters/adapter.ts", + "line": 39, + "description": "

Override this method with your testing framework's false assertion.\nThis function is called whenever an exception occurs causing the testing\npromise to fail.

\n

QUnit example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
  exception: function(error) {\n    ok(false, error);\n  };
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "exception", + "params": [ + { + "name": "error", + "description": "The exception to be raised.", + "type": "String" + } + ], + "class": "Ember.Test.QUnitAdapter", + "module": "@ember/test", + "inherited": true, + "inheritedFrom": "TestAdapter" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-5.3.0-TestAdapter", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.Test.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.Test.json new file mode 100644 index 000000000..a3b9ba60c --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.Test.json @@ -0,0 +1,147 @@ +{ + "data": { + "id": "ember-5.3.0-Ember.Test", + "type": "class", + "attributes": { + "name": "Ember.Test", + "shortname": "Ember.Test", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "Ember", + "file": "packages/ember-testing/lib/test.ts", + "line": 11, + "description": "

This is a container for an assortment of testing related functionality:

\n
    \n
  • Choose your default test adapter (for your framework of choice).
  • \n
  • Register/Unregister additional test helpers.
  • \n
  • Setup callbacks to be fired when the test helpers are injected into\nyour application.
  • \n
\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/ember-testing/lib/test/on_inject_helpers.ts", + "line": 5, + "description": "

Used to register callbacks to be fired whenever App.injectTestHelpers\nis called.

\n

The callback will receive the current application as an argument.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import $ from 'jquery';\n\nEmber.Test.onInjectHelpers(function() {\n  $(document).ajaxSend(function() {\n    Test.pendingRequests++;\n  });\n\n  $(document).ajaxComplete(function() {\n    Test.pendingRequests--;\n  });\n});
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "onInjectHelpers", + "params": [ + { + "name": "callback", + "description": "The function to be called.", + "type": "Function" + } + ], + "class": "Ember.Test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/promise.ts", + "line": 32, + "description": "

This returns a thenable tailored for testing. It catches failed\nonSuccess callbacks and invokes the Ember.Test.adapter.exception\ncallback in the last chained then.

\n

This method should be returned by async helpers such as wait.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "promise", + "params": [ + { + "name": "resolver", + "description": "The function used to resolve the promise.", + "type": "Function" + }, + { + "name": "label", + "description": "An optional string for identifying the promise.", + "type": "String" + } + ], + "class": "Ember.Test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/promise.ts", + "line": 50, + "description": "

Replacement for Ember.RSVP.resolve\nThe only difference is this uses\nan instance of Ember.Test.Promise

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "resolve", + "params": [ + { + "name": "The", + "description": "value to resolve", + "type": "Mixed" + } + ], + "since": "1.2.0", + "class": "Ember.Test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/setup_for_testing.ts", + "line": 8, + "description": "

Sets Ember up for testing. This is useful to perform\nbasic setup steps in order to unit test.

\n

Use App.setupForTesting to perform integration tests (full\napplication testing).

\n", + "itemtype": "method", + "name": "setupForTesting", + "since": "1.5.0", + "access": "private", + "tagname": "", + "class": "Ember.Test", + "module": "@ember/test", + "namespace": "Ember" + } + ], + "events": [], + "properties": [ + { + "file": "packages/ember-testing/lib/test.ts", + "line": 24, + "description": "

Hash containing all known test helpers.

\n", + "itemtype": "property", + "name": "_helpers", + "access": "private", + "tagname": "", + "since": "1.7.0", + "class": "Ember.Test", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/ember-testing/lib/test.ts", + "line": 45, + "description": "

Used to allow ember-testing to communicate with a specific testing\nframework.

\n

You can manually set it before calling App.setupForTesting().

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
Ember.Test.adapter = MyCustomAdapter.create()
\n
\n
\n \n

If you do not set it, ember-testing will default to Ember.Test.QUnitAdapter.

\n", + "access": "public", + "tagname": "", + "itemtype": "property", + "name": "adapter", + "type": "{Class} The adapter to be used.", + "default": "Ember.Test.QUnitAdapter", + "class": "Ember.Test", + "module": "ember", + "namespace": "Ember" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.ViewMixin.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.ViewMixin.json new file mode 100644 index 000000000..ebc890416 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.ViewMixin.json @@ -0,0 +1,322 @@ +{ + "data": { + "id": "ember-5.3.0-Ember.ViewMixin", + "type": "class", + "attributes": { + "name": "Ember.ViewMixin", + "shortname": "Ember.ViewMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Component" + ], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 15, + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 93, + "description": "

Return the nearest ancestor that is an instance of the provided\nclass or mixin.

\n", + "itemtype": "method", + "name": "nearestOfType", + "params": [ + { + "name": "klass", + "description": "Subclass of Ember.View (or Ember.View itself),\nor an instance of Mixin.", + "type": "Class,Mixin" + } + ], + "return": { + "description": "Ember.View" + }, + "deprecated": true, + "deprecationMessage": "use `yield` and contextual components for composition instead.", + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 121, + "description": "

Return the nearest ancestor that has a given property.

\n", + "itemtype": "method", + "name": "nearestWithProperty", + "params": [ + { + "name": "property", + "description": "A property name", + "type": "String" + } + ], + "return": { + "description": "Ember.View" + }, + "deprecated": true, + "deprecationMessage": "use `yield` and contextual components for composition instead.", + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 141, + "description": "

Renders the view again. This will work regardless of whether the\nview is already in the DOM or not. If the view is in the DOM, the\nrendering process will be deferred to give bindings a chance\nto synchronize.

\n

If children were added during the rendering process using appendChild,\nrerender will remove them, because they will be added again\nif needed by the next render.

\n

In general, if the display of your view changes, you should modify\nthe DOM element directly instead of manually calling rerender, which can\nbe slow.

\n", + "itemtype": "method", + "name": "rerender", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 181, + "description": "

Appends the view's element to the specified parent element.

\n

Note that this method just schedules the view to be appended; the DOM\nelement will not be appended to the given element until all bindings have\nfinished synchronizing.

\n

This is not typically a function that you will need to call directly when\nbuilding your application. If you do need to use appendTo, be sure that\nthe target element you are providing is associated with an Application\nand does not have an ancestor element that is associated with an Ember view.

\n", + "itemtype": "method", + "name": "appendTo", + "params": [ + { + "name": "A", + "description": "selector, element, HTML string", + "type": "String|DOMElement" + } + ], + "return": { + "description": "receiver", + "type": "Ember.View" + }, + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 246, + "description": "

Appends the view's element to the document body. If the view does\nnot have an HTML representation yet\nthe element will be generated automatically.

\n

If your application uses the rootElement property, you must append\nthe view within that element. Rendering views outside of the rootElement\nis not supported.

\n

Note that this method just schedules the view to be appended; the DOM\nelement will not be appended to the document body until all bindings have\nfinished synchronizing.

\n", + "itemtype": "method", + "name": "append", + "return": { + "description": "receiver", + "type": "Ember.View" + }, + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 331, + "description": "

You must call destroy on a view to destroy the view (and all of its\nchild views). This will remove the view from any parent node, then make\nsure that the DOM element managed by the view can be released by the\nmemory manager.

\n", + "itemtype": "method", + "name": "destroy", + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 405, + "description": "

Setup a view, but do not finish waking it up.

\n
    \n
  • configure childViews
  • \n
  • register the view with the global views hash, which is used for event\ndispatch
  • \n
\n", + "itemtype": "method", + "name": "init", + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 439, + "description": "

Handle events from EventDispatcher

\n", + "itemtype": "method", + "name": "handleEvent", + "params": [ + { + "name": "eventName", + "description": "", + "type": "String" + }, + { + "name": "evt", + "description": "", + "type": "Event" + } + ], + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + } + ], + "events": [ + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 300, + "description": "

Called when a view is going to insert an element into the DOM.

\n", + "itemtype": "event", + "name": "willInsertElement", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 308, + "description": "

Called when the element of the view has been inserted into the DOM.\nOverride this function to do any set up that requires an element\nin the document body.

\n

When a view has children, didInsertElement will be called on the\nchild view(s) first and on itself afterwards.

\n", + "itemtype": "event", + "name": "didInsertElement", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 321, + "description": "

Called when the view is about to rerender, but before anything has\nbeen torn down. This is a good opportunity to tear down any manual\nobservers you have installed based on the DOM state

\n", + "itemtype": "event", + "name": "willClearRender", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 345, + "description": "

Called when the element of the view is going to be destroyed. Override\nthis function to do any teardown that requires an element, like removing\nevent listeners.

\n

Please note: any property changes made during this event will have no\neffect on object observers.

\n", + "itemtype": "event", + "name": "willDestroyElement", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 358, + "description": "

Called after the element of the view is destroyed.

\n", + "itemtype": "event", + "name": "willDestroyElement", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 366, + "description": "

Called when the parentView property has changed.

\n", + "itemtype": "event", + "name": "parentViewDidChange", + "access": "private", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + } + ], + "properties": [ + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 35, + "description": "

A list of properties of the view to apply as attributes. If the property\nis a string value, the value of that string will be applied as the value\nfor an attribute of the property's name.

\n

The following example creates a tag like <div priority="high" />.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['priority'],\n   priority: 'high'\n });
\n
\n
\n \n

If the value of the property is a Boolean, the attribute is treated as\nan HTML Boolean attribute. It will be present if the property is true\nand omitted if the property is false.

\n

The following example creates markup like <div visible />.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['visible'],\n   visible: true\n });
\n
\n
\n \n

If you would prefer to use a custom value instead of the property name,\nyou can create the same markup as the last example with a binding like\nthis:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   attributeBindings: ['isVisible:visible'],\n   isVisible: true\n });
\n
\n
\n \n

This list of attributes is inherited from the component's superclasses,\nas well.

\n", + "itemtype": "property", + "name": "attributeBindings", + "type": "Array", + "default": "[]", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 166, + "description": "

Returns the current DOM element for the view.

\n", + "itemtype": "property", + "name": "element", + "type": "DOMElement", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 267, + "description": "

The HTML id of the view's element in the DOM. You can provide this\nvalue yourself but it must be unique (just as in HTML):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{my-component elementId="a-really-cool-id"}}
\n
\n
\n \n

If not manually set a default value will be provided by the framework.

\n

Once rendered an element's elementId is considered immutable and you\nshould never change it. If you need to compute a dynamic value for the\nelementId, you should do this when the component or element is being\ninstantiated:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Component from '@ember/component';\n\nexport default Component.extend({\n   init() {\n     this._super(...arguments);\n     let index = this.get('index');\n     this.set('elementId', 'component-id' + index);\n   }\n });
\n
\n
\n \n", + "itemtype": "property", + "name": "elementId", + "type": "String", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + }, + { + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 378, + "description": "

Tag name for the view's outer element. The tag name is only used when an\nelement is first created. If you change the tagName for an element, you\nmust destroy and recreate the view element.

\n

By default, the render buffer will use a <div> tag for views.

\n

If the tagName is '', the view will be tagless, with no outer element.\nComponent properties that depend on the presence of an outer element, such\nas classNameBindings and attributeBindings, do not work with tagless\ncomponents. Tagless components cannot implement methods to handle events,\nand their element property has a null value.

\n", + "itemtype": "property", + "name": "tagName", + "type": "String", + "default": "null", + "access": "public", + "tagname": "", + "class": "Ember.ViewMixin", + "module": "ember", + "namespace": "Ember" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.json new file mode 100644 index 000000000..d022029e5 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-Ember.json @@ -0,0 +1,196 @@ +{ + "data": { + "id": "ember-5.3.0-Ember", + "type": "class", + "attributes": { + "name": "Ember", + "shortname": "Ember", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/utils", + "namespace": "", + "methods": [ + { + "file": "packages/@ember/-internals/meta/lib/meta.ts", + "line": 673, + "description": "

Retrieves the meta hash for an object. If writable is true ensures the\nhash is writable for this object as well.

\n

The meta object contains information about computed property descriptors as\nwell as any watched properties and other information. You generally will\nnot access this information directly but instead work with higher level\nmethods that manipulate this hash indirectly.

\n", + "itemtype": "method", + "name": "meta", + "access": "private", + "tagname": "", + "params": [ + { + "name": "obj", + "description": "The object to retrieve meta for", + "type": "Object" + }, + { + "name": "writable", + "description": "Pass `false` if you do not intend to modify\n the meta hash, allowing the method to avoid making an unnecessary copy.", + "type": "Boolean", + "optional": true, + "optdefault": "true" + } + ], + "return": { + "description": "the meta hash for an object", + "type": "Object" + }, + "class": "Ember", + "module": "ember" + }, + { + "file": "packages/@ember/-internals/utils/lib/invoke.ts", + "line": 1, + "description": "

Checks to see if the methodName exists on the obj.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let foo = { bar: function() { return 'bar'; }, baz: null };\n\nEmber.canInvoke(foo, 'bar'); // true\nEmber.canInvoke(foo, 'baz'); // false\nEmber.canInvoke(foo, 'bat'); // false
\n
\n
\n \n", + "itemtype": "method", + "name": "canInvoke", + "params": [ + { + "name": "obj", + "description": "The object to check for the method", + "type": "Object" + }, + { + "name": "methodName", + "description": "The method name to check for", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Ember", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/utils/lib/spec.ts", + "line": 1, + "description": "

Returns whether Type(value) is Object.

\n

Useful for checking whether a value is a valid WeakMap key.

\n

Refs: https://tc39.github.io/ecma262/#sec-typeof-operator-runtime-semantics-evaluation\n https://tc39.github.io/ecma262/#sec-weakmap.prototype.set

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "isObject", + "class": "Ember", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/-internals/utils/lib/super.ts", + "line": 73, + "description": "

Wraps the passed function so that this._super will point to the superFunc\nwhen the function is invoked. This is the primitive we use to implement\ncalls to super.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "wrap", + "params": [ + { + "name": "func", + "description": "The function to call", + "type": "Function" + }, + { + "name": "superFunc", + "description": "The super function.", + "type": "Function" + } + ], + "return": { + "description": "wrapped function.", + "type": "Function" + }, + "class": "Ember", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/routing/lib/controller_for.ts", + "line": 9, + "description": "

Finds a controller instance.

\n", + "itemtype": "method", + "name": "controllerFor", + "access": "private", + "tagname": "", + "class": "Ember", + "module": "ember/routing" + }, + { + "file": "packages/@ember/routing/lib/generate_controller.ts", + "line": 11, + "description": "

Generates a controller factory

\n", + "itemtype": "method", + "name": "generateControllerFactory", + "access": "private", + "tagname": "", + "class": "Ember", + "module": "ember/routing" + }, + { + "file": "packages/@ember/routing/lib/generate_controller.ts", + "line": 52, + "description": "

Generates and instantiates a controller extending from controller:basic\nif present, or Controller if not.

\n", + "itemtype": "method", + "name": "generateController", + "access": "private", + "tagname": "", + "since": "1.3.0", + "class": "Ember", + "module": "ember/routing" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/utils/lib/guid.ts", + "line": 26, + "description": "

Prefix used for guids through out Ember.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "GUID_PREFIX", + "type": "String", + "final": 1, + "class": "Ember", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/utils/lib/guid.ts", + "line": 39, + "description": "

A unique key used to assign guids and other private metadata to objects.\nIf you inspect an object in your browser debugger you will often see these.\nThey can be safely ignored.

\n

On browsers that support it, these properties are added with enumeration\ndisabled so they won't show up when you iterate over your properties.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "GUID_KEY", + "type": "String", + "final": 1, + "class": "Ember", + "module": "@ember/object" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/utils", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-EmberArray.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-EmberArray.json new file mode 100644 index 000000000..812889684 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-EmberArray.json @@ -0,0 +1,836 @@ +{ + "data": { + "id": "ember-5.3.0-EmberArray", + "type": "class", + "attributes": { + "name": "EmberArray", + "shortname": "EmberArray", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "MutableArray" + ], + "module": "@ember/array", + "namespace": "", + "file": "packages/@ember/array/index.ts", + "line": 219, + "description": "

This mixin implements Observer-friendly Array-like behavior. It is not a\nconcrete implementation, but it can be used up by other classes that want\nto appear like arrays.

\n

For example, ArrayProxy is a concrete class that can be instantiated to\nimplement array-like behavior. This class uses the Array Mixin by way of\nthe MutableArray mixin, which allows observable changes to be made to the\nunderlying array.

\n

This mixin defines methods specifically for collections that provide\nindex-ordered access to their contents. When you are designing code that\nneeds to accept any kind of Array-like object, you should use these methods\ninstead of Array primitives because these will properly notify observers of\nchanges to the array.

\n

Although these methods are efficient, they do add a layer of indirection to\nyour application so it is a good idea to use them only when you need the\nflexibility of using both true JavaScript arrays and "virtual" arrays such\nas controllers and collections.

\n

You can use the methods defined in this module to access and modify array\ncontents in an observable-friendly way. You can also be notified whenever\nthe membership of an array changes by using .observes('myArray.[]').

\n

To support EmberArray in your own class, you must override two\nprimitives to use it: length() and objectAt().

\n", + "uses": [ + "Enumerable" + ], + "since": "Ember 0.9.0", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/array/index.ts", + "line": 263, + "description": "

Returns the object at the given index. If the given index is negative\nor is greater or equal than the array length, returns undefined.

\n

This is one of the primitives you must implement to support EmberArray.\nIf your object supports retrieving the value of an array item using get()\n(i.e. myArray.get(0)), then you do not need to implement this method\nyourself.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectAt(0);   // 'a'\narr.objectAt(3);   // 'd'\narr.objectAt(-1);  // undefined\narr.objectAt(4);   // undefined\narr.objectAt(5);   // undefined
\n
\n
\n \n", + "itemtype": "method", + "name": "objectAt", + "params": [ + { + "name": "idx", + "description": "The index of the item to return.", + "type": "Number" + } + ], + "return": { + "description": "item at index or undefined", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 288, + "description": "

This returns the objects at the specified indexes, using objectAt.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectsAt([0, 1, 2]);  // ['a', 'b', 'c']\narr.objectsAt([2, 3, 4]);  // ['c', 'd', undefined]
\n
\n
\n \n", + "itemtype": "method", + "name": "objectsAt", + "params": [ + { + "name": "indexes", + "description": "An array of indexes of items to return.", + "type": "Array" + } + ], + "return": { + "description": "", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 354, + "description": "

Returns a new array that is a slice of the receiver. This implementation\nuses the observable array methods to retrieve the objects for the new\nslice.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = ['red', 'green', 'blue'];\n\narr.slice(0);       // ['red', 'green', 'blue']\narr.slice(0, 2);    // ['red', 'green']\narr.slice(1, 100);  // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "slice", + "params": [ + { + "name": "beginIndex", + "description": "(Optional) index to begin slicing from.", + "type": "Number" + }, + { + "name": "endIndex", + "description": "(Optional) index to end the slice at (but not included).", + "type": "Number" + } + ], + "return": { + "description": "New array with specified slice", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 374, + "description": "

Used to determine the passed object's first occurrence in the array.\nReturns the index if found, -1 if no match is found.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.indexOf('a');       //  0\narr.indexOf('z');       // -1\narr.indexOf('a', 2);    //  4\narr.indexOf('a', -1);   //  4, equivalent to indexOf('a', 4)\narr.indexOf('a', -100); //  0, searches entire array\narr.indexOf('b', 3);    // -1\narr.indexOf('a', 100);  // -1\n\nlet people = [{ name: 'Zoey' }, { name: 'Bob' }]\nlet newPerson = { name: 'Tom' };\npeople = [newPerson, ...people, newPerson];\n\npeople.indexOf(newPerson);     //  0\npeople.indexOf(newPerson, 1);  //  3\npeople.indexOf(newPerson, -4); //  0\npeople.indexOf(newPerson, 10); // -1
\n
\n
\n \n", + "itemtype": "method", + "name": "indexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "index or -1 if not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 412, + "description": "

Returns the index of the given object's last occurrence.

\n
    \n
  • If no startAt argument is given, the search starts from\nthe last position.
  • \n
  • If it's greater than or equal to the length of the array,\nthe search starts from the last position.
  • \n
  • If it's negative, it is taken as the offset from the end\nof the array i.e. startAt + array.length.
  • \n
  • If it's any other positive number, will search backwards\nfrom that index of the array.
  • \n
\n

Returns -1 if no match is found.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.lastIndexOf('a');       //  4\narr.lastIndexOf('z');       // -1\narr.lastIndexOf('a', 2);    //  0\narr.lastIndexOf('a', -1);   //  4\narr.lastIndexOf('a', -3);   //  0\narr.lastIndexOf('b', 3);    //  1\narr.lastIndexOf('a', 100);  //  4
\n
\n
\n \n", + "itemtype": "method", + "name": "lastIndexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search from\nbackwards, defaults to `(array.length - 1)`", + "type": "Number" + } + ], + "return": { + "description": "The last index of the `object` in the array or -1\nif not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 447, + "description": "

Iterates through the array, calling the passed function on each\nitem. This method corresponds to the forEach() method defined in\nJavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
let foods = [\n  { name: 'apple', eaten: false },\n  { name: 'banana', eaten: false },\n  { name: 'carrot', eaten: false }\n];\n\nfoods.forEach((food) => food.eaten = true);\n\nlet output = '';\nfoods.forEach((item, index, array) =>\n  output += `${index + 1}/${array.length} ${item.name}\\n`;\n);\nconsole.log(output);\n// 1/3 apple\n// 2/3 banana\n// 3/3 carrot
\n
\n
\n \n", + "itemtype": "method", + "name": "forEach", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 498, + "description": "

Alias for mapBy.

\n

Returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.getEach('name');\n// ['Joe', 'Matt'];\n\npeople.getEach('nonexistentProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "getEach", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 520, + "description": "

Sets the value on the named property for each member. This is more\nergonomic than using other methods defined on this helper. If the object\nimplements Observable, the value will be changed to set(), otherwise\nit will be set directly. null objects are skipped.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.setEach('zipCode', '10011');\n// [{name: 'Joe', zipCode: '10011'}, {name: 'Matt', zipCode: '10011'}];
\n
\n
\n \n", + "itemtype": "method", + "name": "setEach", + "params": [ + { + "name": "key", + "description": "The key to set", + "type": "String" + }, + { + "name": "value", + "description": "The object to set", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 540, + "description": "

Maps all of the items in the enumeration to another value, returning\na new array. This method corresponds to map() defined in JavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
function(item, index, array);\nlet arr = [1, 2, 3, 4, 5, 6];\n\narr.map(element => element * element);\n// [1, 4, 9, 16, 25, 36];\n\narr.map((element, index) => element + index);\n// [1, 3, 5, 7, 9, 11];
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the mapped value.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n", + "itemtype": "method", + "name": "map", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 578, + "description": "

Similar to map, this specialized function returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.mapBy('name');\n// ['Joe', 'Matt'];\n\npeople.mapBy('unknownProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "mapBy", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 599, + "description": "

Returns a new array with all of the items in the enumeration that the provided\ncallback function returns true for. This method corresponds to Array.prototype.filter().

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All parameters are optional. The function should return true to include the item\nin the results, and false otherwise.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nlet people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n\npeople.filter(isAdult); // returns [{ name: 'Joan', age: 45 }];
\n
\n
\n \n

Note that in addition to a callback, you can pass an optional target object\nthat will be set as this on the context. This is a good way to give your\niterator function access to the current object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
function isAdultAndEngineer(person) {\n  return person.age > 18 && this.engineering;\n}\n\nclass AdultsCollection {\n  engineering = false;\n\n  constructor(opts = {}) {\n    super(...arguments);\n\n    this.engineering = opts.engineering;\n    this.people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n  }\n}\n\nlet collection = new AdultsCollection({ engineering: true });\ncollection.people.filter(isAdultAndEngineer, { target: collection });
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A filtered array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 662, + "description": "

Returns an array with all of the items in the enumeration where the passed\nfunction returns false. This method is the inverse of filter().

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration
  • \n
  • array is the array itself.
  • \n
\n

It should return a falsey value to include the item in the results.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as "this" on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\nconst nonFruits = food.reject(function(thing) {\n  return thing.isFruit;\n}); // [{food: 'bread', isFruit: false}]
\n
\n
\n \n", + "itemtype": "method", + "name": "reject", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A rejected array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 706, + "description": "

Filters the array by the property and an optional value. If a value is given, it returns\nthe items that have said value for the property. If not, it returns all the items that\nhave a truthy value for the property.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let things = Ember.A([{ food: 'apple', isFruit: true }, { food: 'beans', isFruit: false }]);\n\nthings.filterBy('food', 'beans'); // [{ food: 'beans', isFruit: false }]\nthings.filterBy('isFruit'); // [{ food: 'apple', isFruit: true }]
\n
\n
\n \n", + "itemtype": "method", + "name": "filterBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "filtered array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 727, + "description": "

Returns an array with the items that do not have truthy values for the provided key.\nYou can pass an optional second argument with a target value to reject for the key.\nOtherwise this will reject objects where the provided property evaluates to false.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
  let food = [\n    { name: "apple", isFruit: true },\n    { name: "carrot", isFruit: false },\n    { name: "bread", isFruit: false },\n  ];\n  food.rejectBy('isFruit'); // [{ name: "carrot", isFruit: false }, { name: "bread", isFruit: false }]\n  food.rejectBy('name', 'carrot'); // [{ name: "apple", isFruit: true }}, { name: "bread", isFruit: false }]
\n
\n
\n \n", + "itemtype": "method", + "name": "rejectBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "rejected array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 751, + "description": "

Returns the first item in the array for which the callback returns true.\nThis method is similar to the find() method defined in ECMAScript 2015.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the true to include the item in the results, false\notherwise.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let users = [\n  { id: 1, name: 'Yehuda' },\n  { id: 2, name: 'Tom' },\n  { id: 3, name: 'Melanie' },\n  { id: 4, name: 'Leah' }\n];\n\nusers.find((user) => user.name == 'Tom'); // [{ id: 2, name: 'Tom' }]\nusers.find(({ id }) => id == 3); // [{ id: 3, name: 'Melanie' }]
\n
\n
\n \n", + "itemtype": "method", + "name": "find", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Found item or `undefined`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 801, + "description": "

Returns the first item with a property matching the passed value. You\ncan pass an optional second argument with the target value. Otherwise\nthis will match any property that evaluates to true.

\n

This method works much like the more generic find() method.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
let users = [\n  { id: 1, name: 'Yehuda', isTom: false },\n  { id: 2, name: 'Tom', isTom: true },\n  { id: 3, name: 'Melanie', isTom: false },\n  { id: 4, name: 'Leah', isTom: false }\n];\n\nusers.findBy('id', 4); // { id: 4, name: 'Leah', isTom: false }\nusers.findBy('name', 'Melanie'); // { id: 3, name: 'Melanie', isTom: false }\nusers.findBy('isTom'); // { id: 2, name: 'Tom', isTom: true }
\n
\n
\n \n", + "itemtype": "method", + "name": "findBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "found item or `undefined`", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 831, + "description": "

Returns true if the passed function returns true for every item in the\nenumeration. This corresponds with the Array.prototype.every() method defined in ES5.

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All params are optional. The method should return true or false.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nconst people = Ember.A([{ name: 'John', age: 24 }, { name: 'Joan', age: 45 }]);\nconst areAllAdults = people.every(isAdult);
\n
\n
\n \n", + "itemtype": "method", + "name": "every", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 872, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for all items in the array. This method is often simpler/faster\nthan using a callback.

\n

Note that like the native Array.every, isEvery will return true when called\non any empty array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
class Language {\n  constructor(name, isProgrammingLanguage) {\n    this.name = name;\n    this.programmingLanguage = isProgrammingLanguage;\n  }\n}\n\nconst compiledLanguages = [\n  new Language('Java', true),\n  new Language('Go', true),\n  new Language('Rust', true)\n]\n\nconst languagesKnownByMe = [\n  new Language('Javascript', true),\n  new Language('English', false),\n  new Language('Ruby', true)\n]\n\ncompiledLanguages.isEvery('programmingLanguage'); // true\nlanguagesKnownByMe.isEvery('programmingLanguage'); // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isEvery", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 912, + "description": "

The any() method executes the callback function once for each element\npresent in the array until it finds the one where callback returns a truthy\nvalue (i.e. true). If such an element is found, any() immediately returns\ntrue. Otherwise, any() returns false.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array object itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. It can be a good way\nto give your iterator function access to an object in cases where an ES6\narrow function would not be appropriate.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let includesManager = people.any(this.findPersonInManagersList, this);\n\nlet includesStockHolder = people.any(person => {\n  return this.findPersonInStockHoldersList(person)\n});\n\nif (includesManager || includesStockHolder) {\n  Paychecks.addBiggerBonus();\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "any", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "`true` if the passed function returns `true` for any item", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 955, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for any item in the array. This method is often simpler/faster\nthan using a callback.

\n

Example usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\n\nfood.isAny('isFruit'); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isAny", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 981, + "description": "

This will combine the values of the array into a single value. It\nis a useful way to collect a summary value from an array. This\ncorresponds to the reduce() method defined in JavaScript 1.8.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(previousValue, item, index, array);
\n
\n
\n \n
    \n
  • previousValue is the value returned by the last call to the iterator.
  • \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Return the new cumulative value.

\n

In addition to the callback you can also pass an initialValue. An error\nwill be raised if you do not pass an initial value and the enumerator is\nempty.

\n

Note that unlike the other methods, this method does not allow you to\npass a target object to set as this for the callback. It's part of the\nspec. Sorry.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
  let numbers = [1, 2, 3, 4, 5];\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }); // 15 (1 + 2 + 3 + 4 + 5)\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }, -15); // 0 (-15 + 1 + 2 + 3 + 4 + 5)\n\n\n  let binaryValues = [true, false, false];\n\n  binaryValues.reduce(function(truthValue, current) {\n    return truthValue && current;\n  }); // false (true && false && false)
\n
\n
\n \n", + "itemtype": "method", + "name": "reduce", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "initialValue", + "description": "Initial value for the reduce", + "type": "Object" + } + ], + "return": { + "description": "The reduced value.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1039, + "description": "

Invokes the named method on every object in the receiver that\nimplements it. This method corresponds to the implementation in\nPrototype 1.6.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
class Person {\n  name = null;\n\n  constructor(name) {\n    this.name = name;\n  }\n\n  greet(prefix='Hello') {\n    return `${prefix} ${this.name}`;\n  }\n}\n\nlet people = [new Person('Joe'), new Person('Matt')];\n\npeople.invoke('greet'); // ['Hello Joe', 'Hello Matt']\npeople.invoke('greet', 'Bonjour'); // ['Bonjour Joe', 'Bonjour Matt']
\n
\n
\n \n", + "itemtype": "method", + "name": "invoke", + "params": [ + { + "name": "methodName", + "description": "the name of the method", + "type": "String" + }, + { + "name": "args", + "description": "optional arguments to pass as well.", + "type": "Object..." + } + ], + "return": { + "description": "return values from calling invoke.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1073, + "description": "

Simply converts the object into a genuine array. The order is not\nguaranteed. Corresponds to the method implemented by Prototype.

\n", + "itemtype": "method", + "name": "toArray", + "return": { + "description": "the object as an array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1082, + "description": "

Returns a copy of the array with all null and undefined elements removed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', null, 'c', undefined];\narr.compact();  // ['a', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "compact", + "return": { + "description": "the array without null and undefined elements.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1095, + "description": "

Used to determine if the array contains the passed object.\nReturns true if found, false otherwise.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n

This method has the same behavior of JavaScript's Array.includes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
[1, 2, 3].includes(2);     // true\n[1, 2, 3].includes(4);     // false\n[1, 2, 3].includes(3, 2);  // true\n[1, 2, 3].includes(3, 3);  // false\n[1, 2, 3].includes(3, -1); // true\n[1, 2, 3].includes(1, -1); // false\n[1, 2, 3].includes(1, -4); // true\n[1, 2, NaN].includes(NaN); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "includes", + "params": [ + { + "name": "object", + "description": "The object to search for.", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "`true` if object is found in the array.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1125, + "description": "

Sorts the array by the keys specified in the argument.

\n

You may provide multiple arguments to sort by multiple properties.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
   let colors = [\n { name: 'red', weight: 500 },\n { name: 'green', weight: 600 },\n { name: 'blue', weight: 500 }\n];\n\n   colors.sortBy('name');\n   // [{name: 'blue', weight: 500}, {name: 'green', weight: 600}, {name: 'red', weight: 500}]\n\n   colors.sortBy('weight', 'name');\n   // [{name: 'blue', weight: 500}, {name: 'red', weight: 500}, {name: 'green', weight: 600}]
\n
\n
\n \n", + "itemtype": "method", + "name": "sortBy", + "params": [ + { + "name": "property", + "description": "name(s) to sort on", + "type": "String" + } + ], + "return": { + "description": "The sorted array.", + "type": "Array" + }, + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1150, + "description": "

Returns a new array that contains only unique values. The default\nimplementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'a', 'b', 'b'];\narr.uniq();  // ['a', 'b']
\n
\n
\n \n

This only works on primitive data types, e.g. Strings, Numbers, etc.

\n", + "itemtype": "method", + "name": "uniq", + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1166, + "description": "

Returns a new array that contains only items containing a unique property value.\nThe default implementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }];\narr.uniqBy('value');  // [{ value: 'a' }, { value: 'b' }]\n\nlet arr = [2.2, 2.1, 3.2, 3.3];\narr.uniqBy(Math.floor);  // [2.2, 3.2];
\n
\n
\n \n", + "itemtype": "method", + "name": "uniqBy", + "params": [ + { + "name": "key", + "description": "", + "type": "String,Function" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1185, + "description": "

Returns a new array that excludes the passed value. The default\nimplementation returns an array regardless of the receiver type.\nIf the receiver does not contain the value it returns the original array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'b', 'a', 'c'];\narr.without('a');  // ['b', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "without", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/array/index.ts", + "line": 253, + "description": "

Required. You must implement this method to apply this mixin.

\n

Your array must support the length property. Your replace methods should\nset this property whenever it changes.

\n", + "itemtype": "property", + "name": "length", + "type": "Number", + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 304, + "description": "

This is the handler for the special array content property. If you get\nthis property, it will return this. If you set this property to a new\narray, it will replace the current content.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let peopleToMoon = ['Armstrong', 'Aldrin'];\n\npeopleToMoon.get('[]'); // ['Armstrong', 'Aldrin']\n\npeopleToMoon.set('[]', ['Collins']); // ['Collins']\npeopleToMoon.get('[]'); // ['Collins']
\n
\n
\n \n", + "itemtype": "property", + "name": "[]", + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 324, + "description": "

The first object in the array, or undefined if the array is empty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let vowels = ['a', 'e', 'i', 'o', 'u'];\nvowels.firstObject; // 'a'\n\nvowels.shiftObject();\nvowels.firstObject; // 'e'\n\nvowels.reverseObjects();\nvowels.firstObject; // 'u'\n\nvowels.clear();\nvowels.firstObject; // undefined
\n
\n
\n \n", + "itemtype": "property", + "name": "firstObject", + "return": { + "description": "The first object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 346, + "description": "

The last object in the array, or undefined if the array is empty.

\n", + "itemtype": "property", + "name": "lastObject", + "return": { + "description": "The last object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "EmberArray", + "module": "@ember/array" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/array", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-EmberENV.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-EmberENV.json new file mode 100644 index 000000000..7ea8c5c3d --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-EmberENV.json @@ -0,0 +1,151 @@ +{ + "data": { + "id": "ember-5.3.0-EmberENV", + "type": "class", + "attributes": { + "name": "EmberENV", + "shortname": "EmberENV", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "rsvp", + "namespace": "", + "file": "packages/@ember/-internals/environment/lib/env.ts", + "line": 4, + "description": "

The hash of environment variables used to control various configuration\nsettings. To specify your own or override default settings, add the\ndesired properties to a global hash named EmberENV (or ENV for\nbackwards compatibility with earlier versions of Ember). The EmberENV\nhash must be created before loading Ember.

\n", + "type": "Object", + "access": "public", + "tagname": "", + "methods": [], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/environment/lib/env.ts", + "line": 18, + "description": "

Determines whether Ember should add to Array\nnative object prototypes, a few extra methods in order to provide a more\nfriendly API.

\n

We generally recommend leaving this option set to true however, if you need\nto turn it off, you can add the configuration property\nEXTEND_PROTOTYPES to EmberENV and set it to false.

\n

Note, when disabled (the default configuration for Ember Addons), you will\ninstead have to access all methods and functions from the Ember\nnamespace.

\n", + "itemtype": "property", + "name": "EXTEND_PROTOTYPES", + "type": "Boolean", + "default": "true", + "access": "public", + "tagname": "", + "class": "EmberENV", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/environment/lib/env.ts", + "line": 41, + "description": "

The LOG_STACKTRACE_ON_DEPRECATION property, when true, tells Ember to log\na full stack trace during deprecation warnings.

\n", + "itemtype": "property", + "name": "LOG_STACKTRACE_ON_DEPRECATION", + "type": "Boolean", + "default": "true", + "access": "public", + "tagname": "", + "class": "EmberENV", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/environment/lib/env.ts", + "line": 53, + "description": "

The LOG_VERSION property, when true, tells Ember to log versions of all\ndependent libraries in use.

\n", + "itemtype": "property", + "name": "LOG_VERSION", + "type": "Boolean", + "default": "true", + "access": "public", + "tagname": "", + "class": "EmberENV", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/environment/lib/env.ts", + "line": 69, + "description": "

Whether to insert a <div class="ember-view" /> wrapper around the\napplication template. See RFC #280.

\n

This is not intended to be set directly, as the implementation may change in\nthe future. Use @ember/optional-features instead.

\n", + "itemtype": "property", + "name": "_APPLICATION_TEMPLATE_WRAPPER", + "type": "Boolean", + "default": "true", + "access": "private", + "tagname": "", + "class": "EmberENV", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/environment/lib/env.ts", + "line": 84, + "description": "

Whether to use Glimmer Component semantics (as opposed to the classic "Curly"\ncomponents semantics) for template-only components. See RFC #278.

\n

This is not intended to be set directly, as the implementation may change in\nthe future. Use @ember/optional-features instead.

\n", + "itemtype": "property", + "name": "_TEMPLATE_ONLY_GLIMMER_COMPONENTS", + "type": "Boolean", + "default": "false", + "access": "private", + "tagname": "", + "class": "EmberENV", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/environment/lib/env.ts", + "line": 99, + "description": "

Whether to perform extra bookkeeping needed to make the captureRenderTree\nAPI work.

\n

This has to be set before the ember JavaScript code is evaluated. This is\nusually done by setting window.EmberENV = { _DEBUG_RENDER_TREE: true };\nbefore the "vendor" <script> tag in index.html.

\n

Setting the flag after Ember is already loaded will not work correctly. It\nmay appear to work somewhat, but fundamentally broken.

\n

This is not intended to be set directly. Ember Inspector will enable the\nflag on behalf of the user as needed.

\n

This flag is always on in development mode.

\n

The flag is off by default in production mode, due to the cost associated\nwith the the bookkeeping work.

\n

The expected flow is that Ember Inspector will ask the user to refresh the\npage after enabling the feature. It could also offer a feature where the\nuser add some domains to the "always on" list. In either case, Ember\nInspector will inject the code on the page to set the flag if needed.

\n", + "itemtype": "property", + "name": "_DEBUG_RENDER_TREE", + "type": "Boolean", + "default": "false", + "access": "private", + "tagname": "", + "class": "EmberENV", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/environment/lib/env.ts", + "line": 131, + "description": "

Whether the app defaults to using async observers.

\n

This is not intended to be set directly, as the implementation may change in\nthe future. Use @ember/optional-features instead.

\n", + "itemtype": "property", + "name": "_DEFAULT_ASYNC_OBSERVERS", + "type": "Boolean", + "default": "false", + "access": "private", + "tagname": "", + "class": "EmberENV", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/environment/lib/env.ts", + "line": 145, + "description": "

Controls the maximum number of scheduled rerenders without "settling". In general,\napplications should not need to modify this environment variable, but please\nopen an issue so that we can determine if a better default value is needed.

\n", + "itemtype": "property", + "name": "_RERENDER_LOOP_LIMIT", + "type": "number", + "default": "1000", + "access": "private", + "tagname": "", + "class": "EmberENV", + "module": "rsvp" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-rsvp", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-EmberObject.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-EmberObject.json new file mode 100644 index 000000000..739275984 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-EmberObject.json @@ -0,0 +1,600 @@ +{ + "data": { + "id": "ember-5.3.0-EmberObject", + "type": "class", + "attributes": { + "name": "EmberObject", + "shortname": "EmberObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/object/index.ts", + "line": 30, + "description": "

EmberObject is the main base class for all Ember objects. It is a subclass\nof CoreObject with the Observable mixin applied. For details,\nsee the documentation for each of these.

\n", + "extends": "CoreObject", + "uses": [ + "Observable" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/object/core.ts", + "line": 322, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 541, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 568, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 576, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 164, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 212, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 229, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 247, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 333, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 354, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 371, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 388, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 403, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 433, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 453, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 497, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/object/core.ts", + "line": 356, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 430, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 505, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 523, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "EmberObject", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-5.3.0-CoreObject", + "type": "class" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-5.3.0-Ember.EventDispatcher" + }, + { + "type": "class", + "id": "ember-5.3.0-Ember.CoreView" + }, + { + "type": "class", + "id": "ember-5.3.0-Namespace" + }, + { + "type": "class", + "id": "ember-5.3.0-ArrayProxy" + }, + { + "type": "class", + "id": "ember-5.3.0-Ember.Controller" + }, + { + "type": "class", + "id": "ember-5.3.0-ContainerDebugAdapter" + }, + { + "type": "class", + "id": "ember-5.3.0-DataAdapter" + }, + { + "type": "class", + "id": "ember-5.3.0-EngineInstance" + }, + { + "type": "class", + "id": "ember-5.3.0-ObjectProxy" + }, + { + "type": "class", + "id": "ember-5.3.0-HashLocation" + }, + { + "type": "class", + "id": "ember-5.3.0-HistoryLocation" + }, + { + "type": "class", + "id": "ember-5.3.0-NoneLocation" + }, + { + "type": "class", + "id": "ember-5.3.0-Route" + }, + { + "type": "class", + "id": "ember-5.3.0-EmberRouter" + }, + { + "type": "class", + "id": "ember-5.3.0-Service" + } + ] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/object", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-EmberRouter.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-EmberRouter.json new file mode 100644 index 000000000..7837e9e5c --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-EmberRouter.json @@ -0,0 +1,1192 @@ +{ + "data": { + "id": "ember-5.3.0-EmberRouter", + "type": "class", + "attributes": { + "name": "EmberRouter", + "shortname": "EmberRouter", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing/router", + "namespace": "", + "file": "packages/@ember/routing/router.ts", + "line": 145, + "description": "

The EmberRouter class manages the application state and URLs. Refer to\nthe routing guide for documentation.

\n", + "extends": "EmberObject", + "uses": [ + "Evented" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/routing/router.ts", + "line": 224, + "description": "

The Router.map function allows you to define mappings from URLs to routes\nin your application. These mappings are defined within the\nsupplied callback function using this.route.

\n

The first parameter is the name of the route which is used by default as the\npath name as well.

\n

The second parameter is the optional options hash. Available options are:

\n
    \n
  • path: allows you to provide your own path as well as mark dynamic\nsegments.
  • \n
  • resetNamespace: false by default; when nesting routes, ember will\ncombine the route names to form the fully-qualified route name, which is\nused with {{link-to}} or manually transitioning to routes. Setting\nresetNamespace: true will cause the route not to inherit from its\nparent route's names. This is handy for preventing extremely long route names.\nKeep in mind that the actual URL path behavior is still retained.
  • \n
\n

The third parameter is a function, which can be used to nest routes.\nNested routes, by default, will have the parent route tree's route name and\npath prepended to it's own.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n
Router.map(function(){\n  this.route('post', { path: '/post/:post_id' }, function() {\n    this.route('edit');\n    this.route('comments', { resetNamespace: true }, function() {\n      this.route('new');\n    });\n  });\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "map", + "params": [ + { + "name": "callback", + "description": "" + } + ], + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 559, + "description": "

Initializes the current router instance and sets up the change handling\nevent listeners used by the instances location implementation.

\n

A property named initialURL will be used to determine the initial URL.\nIf no value is found / will be used.

\n", + "itemtype": "method", + "name": "startRouting", + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 705, + "description": "

Transition the application into another route. The route may\nbe either a single route or route path:

\n", + "itemtype": "method", + "name": "transitionTo", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 750, + "description": "

Similar to transitionTo, but instead of adding the destination to the browser's URL history,\nit replaces the entry for the current route.\nWhen the user clicks the "back" button in the browser, there will be fewer steps.\nThis is most commonly used to manage redirects in a way that does not cause confusing additions\nto the user's browsing history.

\n", + "itemtype": "method", + "name": "replaceWith", + "params": [ + { + "name": "name", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 777, + "description": "

Determines if the supplied route is currently active.

\n", + "itemtype": "method", + "name": "isActive", + "params": [ + { + "name": "routeName", + "description": "" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 789, + "description": "

An alternative form of isActive that doesn't require\nmanual concatenation of the arguments into a single\narray.

\n", + "itemtype": "method", + "name": "isActiveIntent", + "params": [ + { + "name": "routeName", + "description": "" + }, + { + "name": "models", + "description": "" + }, + { + "name": "queryParams", + "description": "" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "since": "1.7.0", + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 815, + "description": "

Does this router instance have the given route.

\n", + "itemtype": "method", + "name": "hasRoute", + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 826, + "description": "

Resets the state of the router by clearing the current route\nhandlers and deactivating them.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "reset", + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 925, + "description": "

Serializes the given query params according to their QP meta information.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_serializeQueryParams", + "params": [ + { + "name": "routeInfos", + "description": "", + "type": "Arrray" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 955, + "description": "

Serializes the value of a query parameter based on a type

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_serializeQueryParam", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + }, + { + "name": "type", + "description": "", + "type": "String" + } + ], + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 973, + "description": "

Deserializes the given query params according to their QP meta information.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_deserializeQueryParams", + "params": [ + { + "name": "routeInfos", + "description": "", + "type": "Array" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 1001, + "description": "

Deserializes the value of a query parameter based on a default type

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_deserializeQueryParam", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + }, + { + "name": "defaultType", + "description": "", + "type": "String" + } + ], + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 1022, + "description": "

Removes (prunes) any query params with default values from the given QP\nobject. Default values are determined from the QP meta information per key.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_pruneDefaultQueryParamValues", + "params": [ + { + "name": "routeInfos", + "description": "", + "type": "Array" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 1103, + "description": "

Prepares the query params for a URL or Transition. Restores any undefined QP\nkeys/values, serializes all values, and then prunes any default values.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_prepareQueryParams", + "params": [ + { + "name": "targetRouteName", + "description": "", + "type": "String" + }, + { + "name": "models", + "description": "", + "type": "Array" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + }, + { + "name": "keepDefaultQueryParamValues", + "description": "", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 1130, + "description": "

Returns the meta information for the query params of a given route. This\nwill be overridden to allow support for lazy routes.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_getQPMeta", + "params": [ + { + "name": "routeInfo", + "description": "", + "type": "RouteInfo" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 1144, + "description": "

Returns a merged query params meta object for a given set of routeInfos.\nUseful for knowing what query params are available for a given route hierarchy.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_queryParamsFor", + "params": [ + { + "name": "routeInfos", + "description": "", + "type": "Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 1206, + "description": "

Maps all query param keys to their fully scoped property name of the form\ncontrollerName:propName.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_fullyScopeQueryParams", + "params": [ + { + "name": "leafRouteName", + "description": "", + "type": "String" + }, + { + "name": "contexts", + "description": "", + "type": "Array" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 1248, + "description": "

Hydrates (adds/restores) any query params that have pre-existing values into\nthe given queryParams hash. This is what allows query params to be "sticky"\nand restore their last known values for their scope.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_hydrateUnsuppliedQueryParams", + "params": [ + { + "name": "state", + "description": "", + "type": "TransitionState" + }, + { + "name": "queryParams", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 1419, + "description": "

Handles updating the paths and notifying any listeners of the URL\nchange.

\n

Triggers the router level didTransition hook.

\n

For example, to notify google analytics when the route changes,\nyou could use this hook. (Note: requires also including GA scripts, etc.)

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import config from './config/environment';\nimport EmberRouter from '@ember/routing/router';\nimport { service } from '@ember/service';\n\nlet Router = EmberRouter.extend({\n  location: config.locationType,\n\n  router: service(),\n\n  didTransition: function() {\n    this._super(...arguments);\n\n    ga('send', 'pageview', {\n      page: this.router.currentURL,\n      title: this.router.currentRouteName,\n    });\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "didTransition", + "access": "private", + "tagname": "", + "since": "1.2.0", + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 1456, + "description": "

Handles notifying any listeners of an impending URL\nchange.

\n

Triggers the router level willTransition hook.

\n", + "itemtype": "method", + "name": "willTransition", + "access": "private", + "tagname": "", + "since": "1.11.0", + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 51, + "description": "

Subscribes to a named event with given function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
person.on('didLoad', function() {\n  // fired once the person has loaded\n});
\n
\n
\n \n

An optional target can be passed in as the 2nd argument that will\nbe set as the "this" for the callback. This is a good way to give your\nfunction access to the object triggering the event. When the target\nparameter is used the callback method becomes the third argument.

\n", + "itemtype": "method", + "name": "on", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 78, + "description": "

Subscribes a function to a named event and then cancels the subscription\nafter the first time the event is triggered. It is good to use one when\nyou only care about the first time an event has taken place.

\n

This function takes an optional 2nd argument that will become the "this"\nvalue for the callback. When the target parameter is used the callback method\nbecomes the third argument.

\n", + "itemtype": "method", + "name": "one", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 100, + "description": "

Triggers a named event for the object. Any additional arguments\nwill be passed as parameters to the functions that are subscribed to the\nevent.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
person.on('didEat', function(food) {\n  console.log('person ate some ' + food);\n});\n\nperson.trigger('didEat', 'broccoli');\n\n// outputs: person ate some broccoli
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "args", + "description": "Optional arguments to pass on", + "type": "Object..." + } + ], + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 121, + "description": "

Cancels subscription for given name, target, and method.

\n", + "itemtype": "method", + "name": "off", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The target of the subscription", + "type": "Object" + }, + { + "name": "method", + "description": "The function or the name of a function of the subscription", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 137, + "description": "

Checks to see if object has any subscriptions for named event.

\n", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + } + ], + "return": { + "description": "does the object have a subscription for event", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 322, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 541, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 568, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 576, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 164, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 212, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 229, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 247, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 333, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 354, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 371, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 388, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 403, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 433, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 453, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 497, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/routing/router.ts", + "line": 155, + "description": "

Represents the URL of the root of the application, often '/'. This prefix is\n assumed on all routes defined on this router.

\n", + "itemtype": "property", + "name": "rootURL", + "default": "'/'", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 166, + "description": "

The location property determines the type of URL's that your\n application will use.

\n

The following location types are currently available:

\n
    \n
  • history - use the browser's history API to make the URLs look just like any standard URL

    \n
  • \n
  • hash - use # to separate the server part of the URL from the Ember part: /blog/#/posts/new

    \n
  • \n
  • none - do not store the Ember URL in the actual browser URL (mainly used for testing)

    \n
  • \n
  • auto - use the best option based on browser capabilities: history if possible, then hash if possible, otherwise none

    \n

    This value is defaulted to history by the locationType setting of /config/environment.js

    \n
  • \n
\n", + "itemtype": "property", + "name": "location", + "default": "'hash'", + "see": [ + "{Location}" + ], + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/routing/router.ts", + "line": 1469, + "description": "

Represents the current URL.

\n", + "itemtype": "property", + "name": "url", + "type": "{String}", + "access": "private", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/routing/router" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 356, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 430, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 505, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 523, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "EmberRouter", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-5.3.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/routing/router", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-Engine.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-Engine.json new file mode 100644 index 000000000..cb46bd3e4 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-Engine.json @@ -0,0 +1,273 @@ +{ + "data": { + "id": "ember-5.3.0-Engine", + "type": "class", + "attributes": { + "name": "Engine", + "shortname": "Engine", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/engine", + "namespace": "", + "file": "packages/@ember/engine/index.ts", + "line": 40, + "description": "

The Engine class contains core functionality for both applications and\nengines.

\n

Each engine manages a registry that's used for dependency injection and\nexposed through RegistryProxy.

\n

Engines also manage initializers and instance initializers.

\n

Engines can spawn EngineInstance instances via buildInstance().

\n", + "extends": "Ember.Namespace", + "uses": [ + "RegistryProxyMixin" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/engine/index.ts", + "line": 62, + "description": "

The goal of initializers should be to register dependencies and injections.\nThis phase runs once. Because these initializers may load code, they are\nallowed to defer application readiness and advance it. If you need to access\nthe container or store you should use an InstanceInitializer that will be run\nafter all initializers and therefore after all code is loaded and the app is\nready.

\n

Initializer receives an object which has the following attributes:\nname, before, after, initialize. The only required attribute is\ninitialize, all others are optional.

\n
    \n
  • name allows you to specify under which name the initializer is registered.\nThis must be a unique name, as trying to register two initializers with the\nsame name will result in an error.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
initializer.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Running namedInitializer!');\n}\n\nexport default {\n  name: 'named-initializer',\n  initialize\n};
\n
\n
\n \n
    \n
  • before and after are used to ensure that this initializer is ran prior\nor after the one identified by the value. This value can be a single string\nor an array of strings, referencing the name of other initializers.
  • \n
\n

An example of ordering initializers, we create an initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/first.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('First initializer!');\n}\n\nexport default {\n  name: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n
// DEBUG: First initializer!
\n
\n
\n \n

We add another initializer named second, specifying that it should run\nafter the initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/second.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Second initializer!');\n}\n\nexport default {\n  name: 'second',\n  after: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
// DEBUG: First initializer!\n// DEBUG: Second initializer!
\n
\n
\n

Afterwards we add a further initializer named pre, this time specifying\nthat it should run before the initializer named first:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/pre.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Pre initializer!');\n}\n\nexport default {\n  name: 'pre',\n  before: 'first',\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
// DEBUG: Pre initializer!\n// DEBUG: First initializer!\n// DEBUG: Second initializer!
\n
\n
\n \n

Finally we add an initializer named post, specifying it should run after\nboth the first and the second initializers:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/initializer/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Post initializer!');\n}\n\nexport default {\n  name: 'post',\n  after: ['first', 'second'],\n  initialize\n};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
// DEBUG: Pre initializer!\n// DEBUG: First initializer!\n// DEBUG: Second initializer!\n// DEBUG: Post initializer!
\n
\n
\n \n
    \n
  • initialize is a callback function that receives one argument,\napplication, on which you can operate.
  • \n
\n

Example of using application to register an adapter:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
adapter.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import ApiAdapter from '../utils/api-adapter';\n\nexport function initialize(application) {\n  application.register('api-adapter:main', ApiAdapter);\n}\n\nexport default {\n  name: 'post',\n  after: ['first', 'second'],\n  initialize\n};
\n
\n
\n \n", + "itemtype": "method", + "name": "initializer", + "params": [ + { + "name": "initializer", + "description": "", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 209, + "description": "

Instance initializers run after all initializers have run. Because\ninstance initializers run after the app is fully set up. We have access\nto the store, container, and other items. However, these initializers run\nafter code has loaded and are not allowed to defer readiness.

\n

Instance initializer receives an object which has the following attributes:\nname, before, after, initialize. The only required attribute is\ninitialize, all others are optional.

\n
    \n
  • name allows you to specify under which name the instanceInitializer is\nregistered. This must be a unique name, as trying to register two\ninstanceInitializer with the same name will result in an error.
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
initializer.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import { debug } from '@ember/debug';\n\nexport function initialize() {\n  debug('Running named-instance-initializer!');\n}\n\nexport default {\n  name: 'named-instance-initializer',\n  initialize\n};
\n
\n
\n \n
    \n
  • before and after are used to ensure that this initializer is ran prior\nor after the one identified by the value. This value can be a single string\nor an array of strings, referencing the name of other initializers.

    \n
  • \n
  • See Application.initializer for discussion on the usage of before\nand after.

    \n
  • \n
\n

Example instanceInitializer to preload data into the store.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
data.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n
export function initialize(application) {\n    var userConfig, userConfigEncoded, store;\n    // We have a HTML escaped JSON representation of the user's basic\n    // configuration generated server side and stored in the DOM of the main\n    // index.html file. This allows the app to have access to a set of data\n    // without making any additional remote calls. Good for basic data that is\n    // needed for immediate rendering of the page. Keep in mind, this data,\n    // like all local models and data can be manipulated by the user, so it\n    // should not be relied upon for security or authorization.\n\n    // Grab the encoded data from the meta tag\n    userConfigEncoded = document.querySelector('head meta[name=app-user-config]').attr('content');\n\n    // Unescape the text, then parse the resulting JSON into a real object\n    userConfig = JSON.parse(unescape(userConfigEncoded));\n\n    // Lookup the store\n    store = application.lookup('service:store');\n\n    // Push the encoded JSON into the store\n    store.pushPayload(userConfig);\n}\n\nexport default {\n  name: 'named-instance-initializer',\n  initialize\n};
\n
\n
\n \n", + "itemtype": "method", + "name": "instanceInitializer", + "params": [ + { + "name": "instanceInitializer", + "description": "" + } + ], + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 285, + "description": "

This creates a registry with the default Ember naming conventions.

\n

It also configures the registry:

\n
    \n
  • registered views are created every time they are looked up (they are\nnot singletons)
  • \n
  • registered templates are not factories; the registered value is\nreturned directly.
  • \n
  • the router receives the application as its namespace property
  • \n
  • all controllers receive the router as their target and controllers\nproperties
  • \n
  • all controllers receive the application as their namespace property
  • \n
  • the application view receives the application controller as its\ncontroller property
  • \n
  • the application view receives the application template as its\ndefaultTemplate property
  • \n
\n", + "itemtype": "method", + "name": "buildRegistry", + "static": 1, + "params": [ + { + "name": "namespace", + "description": "the application for which to\n build the registry", + "type": "Application" + } + ], + "return": { + "description": "the built registry", + "type": "Ember.Registry" + }, + "access": "private", + "tagname": "", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 346, + "description": "

Ensure that initializers are run once, and only once, per engine.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "ensureInitializers", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 359, + "description": "

Create an EngineInstance for this engine.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "buildInstance", + "return": { + "description": "the engine instance", + "type": "EngineInstance" + }, + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 371, + "description": "

Build and configure the registry for the current engine.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "buildRegistry", + "return": { + "description": "the configured registry", + "type": "Ember.Registry" + }, + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 384, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "initializer", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 392, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "instanceInitializer", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 400, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "runInitializers", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 414, + "access": "private", + "tagname": "", + "since": "1.12.0", + "itemtype": "method", + "name": "runInstanceInitializers", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 448, + "description": "

This function defines the default lookup rules for container lookups:

\n
    \n
  • templates are looked up on Ember.TEMPLATES
  • \n
  • other names are looked up on the application after classifying the name.\nFor example, controller:post looks up App.PostController by default.
  • \n
  • if the default lookup fails, look for registered classes on the container
  • \n
\n

This allows the application to register default injections in the container\nthat could be overridden by the normal naming convention.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "resolverFor", + "params": [ + { + "name": "namespace", + "description": "the namespace to look for classes", + "type": "Ember.Enginer" + } + ], + "return": { + "description": "the resolved value for a given lookup", + "type": "*" + }, + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 107, + "description": "

Registers a factory that can be used for dependency injection (with\ninject) or for service lookup. Each factory is registered with\na full name including two parts: type:name.

\n

A simple example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Orange = EmberObject.extend();\nApp.register('fruit:favorite', App.Orange);
\n
\n
\n \n

Ember will resolve factories from the App namespace automatically.\nFor example App.CarsController will be discovered and returned if\nan application requests controller:cars.

\n

An example of registering a controller with a non-standard name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Application from '@ember/application';\nimport Controller from '@ember/controller';\n\nlet App = Application.create();\nlet Session = Controller.extend();\n\nApp.register('controller:session', Session);\n\n// The Session controller can now be treated like a normal controller,\n// despite its non-standard name.\nApp.ApplicationController = Controller.extend({\n  needs: ['session']\n});
\n
\n
\n \n

Registered factories are instantiated by having create\ncalled on them. Additionally they are singletons, each time\nthey are looked up they return the same instance.

\n

Some examples modifying that default behavior:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Person = EmberObject.extend();\nApp.Orange = EmberObject.extend();\nApp.Email = EmberObject.extend();\nApp.session = EmberObject.create();\n\nApp.register('model:user', App.Person, { singleton: false });\nApp.register('fruit:favorite', App.Orange);\nApp.register('communication:main', App.Email, { singleton: false });\nApp.register('session', App.session, { instantiate: false });
\n
\n
\n \n", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "type:name (e.g., 'model:user')", + "type": "String" + }, + { + "name": "factory", + "description": "(e.g., App.Person)", + "type": "Factory|object" + }, + { + "name": "options", + "description": "(optional) disable instantiation or singleton usage", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/owner", + "inherited": true, + "inheritedFrom": "BasicRegistry" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/engine/index.ts", + "line": 325, + "description": "

Set this to provide an alternate class to DefaultResolver

\n", + "itemtype": "property", + "name": "resolver", + "access": "public", + "tagname": "", + "class": "Engine", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/index.ts", + "line": 338, + "description": "

A private flag indicating whether an engine's initializers have run yet.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_initializersRan", + "class": "Engine", + "module": "@ember/engine" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "Ember.Namespace", + "type": "missing" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-5.3.0-Application" + } + ] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/engine", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-EngineInstance.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-EngineInstance.json new file mode 100644 index 000000000..48f314464 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-EngineInstance.json @@ -0,0 +1,754 @@ +{ + "data": { + "id": "ember-5.3.0-EngineInstance", + "type": "class", + "attributes": { + "name": "EngineInstance", + "shortname": "EngineInstance", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/engine", + "namespace": "", + "file": "packages/@ember/engine/instance.ts", + "line": 36, + "description": "

The EngineInstance encapsulates all of the stateful aspects of a\nrunning Engine.

\n", + "access": "public", + "tagname": "", + "extends": "EmberObject", + "uses": [ + "RegistryProxyMixin", + "ContainerProxyMixin" + ], + "methods": [ + { + "file": "packages/@ember/engine/instance.ts", + "line": 56, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setupRegistry", + "params": [ + { + "name": "registry", + "description": "", + "type": "Registry" + }, + { + "name": "options", + "description": "", + "type": "BootOptions" + } + ], + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 107, + "description": "

Initialize the EngineInstance and return a promise that resolves\nwith the instance itself when the boot process is complete.

\n

The primary task here is to run any registered instance initializers.

\n

See the documentation on BootOptions for the options it takes.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "boot", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 173, + "description": "

Unregister a factory.

\n

Overrides RegistryProxy#unregister in order to clear any cached instances\nof the unregistered factory.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 190, + "description": "

Build a new EngineInstance that's a child of this instance.

\n

Engines must be registered by name with their parent engine\n(or application).

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "buildChildEngineInstance", + "params": [ + { + "name": "name", + "description": "the registered name of the engine.", + "type": "String" + }, + { + "name": "options", + "description": "options provided to the engine instance.", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EngineInstance,Error" + }, + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/engine/instance.ts", + "line": 220, + "description": "

Clone dependencies shared between an engine instance and its parent.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "cloneParentDependencies", + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 322, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 541, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 568, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 576, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 164, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 212, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 229, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 247, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 333, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 354, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 371, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 388, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 403, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 433, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 453, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 497, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 107, + "description": "

Registers a factory that can be used for dependency injection (with\ninject) or for service lookup. Each factory is registered with\na full name including two parts: type:name.

\n

A simple example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Orange = EmberObject.extend();\nApp.register('fruit:favorite', App.Orange);
\n
\n
\n \n

Ember will resolve factories from the App namespace automatically.\nFor example App.CarsController will be discovered and returned if\nan application requests controller:cars.

\n

An example of registering a controller with a non-standard name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Application from '@ember/application';\nimport Controller from '@ember/controller';\n\nlet App = Application.create();\nlet Session = Controller.extend();\n\nApp.register('controller:session', Session);\n\n// The Session controller can now be treated like a normal controller,\n// despite its non-standard name.\nApp.ApplicationController = Controller.extend({\n  needs: ['session']\n});
\n
\n
\n \n

Registered factories are instantiated by having create\ncalled on them. Additionally they are singletons, each time\nthey are looked up they return the same instance.

\n

Some examples modifying that default behavior:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Person = EmberObject.extend();\nApp.Orange = EmberObject.extend();\nApp.Email = EmberObject.extend();\nApp.session = EmberObject.create();\n\nApp.register('model:user', App.Person, { singleton: false });\nApp.register('fruit:favorite', App.Orange);\nApp.register('communication:main', App.Email, { singleton: false });\nApp.register('session', App.session, { instantiate: false });
\n
\n
\n \n", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "type:name (e.g., 'model:user')", + "type": "String" + }, + { + "name": "factory", + "description": "(e.g., App.Person)", + "type": "Factory|object" + }, + { + "name": "options", + "description": "(optional) disable instantiation or singleton usage", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/owner", + "inherited": true, + "inheritedFrom": "BasicRegistry" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 198, + "description": "

Given a fullName return a corresponding instance.

\n

The default behavior is for lookup to return a singleton instance.\nThe singleton is scoped to the container, allowing multiple containers\nto all have their own locally scoped singletons.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter');\n\ntwitter instanceof Twitter; // => true\n\n// by default the container will return singletons\nlet twitter2 = container.lookup('api:twitter');\ntwitter2 instanceof Twitter; // => true\n\ntwitter === twitter2; //=> true
\n
\n
\n \n

If singletons are not wanted an optional flag can be provided at lookup.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter', { singleton: false });\nlet twitter2 = container.lookup('api:twitter', { singleton: false });\n\ntwitter === twitter2; //=> false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "lookup", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "RegisterOptions" + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "EngineInstance", + "module": "@ember/owner", + "inherited": true, + "inheritedFrom": "BasicContainer" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 247, + "description": "

Given a FullName, of the form "type:name" return a FactoryManager.

\n

This method returns a manager which can be used for introspection of the\nfactory's class or for the creation of factory instances with initial\nproperties. The manager is an object with the following properties:

\n
    \n
  • class - The registered or resolved class.
  • \n
  • create - A function that will create an instance of the class with\nany dependencies injected.
  • \n
\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(otherInstance);\n// the owner is commonly the `applicationInstance`, and can be accessed via\n// an instance initializer.\n\nlet factory = owner.factoryFor('service:bespoke');\n\nfactory.class;\n// The registered or resolved class. For example when used with an Ember-CLI\n// app, this would be the default export from `app/services/bespoke.js`.\n\nlet instance = factory.create({\n  someProperty: 'an initial property value'\n});\n// Create an instance with any injections and the passed options as\n// initial properties.
\n
\n
\n \n

Any instances created via the factory's .create() method must be destroyed\nmanually by the caller of .create(). Typically, this is done during the creating\nobjects own destroy or willDestroy methods.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "factoryFor", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "FactoryManager" + }, + "class": "EngineInstance", + "module": "@ember/owner", + "inherited": true, + "inheritedFrom": "BasicContainer" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/engine/instance.ts", + "line": 68, + "description": "

The base Engine for which this is an instance.

\n", + "itemtype": "property", + "name": "engine", + "type": "Engine", + "access": "private", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/engine" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 25, + "description": "

The container stores state.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "__container__", + "type": "Ember.Container", + "class": "EngineInstance", + "module": "ember", + "inherited": true, + "inheritedFrom": "ContainerProxyMixin" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 356, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 430, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 505, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 523, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "EngineInstance", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-5.3.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-5.3.0-ApplicationInstance" + } + ] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/engine", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-Enumerable.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-Enumerable.json new file mode 100644 index 000000000..26c32d7c9 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-Enumerable.json @@ -0,0 +1,48 @@ +{ + "data": { + "id": "ember-5.3.0-Enumerable", + "type": "class", + "attributes": { + "name": "Enumerable", + "shortname": "Enumerable", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "EmberArray", + "Ember.MutableEnumerable" + ], + "module": "@ember/enumerable", + "namespace": "", + "file": "packages/@ember/enumerable/index.ts", + "line": 8, + "description": "

The methods in this mixin have been moved to MutableArray. This mixin has\nbeen intentionally preserved to avoid breaking Enumerable.detect checks\nuntil the community migrates away from them.

\n", + "access": "private", + "tagname": "", + "methods": [], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/enumerable", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-EventTarget.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-EventTarget.json new file mode 100644 index 000000000..ad088f0b8 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-EventTarget.json @@ -0,0 +1,68 @@ +{ + "data": { + "id": "ember-5.3.0-EventTarget", + "type": "class", + "attributes": { + "name": "EventTarget", + "shortname": "EventTarget", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "rsvp", + "namespace": "", + "file": "node_modules/rsvp/lib/rsvp/events.js", + "line": 12, + "access": "public", + "tagname": "", + "methods": [ + { + "file": "node_modules/rsvp/lib/rsvp/events.js", + "line": 73, + "description": "

Registers a callback to be executed when eventName is triggered

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
object.on('event', function(eventInfo){\n  // handle the event\n});\n\nobject.trigger('event');
\n
\n
\n \n", + "itemtype": "method", + "name": "on", + "access": "private", + "tagname": "", + "params": [ + { + "name": "eventName", + "description": "name of the event to listen for", + "type": "String" + }, + { + "name": "callback", + "description": "function to be called when the event is triggered.", + "type": "Function" + } + ], + "class": "EventTarget", + "module": "rsvp" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-rsvp", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-Evented.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-Evented.json new file mode 100644 index 000000000..2b895bba3 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-Evented.json @@ -0,0 +1,190 @@ +{ + "data": { + "id": "ember-5.3.0-Evented", + "type": "class", + "attributes": { + "name": "Evented", + "shortname": "Evented", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Ember.CoreView", + "Route", + "EmberRouter" + ], + "module": "@ember/object/evented", + "namespace": "", + "file": "packages/@ember/object/evented.ts", + "line": 10, + "description": "

This mixin allows for Ember objects to subscribe to and emit events.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/utils/person.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import EmberObject from '@ember/object';\nimport Evented from '@ember/object/evented';\n\nexport default EmberObject.extend(Evented, {\n  greet() {\n    // ...\n    this.trigger('greet');\n  }\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
var person = Person.create();\n\nperson.on('greet', function() {\n  console.log('Our person has greeted');\n});\n\nperson.greet();\n\n// outputs: 'Our person has greeted'
\n
\n
\n \n

You can also chain multiple event subscriptions:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
person.on('greet', function() {\n  console.log('Our person has greeted');\n}).one('greet', function() {\n  console.log('Offer one-time special');\n}).off('event', this, forgetThis);
\n
\n
\n \n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/object/evented.ts", + "line": 51, + "description": "

Subscribes to a named event with given function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
person.on('didLoad', function() {\n  // fired once the person has loaded\n});
\n
\n
\n \n

An optional target can be passed in as the 2nd argument that will\nbe set as the "this" for the callback. This is a good way to give your\nfunction access to the object triggering the event. When the target\nparameter is used the callback method becomes the third argument.

\n", + "itemtype": "method", + "name": "on", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Evented", + "module": "@ember/object/evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 78, + "description": "

Subscribes a function to a named event and then cancels the subscription\nafter the first time the event is triggered. It is good to use one when\nyou only care about the first time an event has taken place.

\n

This function takes an optional 2nd argument that will become the "this"\nvalue for the callback. When the target parameter is used the callback method\nbecomes the third argument.

\n", + "itemtype": "method", + "name": "one", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Evented", + "module": "@ember/object/evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 100, + "description": "

Triggers a named event for the object. Any additional arguments\nwill be passed as parameters to the functions that are subscribed to the\nevent.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
person.on('didEat', function(food) {\n  console.log('person ate some ' + food);\n});\n\nperson.trigger('didEat', 'broccoli');\n\n// outputs: person ate some broccoli
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "args", + "description": "Optional arguments to pass on", + "type": "Object..." + } + ], + "access": "public", + "tagname": "", + "class": "Evented", + "module": "@ember/object/evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 121, + "description": "

Cancels subscription for given name, target, and method.

\n", + "itemtype": "method", + "name": "off", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The target of the subscription", + "type": "Object" + }, + { + "name": "method", + "description": "The function or the name of a function of the subscription", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Evented", + "module": "@ember/object/evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 137, + "description": "

Checks to see if object has any subscriptions for named event.

\n", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + } + ], + "return": { + "description": "does the object have a subscription for event", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Evented", + "module": "@ember/object/evented" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/object/evented", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-Factory.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-Factory.json new file mode 100644 index 000000000..0276d561b --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-Factory.json @@ -0,0 +1,74 @@ +{ + "data": { + "id": "ember-5.3.0-Factory", + "type": "class", + "attributes": { + "name": "Factory", + "shortname": "Factory", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/owner", + "namespace": "", + "file": "packages/@ember/-internals/owner/index.ts", + "line": 346, + "description": "

Registered factories are instantiated by having create called on them.\nAdditionally they are singletons by default, so each time they are looked up\nthey return the same instance.

\n

However, that behavior can be modified with the instantiate and singleton\noptions to the Owner.register() method.

\n", + "since": "4.10.0", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 368, + "description": "

A function that will create an instance of the class with any\ndependencies injected.

\n", + "itemtype": "method", + "name": "create", + "params": [ + { + "name": "initialValues", + "description": "Any values to set on an instance of the class", + "type": "Object" + } + ], + "return": { + "description": "The item produced by the factory.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Factory", + "module": "@ember/owner" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-5.3.0-FactoryManager" + } + ] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/owner", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-FactoryManager.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-FactoryManager.json new file mode 100644 index 000000000..a0ce34a18 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-FactoryManager.json @@ -0,0 +1,87 @@ +{ + "data": { + "id": "ember-5.3.0-FactoryManager", + "type": "class", + "attributes": { + "name": "FactoryManager", + "shortname": "FactoryManager", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/owner", + "namespace": "", + "file": "packages/@ember/-internals/owner/index.ts", + "line": 380, + "description": "

The interface representing a manager which can be used for introspection of\nthe factory's class or for the creation of factory instances with initial\nproperties. The manager is an object with the following properties:

\n
    \n
  • class - The registered or resolved class.
  • \n
  • create - A function that will create an instance of the class with any\ndependencies injected.
  • \n
\n

Note: FactoryManager is not user-constructible; the only legal way\nto get a FactoryManager is via Owner.factoryFor.

\n", + "extends": "Factory", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 368, + "description": "

A function that will create an instance of the class with any\ndependencies injected.

\n", + "itemtype": "method", + "name": "create", + "params": [ + { + "name": "initialValues", + "description": "Any values to set on an instance of the class", + "type": "Object" + } + ], + "return": { + "description": "The item produced by the factory.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "FactoryManager", + "module": "@ember/owner", + "inherited": true, + "inheritedFrom": "Factory" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 398, + "description": "

The registered or resolved class.

\n", + "itemtype": "property", + "name": "class", + "type": "Factory", + "access": "public", + "tagname": "", + "class": "FactoryManager", + "module": "@ember/owner" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-5.3.0-Factory", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/owner", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-FullName.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-FullName.json new file mode 100644 index 000000000..18a58691d --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-FullName.json @@ -0,0 +1,45 @@ +{ + "data": { + "id": "ember-5.3.0-FullName", + "type": "class", + "attributes": { + "name": "FullName", + "shortname": "FullName", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/owner", + "namespace": "", + "file": "packages/@ember/-internals/owner/index.ts", + "line": 7, + "description": "

The name for a factory consists of a namespace and the name of a specific type\nwithin that namespace, like 'service:session'.

\n

Note: FullName is not a class, just a contract for strings used in the\nDI system. It is currently documented as a class only due to limits in our\ndocumentation infrastructure.

\n", + "access": "public", + "tagname": "", + "methods": [], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/owner", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-HashLocation.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-HashLocation.json new file mode 100644 index 000000000..cdb6d9ce2 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-HashLocation.json @@ -0,0 +1,641 @@ +{ + "data": { + "id": "ember-5.3.0-HashLocation", + "type": "class", + "attributes": { + "name": "HashLocation", + "shortname": "HashLocation", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing/hash-location", + "namespace": "", + "file": "packages/@ember/routing/hash-location.ts", + "line": 10, + "description": "

HashLocation implements the location API using the browser's\nhash. At present, it relies on a hashchange event existing in the\nbrowser.

\n

Using HashLocation results in URLs with a # (hash sign) separating the\nserver side URL portion of the URL from the portion that is used by Ember.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
Router.map(function() {\n  this.route('posts', function() {\n    this.route('new');\n  });\n});\n\nRouter.reopen({\n  location: 'hash'\n});
\n
\n
\n \n

This will result in a posts.new url of /#/posts/new.

\n", + "extends": "EmberObject", + "access": "protected", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/routing/hash-location.ts", + "line": 49, + "access": "private", + "tagname": "Returns normalized location.hash", + "since": "1.5.1", + "itemtype": "method", + "name": "getHash", + "class": "HashLocation", + "module": "@ember/routing/hash-location" + }, + { + "file": "packages/@ember/routing/hash-location.ts", + "line": 61, + "description": "

Returns the normalized URL, constructed from location.hash.

\n

e.g. #/foo => /foo as well as #/foo#bar => /foo#bar.

\n

By convention, hashed paths must begin with a forward slash, otherwise they\nare not treated as a path so we can distinguish intent.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getURL", + "class": "HashLocation", + "module": "@ember/routing/hash-location" + }, + { + "file": "packages/@ember/routing/hash-location.ts", + "line": 91, + "description": "

Set the location.hash and remembers what was set. This prevents\nonUpdateURL callbacks from triggering when the hash was set by\nHashLocation.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setURL", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HashLocation", + "module": "@ember/routing/hash-location" + }, + { + "file": "packages/@ember/routing/hash-location.ts", + "line": 105, + "description": "

Uses location.replace to update the url without a page reload\nor history modification.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "replaceURL", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HashLocation", + "module": "@ember/routing/hash-location" + }, + { + "file": "packages/@ember/routing/hash-location.ts", + "line": 120, + "description": "

Register a callback to be invoked when the hash changes. These\ncallbacks will execute when the user presses the back or forward\nbutton, but not after setURL is invoked.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "onUpdateURL", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "class": "HashLocation", + "module": "@ember/routing/hash-location" + }, + { + "file": "packages/@ember/routing/hash-location.ts", + "line": 145, + "description": "

Given a URL, formats it to be placed into the page as part\nof an element's href attribute.

\n

This is used, for example, when using the {{action}} helper\nto generate a URL based on an event.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "formatURL", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "class": "HashLocation", + "module": "@ember/routing/hash-location" + }, + { + "file": "packages/@ember/routing/hash-location.ts", + "line": 160, + "description": "

Cleans up the HashLocation event listener.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "willDestroy", + "class": "HashLocation", + "module": "@ember/routing/hash-location" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 322, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 541, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 568, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 576, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 164, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 212, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 229, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 247, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 333, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 354, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 371, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 388, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 403, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 433, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 453, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 497, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/object/core.ts", + "line": 356, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 430, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 505, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 523, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "HashLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-5.3.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/routing/hash-location", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-Helper.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-Helper.json new file mode 100644 index 000000000..c2a86db85 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-Helper.json @@ -0,0 +1,206 @@ +{ + "data": { + "id": "ember-5.3.0-Helper", + "type": "class", + "attributes": { + "name": "Helper", + "shortname": "Helper", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/component", + "namespace": "", + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 53, + "description": "

Ember Helpers are functions that can compute values, and are used in templates.\nFor example, this code calls a helper named format-currency:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Cost @cents={{230}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/cost.hbs
1\n
<div>{{format-currency @cents currency="$"}}</div>
\n
\n
\n \n

Additionally a helper can be called as a nested helper.\nIn this example, we show the formatted currency value if the showMoney\nnamed argument is truthy.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{{if @showMoney (format-currency @cents currency="$")}}
\n
\n
\n \n

Helpers defined using a class must provide a compute function. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
currency.js
1\n2\n3\n4\n5\n6\n7\n
import Helper from '@ember/component/helper';\n\nexport default class extends Helper {\n  compute([cents], { currency }) {\n    return `${currency}${cents * 0.01}`;\n  }\n}
\n
\n
\n \n

Each time the input to a helper changes, the compute function will be\ncalled again.

\n

As instances, these helpers also have access to the container and will accept\ninjected dependencies.

\n

Additionally, class helpers can call recompute to force a new computation.

\n", + "extends": "CoreObject", + "access": "public", + "tagname": "", + "since": "1.13.0", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 101, + "description": "

Override this function when writing a class-based helper.

\n", + "itemtype": "method", + "name": "compute", + "params": [ + { + "name": "positional", + "description": "The positional arguments to the helper", + "type": "Array" + }, + { + "name": "named", + "description": "The named arguments to the helper", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Helper", + "module": "@ember/component" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 138, + "description": "

On a class-based helper, it may be useful to force a recomputation of that\nhelpers value. This is akin to rerender on a component.

\n

For example, this component will rerender when the currentUser on a\nsession service changes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
email.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Helper from '@ember/component/helper'\nimport { service } from '@ember/service'\nimport { observer } from '@ember/object'\n\nexport default Helper.extend({\n  session: service(),\n\n  onNewUser: observer('session.currentUser', function() {\n    this.recompute();\n  }),\n\n  compute() {\n    return this.get('session.currentUser.email');\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "recompute", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "Helper", + "module": "@ember/component" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 322, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 541, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 568, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 576, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/object/core.ts", + "line": 356, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 430, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 505, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 523, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Helper", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-5.3.0-CoreObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/component", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-HistoryLocation.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-HistoryLocation.json new file mode 100644 index 000000000..56aa79da4 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-HistoryLocation.json @@ -0,0 +1,707 @@ +{ + "data": { + "id": "ember-5.3.0-HistoryLocation", + "type": "class", + "attributes": { + "name": "HistoryLocation", + "shortname": "HistoryLocation", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing/history-location", + "namespace": "", + "file": "packages/@ember/routing/history-location.ts", + "line": 21, + "description": "

HistoryLocation implements the location API using the browser's\nhistory.pushState API.

\n

Using HistoryLocation results in URLs that are indistinguishable from a\nstandard URL. This relies upon the browser's history API.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
Router.map(function() {\n  this.route('posts', function() {\n    this.route('new');\n  });\n});\n\nRouter.reopen({\n  location: 'history'\n});
\n
\n
\n \n

This will result in a posts.new url of /posts/new.

\n

Keep in mind that your server must serve the Ember app at all the routes you\ndefine.

\n

Using HistoryLocation will also result in location states being recorded by\nthe browser history API with the following schema:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
window.history.state -> { path: '/', uuid: '3552e730-b4a6-46bd-b8bf-d8c3c1a97e0a' }
\n
\n
\n

This allows each in-app location state to be tracked uniquely across history\nstate changes via the uuid field.

\n", + "extends": "EmberObject", + "access": "protected", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/routing/history-location.ts", + "line": 80, + "access": "private", + "tagname": "Returns normalized location.hash", + "itemtype": "method", + "name": "getHash", + "class": "HistoryLocation", + "module": "@ember/routing/history-location" + }, + { + "file": "packages/@ember/routing/history-location.ts", + "line": 106, + "description": "

Used to set state on first call to setURL

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "initState", + "class": "HistoryLocation", + "module": "@ember/routing/history-location" + }, + { + "file": "packages/@ember/routing/history-location.ts", + "line": 127, + "description": "

Returns the current location.pathname without rootURL or baseURL

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getURL", + "return": { + "description": "url", + "type": "String" + }, + "class": "HistoryLocation", + "module": "@ember/routing/history-location" + }, + { + "file": "packages/@ember/routing/history-location.ts", + "line": 154, + "description": "

Uses history.pushState to update the url without a page reload.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setURL", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HistoryLocation", + "module": "@ember/routing/history-location" + }, + { + "file": "packages/@ember/routing/history-location.ts", + "line": 171, + "description": "

Uses history.replaceState to update the url without a page reload\nor history modification.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "replaceURL", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HistoryLocation", + "module": "@ember/routing/history-location" + }, + { + "file": "packages/@ember/routing/history-location.ts", + "line": 189, + "description": "

Pushes a new state.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "pushState", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HistoryLocation", + "module": "@ember/routing/history-location" + }, + { + "file": "packages/@ember/routing/history-location.ts", + "line": 206, + "description": "

Replaces the current state.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "replaceState", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "HistoryLocation", + "module": "@ember/routing/history-location" + }, + { + "file": "packages/@ember/routing/history-location.ts", + "line": 223, + "description": "

Register a callback to be invoked whenever the browser\nhistory changes, including using forward and back buttons.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "onUpdateURL", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "class": "HistoryLocation", + "module": "@ember/routing/history-location" + }, + { + "file": "packages/@ember/routing/history-location.ts", + "line": 248, + "description": "

Used when using {{action}} helper. The url is always appended to the rootURL.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "formatURL", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "return": { + "description": "formatted url", + "type": "String" + }, + "class": "HistoryLocation", + "module": "@ember/routing/history-location" + }, + { + "file": "packages/@ember/routing/history-location.ts", + "line": 272, + "description": "

Cleans up the HistoryLocation event listener.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "willDestroy", + "class": "HistoryLocation", + "module": "@ember/routing/history-location" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 322, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 541, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 568, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 576, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 164, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 212, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 229, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 247, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 333, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 354, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 371, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 388, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 403, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 433, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 453, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 497, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/routing/history-location.ts", + "line": 71, + "description": "

Will be pre-pended to path upon state change

\n", + "itemtype": "property", + "name": "rootURL", + "default": "'/'", + "access": "private", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/routing/history-location" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 356, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 430, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 505, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 523, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "HistoryLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-5.3.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/routing/history-location", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-InternalFactory.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-InternalFactory.json new file mode 100644 index 000000000..e3f8d065a --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-InternalFactory.json @@ -0,0 +1,116 @@ +{ + "data": { + "id": "ember-5.3.0-InternalFactory", + "type": "class", + "attributes": { + "name": "InternalFactory", + "shortname": "InternalFactory", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/owner", + "namespace": "", + "file": "packages/@ember/-internals/owner/index.ts", + "line": 484, + "description": "

The internal representation of a Factory, for the extra detail available for\nprivate use internally than we expose to consumers.

\n", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 526, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "isFactory", + "params": [ + { + "name": "obj", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "static": 1, + "class": "InternalFactory", + "module": "@ember/owner" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 494, + "itemtype": "property", + "name": "class", + "optional": 1, + "access": "private", + "tagname": "", + "class": "InternalFactory", + "module": "@ember/owner" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 501, + "itemtype": "property", + "name": "name", + "type": "String", + "optional": 1, + "access": "private", + "tagname": "", + "class": "InternalFactory", + "module": "@ember/owner" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 509, + "itemtype": "property", + "name": "fullName", + "type": "String", + "optional": 1, + "access": "private", + "tagname": "", + "class": "InternalFactory", + "module": "@ember/owner" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 517, + "itemtype": "property", + "name": "normalizedName", + "type": "String", + "optional": 1, + "access": "private", + "tagname": "", + "class": "InternalFactory", + "module": "@ember/owner" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/owner", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-Libraries.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-Libraries.json new file mode 100644 index 000000000..b443ce62c --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-Libraries.json @@ -0,0 +1,46 @@ +{ + "data": { + "id": "ember-5.3.0-Libraries", + "type": "class", + "attributes": { + "name": "Libraries", + "shortname": "Libraries", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "", + "file": "packages/@ember/-internals/metal/lib/libraries.ts", + "line": 14, + "description": "

Helper class that allows you to register your library with Ember.

\n

Singleton created at Ember.libraries.

\n", + "is_constructor": 1, + "access": "private", + "tagname": "", + "methods": [], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-Location.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-Location.json new file mode 100644 index 000000000..fe579c7fa --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-Location.json @@ -0,0 +1,128 @@ +{ + "data": { + "id": "ember-5.3.0-Location", + "type": "class", + "attributes": { + "name": "Location", + "shortname": "Location", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing/location", + "namespace": "", + "file": "packages/@ember/routing/location.ts", + "line": 5, + "description": "

Location defines an interface to be implemented by location APIs. It is\nnot user-constructible; the only valid way to get a Location is via one of\nits concrete implementations.

\n

Implementations

\n

You can pass an implementation name (hash, history, none) to force a\nparticular implementation to be used in your application.

\n\n

Location API

\n

Each location implementation must provide the following methods:

\n
    \n
  • getURL: returns the current URL.
  • \n
  • setURL(path): sets the current URL.
  • \n
  • replaceURL(path): replace the current URL (optional).
  • \n
  • onUpdateURL(callback): triggers the callback when the URL changes.
  • \n
  • formatURL(url): formats url to be placed into href attribute.
  • \n
\n

Calling setURL or replaceURL will not trigger onUpdateURL callbacks.

\n

Custom implementation

\n

Ember scans app/locations/* for extending the Location API.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import HistoryLocation from '@ember/routing/history-location';\n\nexport default class MyHistory {\n  implementation = 'my-custom-history';\n\n  constructor() {\n    this._history = HistoryLocation.create(...arguments);\n  }\n\n  create() {\n    return new this(...arguments);\n  }\n\n  pushState(path) {\n     this._history.pushState(path);\n  }\n}
\n
\n
\n \n", + "since": "5.0.0", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/routing/location.ts", + "line": 82, + "description": "

Sets the current URL. Calling setURL will not trigger onUpdateURL\ncallbacks.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "setURL", + "params": [ + { + "name": "url", + "description": "the new URL to update to.", + "type": "String" + } + ], + "class": "Location", + "module": "@ember/routing/location" + }, + { + "file": "packages/@ember/routing/location.ts", + "line": 92, + "description": "

Replace the current URL (optional). Calling replaceURL will not trigger\nonUpdateURL callbacks.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "replaceURL", + "params": [ + { + "name": "url", + "description": "the new URL to replace the current URL with.", + "type": "String" + } + ], + "class": "Location", + "module": "@ember/routing/location" + }, + { + "file": "packages/@ember/routing/location.ts", + "line": 109, + "description": "

Formats url to be placed into href attribute.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "formatURL", + "params": [ + { + "name": "url", + "description": "the url to format", + "type": "String" + } + ], + "class": "Location", + "module": "@ember/routing/location" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/routing/location.ts", + "line": 63, + "description": "

If the location needs to redirect to a different URL, it can cancel routing\nby setting the cancelRouterSetup property on itself to false.

\n", + "itemtype": "property", + "name": "cancelRouterSetup", + "type": "Boolean", + "optional": 1, + "default": "true", + "access": "public", + "tagname": "", + "class": "Location", + "module": "@ember/routing/location" + }, + { + "file": "packages/@ember/routing/location.ts", + "line": 74, + "description": "

The current URL.

\n", + "itemtype": "property", + "name": "getURL", + "type": "String", + "access": "public", + "tagname": "", + "class": "Location", + "module": "@ember/routing/location" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/routing/location", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-Mixin.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-Mixin.json new file mode 100644 index 000000000..26ee74cbf --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-Mixin.json @@ -0,0 +1,75 @@ +{ + "data": { + "id": "ember-5.3.0-Mixin", + "type": "class", + "attributes": { + "name": "Mixin", + "shortname": "Mixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object/mixin", + "namespace": "", + "file": "packages/@ember/object/mixin.ts", + "line": 455, + "description": "

The Mixin class allows you to create mixins, whose properties can be\nadded to other classes. For instance,

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Mixin from '@ember/object/mixin';\n\nconst EditableMixin = Mixin.create({\n  edit() {\n    console.log('starting to edit');\n    this.set('isEditing', true);\n  },\n  isEditing: false\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import EmberObject from '@ember/object';\nimport EditableMixin from '../mixins/editable';\n\n// Mix mixins into classes by passing them as the first arguments to\n// `.extend.`\nconst Comment = EmberObject.extend(EditableMixin, {\n  post: null\n});\n\nlet comment = Comment.create({\n  post: somePost\n});\n\ncomment.edit(); // outputs 'starting to edit'
\n
\n
\n \n

Note that Mixins are created with Mixin.create, not\nMixin.extend.

\n

Note that mixins extend a constructor's prototype so arrays and object literals\ndefined as properties will be shared amongst objects that implement the mixin.\nIf you want to define a property in a mixin that is not shared, you can define\nit either as a computed property or have it be created on initialization of the object.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
// filters array will be shared amongst any object implementing mixin\nimport Mixin from '@ember/object/mixin';\nimport { A } from '@ember/array';\n\nconst FilterableMixin = Mixin.create({\n  filters: A()\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Mixin from '@ember/object/mixin';\nimport { A } from '@ember/array';\nimport { computed } from '@ember/object';\n\n// filters will be a separate array for every object implementing the mixin\nconst FilterableMixin = Mixin.create({\n  filters: computed(function() {\n    return A();\n  })\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Mixin from '@ember/object/mixin';\nimport { A } from '@ember/array';\n\n// filters will be created as a separate array during the object's initialization\nconst Filterable = Mixin.create({\n  filters: null,\n\n  init() {\n    this._super(...arguments);\n    this.set("filters", A());\n  }\n});
\n
\n
\n \n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/object/mixin.ts", + "line": 441, + "itemtype": "method", + "name": "mixin", + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "mixins", + "description": "", + "multiple": true + } + ], + "return": { + "description": "obj" + }, + "access": "private", + "tagname": "", + "class": "Mixin", + "module": "@ember/object/mixin" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-5.3.0-Ember.TargetActionSupport" + } + ] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/object/mixin", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-MutableArray.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-MutableArray.json new file mode 100644 index 000000000..ca0c7aaec --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-MutableArray.json @@ -0,0 +1,1240 @@ +{ + "data": { + "id": "ember-5.3.0-MutableArray", + "type": "class", + "attributes": { + "name": "MutableArray", + "shortname": "MutableArray", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Ember.NativeArray", + "ArrayProxy" + ], + "module": "@ember/array", + "namespace": "", + "file": "packages/@ember/array/index.ts", + "line": 1463, + "description": "

This mixin defines the API for modifying array-like objects. These methods\ncan be applied only to a collection that keeps its items in an ordered set.\nIt builds upon the Array mixin and adds methods to modify the array.\nOne concrete implementations of this class include ArrayProxy.

\n

It is important to use the methods in this class to modify arrays so that\nchanges are observable. This allows the binding system in Ember to function\ncorrectly.

\n

Note that an Array can change even if it does not implement this mixin.\nFor example, one might implement a SparseArray that cannot be directly\nmodified, but if its underlying enumerable changes, it will change also.

\n", + "uses": [ + "MutableEnumerable", + "EmberArray" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/array/index.ts", + "line": 1484, + "description": "

Required. You must implement this method to apply this mixin.

\n

This is one of the primitives you must implement to support Array.\nYou should replace amt objects started at idx with the objects in the\npassed array.

\n

Note that this method is expected to validate the type(s) of objects that it expects.

\n", + "itemtype": "method", + "name": "replace", + "params": [ + { + "name": "idx", + "description": "Starting index in the array to replace. If\n idx >= length, then append to the end of the array.", + "type": "Number" + }, + { + "name": "amt", + "description": "Number of elements that should be removed from\n the array, starting at *idx*.", + "type": "Number" + }, + { + "name": "objects", + "description": "An optional array of zero or more objects that should be\n inserted into the array at *idx*", + "type": "EmberArray", + "optional": true + } + ], + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1503, + "description": "

Remove all elements from the array. This is useful if you\nwant to reuse an existing array without having to recreate it.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue'];\n\ncolors.length;  // 3\ncolors.clear(); // []\ncolors.length;  // 0
\n
\n
\n \n", + "itemtype": "method", + "name": "clear", + "return": { + "description": "An empty Array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1520, + "description": "

This will use the primitive replace() method to insert an object at the\nspecified index.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.insertAt(2, 'yellow');  // ['red', 'green', 'yellow', 'blue']\ncolors.insertAt(5, 'orange');  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "insertAt", + "params": [ + { + "name": "idx", + "description": "index of insert the object at.", + "type": "Number" + }, + { + "name": "object", + "description": "object to insert", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1538, + "description": "

Remove an object at the specified index using the replace() primitive\nmethod. You can pass either a single index, or a start and a length.

\n

If you pass a start and length that is beyond the\nlength this method will throw an assertion.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let colors = ['red', 'green', 'blue', 'yellow', 'orange'];\n\ncolors.removeAt(0);     // ['green', 'blue', 'yellow', 'orange']\ncolors.removeAt(2, 2);  // ['green', 'blue']\ncolors.removeAt(4, 2);  // Error: Index out of range
\n
\n
\n \n", + "itemtype": "method", + "name": "removeAt", + "params": [ + { + "name": "start", + "description": "index, start of range", + "type": "Number" + }, + { + "name": "len", + "description": "length of passing range", + "type": "Number" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1560, + "description": "

Push the object onto the end of the array. Works just like push() but it\nis KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green'];\n\ncolors.pushObject('black');     // ['red', 'green', 'black']\ncolors.pushObject(['yellow']);  // ['red', 'green', ['yellow']]
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObject", + "params": [ + { + "name": "obj", + "description": "object to push", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1577, + "description": "

Add the objects in the passed array to the end of the array. Defers\nnotifying observers of the change until all objects are added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
let colors = ['red'];\n\ncolors.pushObjects(['yellow', 'orange']);  // ['red', 'yellow', 'orange']
\n
\n
\n \n", + "itemtype": "method", + "name": "pushObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "Array" + } + ], + "return": { + "description": "receiver", + "type": "MutableArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1593, + "description": "

Pop object from array or nil if none are left. Works just like pop() but\nit is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.popObject();   // 'blue'\nconsole.log(colors);  // ['red', 'green']
\n
\n
\n \n", + "itemtype": "method", + "name": "popObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1609, + "description": "

Shift an object from start of array or nil if none are left. Works just\nlike shift() but it is KVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.shiftObject();  // 'red'\nconsole.log(colors);   // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "shiftObject", + "return": { + "description": "object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1625, + "description": "

Unshift an object to start of array. Works just like unshift() but it is\nKVO-compliant.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObject('yellow');    // ['yellow', 'red']\ncolors.unshiftObject(['black']);   // [['black'], 'yellow', 'red']
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObject", + "params": [ + { + "name": "obj", + "description": "object to unshift", + "type": "*" + } + ], + "return": { + "description": "object same object passed as a param" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1642, + "description": "

Adds the named objects to the beginning of the array. Defers notifying\nobservers until all objects have been added.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red'];\n\ncolors.unshiftObjects(['black', 'white']);   // ['black', 'white', 'red']\ncolors.unshiftObjects('yellow'); // Type Error: 'undefined' is not a function
\n
\n
\n \n", + "itemtype": "method", + "name": "unshiftObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add", + "type": "Enumerable" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1659, + "description": "

Reverse objects in the array. Works just like reverse() but it is\nKVO-compliant.

\n", + "itemtype": "method", + "name": "reverseObjects", + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1668, + "description": "

Replace all the receiver's content with content of the argument.\nIf argument is an empty array receiver will be cleared.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let colors = ['red', 'green', 'blue'];\n\ncolors.setObjects(['black', 'white']);  // ['black', 'white']\ncolors.setObjects([]);                  // []
\n
\n
\n \n", + "itemtype": "method", + "name": "setObjects", + "params": [ + { + "name": "objects", + "description": "array whose content will be used for replacing\n the content of the receiver", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver with the new content", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1686, + "description": "

Remove all occurrences of an object in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let cities = ['Chicago', 'Berlin', 'Lima', 'Chicago'];\n\ncities.removeObject('Chicago');  // ['Berlin', 'Lima']\ncities.removeObject('Lima');     // ['Berlin']\ncities.removeObject('Tokyo')     // ['Berlin']
\n
\n
\n \n", + "itemtype": "method", + "name": "removeObject", + "params": [ + { + "name": "obj", + "description": "object to remove", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1703, + "description": "

Removes each object in the passed array from the receiver.

\n", + "itemtype": "method", + "name": "removeObjects", + "params": [ + { + "name": "objects", + "description": "the objects to remove", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1712, + "description": "

Push the object onto the end of the array if it is not already\npresent in the array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let cities = ['Chicago', 'Berlin'];\n\ncities.addObject('Lima');    // ['Chicago', 'Berlin', 'Lima']\ncities.addObject('Berlin');  // ['Chicago', 'Berlin', 'Lima']
\n
\n
\n \n", + "itemtype": "method", + "name": "addObject", + "params": [ + { + "name": "obj", + "description": "object to add, if not already present", + "type": "*" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1729, + "description": "

Adds each object in the passed array to the receiver.

\n", + "itemtype": "method", + "name": "addObjects", + "params": [ + { + "name": "objects", + "description": "the objects to add.", + "type": "EmberArray" + } + ], + "return": { + "description": "receiver", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 263, + "description": "

Returns the object at the given index. If the given index is negative\nor is greater or equal than the array length, returns undefined.

\n

This is one of the primitives you must implement to support EmberArray.\nIf your object supports retrieving the value of an array item using get()\n(i.e. myArray.get(0)), then you do not need to implement this method\nyourself.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectAt(0);   // 'a'\narr.objectAt(3);   // 'd'\narr.objectAt(-1);  // undefined\narr.objectAt(4);   // undefined\narr.objectAt(5);   // undefined
\n
\n
\n \n", + "itemtype": "method", + "name": "objectAt", + "params": [ + { + "name": "idx", + "description": "The index of the item to return.", + "type": "Number" + } + ], + "return": { + "description": "item at index or undefined", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 288, + "description": "

This returns the objects at the specified indexes, using objectAt.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let arr = ['a', 'b', 'c', 'd'];\n\narr.objectsAt([0, 1, 2]);  // ['a', 'b', 'c']\narr.objectsAt([2, 3, 4]);  // ['c', 'd', undefined]
\n
\n
\n \n", + "itemtype": "method", + "name": "objectsAt", + "params": [ + { + "name": "indexes", + "description": "An array of indexes of items to return.", + "type": "Array" + } + ], + "return": { + "description": "", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 354, + "description": "

Returns a new array that is a slice of the receiver. This implementation\nuses the observable array methods to retrieve the objects for the new\nslice.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = ['red', 'green', 'blue'];\n\narr.slice(0);       // ['red', 'green', 'blue']\narr.slice(0, 2);    // ['red', 'green']\narr.slice(1, 100);  // ['green', 'blue']
\n
\n
\n \n", + "itemtype": "method", + "name": "slice", + "params": [ + { + "name": "beginIndex", + "description": "(Optional) index to begin slicing from.", + "type": "Number" + }, + { + "name": "endIndex", + "description": "(Optional) index to end the slice at (but not included).", + "type": "Number" + } + ], + "return": { + "description": "New array with specified slice", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 374, + "description": "

Used to determine the passed object's first occurrence in the array.\nReturns the index if found, -1 if no match is found.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.indexOf('a');       //  0\narr.indexOf('z');       // -1\narr.indexOf('a', 2);    //  4\narr.indexOf('a', -1);   //  4, equivalent to indexOf('a', 4)\narr.indexOf('a', -100); //  0, searches entire array\narr.indexOf('b', 3);    // -1\narr.indexOf('a', 100);  // -1\n\nlet people = [{ name: 'Zoey' }, { name: 'Bob' }]\nlet newPerson = { name: 'Tom' };\npeople = [newPerson, ...people, newPerson];\n\npeople.indexOf(newPerson);     //  0\npeople.indexOf(newPerson, 1);  //  3\npeople.indexOf(newPerson, -4); //  0\npeople.indexOf(newPerson, 10); // -1
\n
\n
\n \n", + "itemtype": "method", + "name": "indexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "index or -1 if not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 412, + "description": "

Returns the index of the given object's last occurrence.

\n
    \n
  • If no startAt argument is given, the search starts from\nthe last position.
  • \n
  • If it's greater than or equal to the length of the array,\nthe search starts from the last position.
  • \n
  • If it's negative, it is taken as the offset from the end\nof the array i.e. startAt + array.length.
  • \n
  • If it's any other positive number, will search backwards\nfrom that index of the array.
  • \n
\n

Returns -1 if no match is found.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let arr = ['a', 'b', 'c', 'd', 'a'];\n\narr.lastIndexOf('a');       //  4\narr.lastIndexOf('z');       // -1\narr.lastIndexOf('a', 2);    //  0\narr.lastIndexOf('a', -1);   //  4\narr.lastIndexOf('a', -3);   //  0\narr.lastIndexOf('b', 3);    //  1\narr.lastIndexOf('a', 100);  //  4
\n
\n
\n \n", + "itemtype": "method", + "name": "lastIndexOf", + "params": [ + { + "name": "object", + "description": "the item to search for", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search from\nbackwards, defaults to `(array.length - 1)`", + "type": "Number" + } + ], + "return": { + "description": "The last index of the `object` in the array or -1\nif not found", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 447, + "description": "

Iterates through the array, calling the passed function on each\nitem. This method corresponds to the forEach() method defined in\nJavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
let foods = [\n  { name: 'apple', eaten: false },\n  { name: 'banana', eaten: false },\n  { name: 'carrot', eaten: false }\n];\n\nfoods.forEach((food) => food.eaten = true);\n\nlet output = '';\nfoods.forEach((item, index, array) =>\n  output += `${index + 1}/${array.length} ${item.name}\\n`;\n);\nconsole.log(output);\n// 1/3 apple\n// 2/3 banana\n// 3/3 carrot
\n
\n
\n \n", + "itemtype": "method", + "name": "forEach", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 498, + "description": "

Alias for mapBy.

\n

Returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.getEach('name');\n// ['Joe', 'Matt'];\n\npeople.getEach('nonexistentProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "getEach", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 520, + "description": "

Sets the value on the named property for each member. This is more\nergonomic than using other methods defined on this helper. If the object\nimplements Observable, the value will be changed to set(), otherwise\nit will be set directly. null objects are skipped.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.setEach('zipCode', '10011');\n// [{name: 'Joe', zipCode: '10011'}, {name: 'Matt', zipCode: '10011'}];
\n
\n
\n \n", + "itemtype": "method", + "name": "setEach", + "params": [ + { + "name": "key", + "description": "The key to set", + "type": "String" + }, + { + "name": "value", + "description": "The object to set", + "type": "Object" + } + ], + "return": { + "description": "receiver", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 540, + "description": "

Maps all of the items in the enumeration to another value, returning\na new array. This method corresponds to map() defined in JavaScript 1.6.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
function(item, index, array);\nlet arr = [1, 2, 3, 4, 5, 6];\n\narr.map(element => element * element);\n// [1, 4, 9, 16, 25, 36];\n\narr.map((element, index) => element + index);\n// [1, 3, 5, 7, 9, 11];
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the mapped value.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n", + "itemtype": "method", + "name": "map", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 578, + "description": "

Similar to map, this specialized function returns the value of the named\nproperty on all items in the enumeration.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let people = [{name: 'Joe'}, {name: 'Matt'}];\n\npeople.mapBy('name');\n// ['Joe', 'Matt'];\n\npeople.mapBy('unknownProperty');\n// [undefined, undefined];
\n
\n
\n \n", + "itemtype": "method", + "name": "mapBy", + "params": [ + { + "name": "key", + "description": "name of the property", + "type": "String" + } + ], + "return": { + "description": "The mapped array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 599, + "description": "

Returns a new array with all of the items in the enumeration that the provided\ncallback function returns true for. This method corresponds to Array.prototype.filter().

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All parameters are optional. The function should return true to include the item\nin the results, and false otherwise.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nlet people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n\npeople.filter(isAdult); // returns [{ name: 'Joan', age: 45 }];
\n
\n
\n \n

Note that in addition to a callback, you can pass an optional target object\nthat will be set as this on the context. This is a good way to give your\niterator function access to the current object. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
function isAdultAndEngineer(person) {\n  return person.age > 18 && this.engineering;\n}\n\nclass AdultsCollection {\n  engineering = false;\n\n  constructor(opts = {}) {\n    super(...arguments);\n\n    this.engineering = opts.engineering;\n    this.people = Ember.A([{ name: 'John', age: 14 }, { name: 'Joan', age: 45 }]);\n  }\n}\n\nlet collection = new AdultsCollection({ engineering: true });\ncollection.people.filter(isAdultAndEngineer, { target: collection });
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A filtered array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 662, + "description": "

Returns an array with all of the items in the enumeration where the passed\nfunction returns false. This method is the inverse of filter().

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration
  • \n
  • array is the array itself.
  • \n
\n

It should return a falsey value to include the item in the results.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as "this" on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\nconst nonFruits = food.reject(function(thing) {\n  return thing.isFruit;\n}); // [{food: 'bread', isFruit: false}]
\n
\n
\n \n", + "itemtype": "method", + "name": "reject", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A rejected array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 706, + "description": "

Filters the array by the property and an optional value. If a value is given, it returns\nthe items that have said value for the property. If not, it returns all the items that\nhave a truthy value for the property.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let things = Ember.A([{ food: 'apple', isFruit: true }, { food: 'beans', isFruit: false }]);\n\nthings.filterBy('food', 'beans'); // [{ food: 'beans', isFruit: false }]\nthings.filterBy('isFruit'); // [{ food: 'apple', isFruit: true }]
\n
\n
\n \n", + "itemtype": "method", + "name": "filterBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "filtered array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 727, + "description": "

Returns an array with the items that do not have truthy values for the provided key.\nYou can pass an optional second argument with a target value to reject for the key.\nOtherwise this will reject objects where the provided property evaluates to false.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
  let food = [\n    { name: "apple", isFruit: true },\n    { name: "carrot", isFruit: false },\n    { name: "bread", isFruit: false },\n  ];\n  food.rejectBy('isFruit'); // [{ name: "carrot", isFruit: false }, { name: "bread", isFruit: false }]\n  food.rejectBy('name', 'carrot'); // [{ name: "apple", isFruit: true }}, { name: "bread", isFruit: false }]
\n
\n
\n \n", + "itemtype": "method", + "name": "rejectBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "*", + "optional": true + } + ], + "return": { + "description": "rejected array", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 751, + "description": "

Returns the first item in the array for which the callback returns true.\nThis method is similar to the find() method defined in ECMAScript 2015.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the true to include the item in the results, false\notherwise.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let users = [\n  { id: 1, name: 'Yehuda' },\n  { id: 2, name: 'Tom' },\n  { id: 3, name: 'Melanie' },\n  { id: 4, name: 'Leah' }\n];\n\nusers.find((user) => user.name == 'Tom'); // [{ id: 2, name: 'Tom' }]\nusers.find(({ id }) => id == 3); // [{ id: 3, name: 'Melanie' }]
\n
\n
\n \n", + "itemtype": "method", + "name": "find", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Found item or `undefined`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 801, + "description": "

Returns the first item with a property matching the passed value. You\ncan pass an optional second argument with the target value. Otherwise\nthis will match any property that evaluates to true.

\n

This method works much like the more generic find() method.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
let users = [\n  { id: 1, name: 'Yehuda', isTom: false },\n  { id: 2, name: 'Tom', isTom: true },\n  { id: 3, name: 'Melanie', isTom: false },\n  { id: 4, name: 'Leah', isTom: false }\n];\n\nusers.findBy('id', 4); // { id: 4, name: 'Leah', isTom: false }\nusers.findBy('name', 'Melanie'); // { id: 3, name: 'Melanie', isTom: false }\nusers.findBy('isTom'); // { id: 2, name: 'Tom', isTom: true }
\n
\n
\n \n", + "itemtype": "method", + "name": "findBy", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "found item or `undefined`", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 831, + "description": "

Returns true if the passed function returns true for every item in the\nenumeration. This corresponds with the Array.prototype.every() method defined in ES5.

\n

The callback method should have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

All params are optional. The method should return true or false.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. This is a good way\nto give your iterator function access to the current object.

\n

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
function isAdult(person) {\n  return person.age > 18;\n};\n\nconst people = Ember.A([{ name: 'John', age: 24 }, { name: 'Joan', age: 45 }]);\nconst areAllAdults = people.every(isAdult);
\n
\n
\n \n", + "itemtype": "method", + "name": "every", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 872, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for all items in the array. This method is often simpler/faster\nthan using a callback.

\n

Note that like the native Array.every, isEvery will return true when called\non any empty array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
class Language {\n  constructor(name, isProgrammingLanguage) {\n    this.name = name;\n    this.programmingLanguage = isProgrammingLanguage;\n  }\n}\n\nconst compiledLanguages = [\n  new Language('Java', true),\n  new Language('Go', true),\n  new Language('Rust', true)\n]\n\nconst languagesKnownByMe = [\n  new Language('Javascript', true),\n  new Language('English', false),\n  new Language('Ruby', true)\n]\n\ncompiledLanguages.isEvery('programmingLanguage'); // true\nlanguagesKnownByMe.isEvery('programmingLanguage'); // false
\n
\n
\n \n", + "itemtype": "method", + "name": "isEvery", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 912, + "description": "

The any() method executes the callback function once for each element\npresent in the array until it finds the one where callback returns a truthy\nvalue (i.e. true). If such an element is found, any() immediately returns\ntrue. Otherwise, any() returns false.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array object itself.
  • \n
\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context. It can be a good way\nto give your iterator function access to an object in cases where an ES6\narrow function would not be appropriate.

\n

Usage Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let includesManager = people.any(this.findPersonInManagersList, this);\n\nlet includesStockHolder = people.any(person => {\n  return this.findPersonInStockHoldersList(person)\n});\n\nif (includesManager || includesStockHolder) {\n  Paychecks.addBiggerBonus();\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "any", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "target", + "description": "The target object to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "`true` if the passed function returns `true` for any item", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 955, + "description": "

Returns true if the passed property resolves to the value of the second\nargument for any item in the array. This method is often simpler/faster\nthan using a callback.

\n

Example usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const food = [\n  { food: 'apple', isFruit: true },\n  { food: 'bread', isFruit: false },\n  { food: 'banana', isFruit: true }\n];\n\nfood.isAny('isFruit'); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "isAny", + "params": [ + { + "name": "key", + "description": "the property to test", + "type": "String" + }, + { + "name": "value", + "description": "optional value to test against. Defaults to `true`", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 981, + "description": "

This will combine the values of the array into a single value. It\nis a useful way to collect a summary value from an array. This\ncorresponds to the reduce() method defined in JavaScript 1.8.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(previousValue, item, index, array);
\n
\n
\n \n
    \n
  • previousValue is the value returned by the last call to the iterator.
  • \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

Return the new cumulative value.

\n

In addition to the callback you can also pass an initialValue. An error\nwill be raised if you do not pass an initial value and the enumerator is\nempty.

\n

Note that unlike the other methods, this method does not allow you to\npass a target object to set as this for the callback. It's part of the\nspec. Sorry.

\n

Example Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
  let numbers = [1, 2, 3, 4, 5];\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }); // 15 (1 + 2 + 3 + 4 + 5)\n\n  numbers.reduce(function(summation, current) {\n    return summation + current;\n  }, -15); // 0 (-15 + 1 + 2 + 3 + 4 + 5)\n\n\n  let binaryValues = [true, false, false];\n\n  binaryValues.reduce(function(truthValue, current) {\n    return truthValue && current;\n  }); // false (true && false && false)
\n
\n
\n \n", + "itemtype": "method", + "name": "reduce", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "initialValue", + "description": "Initial value for the reduce", + "type": "Object" + } + ], + "return": { + "description": "The reduced value.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1039, + "description": "

Invokes the named method on every object in the receiver that\nimplements it. This method corresponds to the implementation in\nPrototype 1.6.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
class Person {\n  name = null;\n\n  constructor(name) {\n    this.name = name;\n  }\n\n  greet(prefix='Hello') {\n    return `${prefix} ${this.name}`;\n  }\n}\n\nlet people = [new Person('Joe'), new Person('Matt')];\n\npeople.invoke('greet'); // ['Hello Joe', 'Hello Matt']\npeople.invoke('greet', 'Bonjour'); // ['Bonjour Joe', 'Bonjour Matt']
\n
\n
\n \n", + "itemtype": "method", + "name": "invoke", + "params": [ + { + "name": "methodName", + "description": "the name of the method", + "type": "String" + }, + { + "name": "args", + "description": "optional arguments to pass as well.", + "type": "Object..." + } + ], + "return": { + "description": "return values from calling invoke.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1073, + "description": "

Simply converts the object into a genuine array. The order is not\nguaranteed. Corresponds to the method implemented by Prototype.

\n", + "itemtype": "method", + "name": "toArray", + "return": { + "description": "the object as an array.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1082, + "description": "

Returns a copy of the array with all null and undefined elements removed.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', null, 'c', undefined];\narr.compact();  // ['a', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "compact", + "return": { + "description": "the array without null and undefined elements.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1095, + "description": "

Used to determine if the array contains the passed object.\nReturns true if found, false otherwise.

\n

The optional startAt argument can be used to pass a starting\nindex to search from, effectively slicing the searchable portion\nof the array. If it's negative it will add the array length to\nthe startAt value passed in as the index to search from. If less\nthan or equal to -1 * array.length the entire array is searched.

\n

This method has the same behavior of JavaScript's Array.includes.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
[1, 2, 3].includes(2);     // true\n[1, 2, 3].includes(4);     // false\n[1, 2, 3].includes(3, 2);  // true\n[1, 2, 3].includes(3, 3);  // false\n[1, 2, 3].includes(3, -1); // true\n[1, 2, 3].includes(1, -1); // false\n[1, 2, 3].includes(1, -4); // true\n[1, 2, NaN].includes(NaN); // true
\n
\n
\n \n", + "itemtype": "method", + "name": "includes", + "params": [ + { + "name": "object", + "description": "The object to search for.", + "type": "Object" + }, + { + "name": "startAt", + "description": "optional starting location to search, default 0", + "type": "Number" + } + ], + "return": { + "description": "`true` if object is found in the array.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1125, + "description": "

Sorts the array by the keys specified in the argument.

\n

You may provide multiple arguments to sort by multiple properties.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
   let colors = [\n { name: 'red', weight: 500 },\n { name: 'green', weight: 600 },\n { name: 'blue', weight: 500 }\n];\n\n   colors.sortBy('name');\n   // [{name: 'blue', weight: 500}, {name: 'green', weight: 600}, {name: 'red', weight: 500}]\n\n   colors.sortBy('weight', 'name');\n   // [{name: 'blue', weight: 500}, {name: 'red', weight: 500}, {name: 'green', weight: 600}]
\n
\n
\n \n", + "itemtype": "method", + "name": "sortBy", + "params": [ + { + "name": "property", + "description": "name(s) to sort on", + "type": "String" + } + ], + "return": { + "description": "The sorted array.", + "type": "Array" + }, + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1150, + "description": "

Returns a new array that contains only unique values. The default\nimplementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'a', 'b', 'b'];\narr.uniq();  // ['a', 'b']
\n
\n
\n \n

This only works on primitive data types, e.g. Strings, Numbers, etc.

\n", + "itemtype": "method", + "name": "uniq", + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1166, + "description": "

Returns a new array that contains only items containing a unique property value.\nThe default implementation returns an array regardless of the receiver type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }];\narr.uniqBy('value');  // [{ value: 'a' }, { value: 'b' }]\n\nlet arr = [2.2, 2.1, 3.2, 3.3];\narr.uniqBy(Math.floor);  // [2.2, 3.2];
\n
\n
\n \n", + "itemtype": "method", + "name": "uniqBy", + "params": [ + { + "name": "key", + "description": "", + "type": "String,Function" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 1185, + "description": "

Returns a new array that excludes the passed value. The default\nimplementation returns an array regardless of the receiver type.\nIf the receiver does not contain the value it returns the original array.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let arr = ['a', 'b', 'a', 'c'];\narr.without('a');  // ['b', 'c']
\n
\n
\n \n", + "itemtype": "method", + "name": "without", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "EmberArray" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/array/index.ts", + "line": 253, + "description": "

Required. You must implement this method to apply this mixin.

\n

Your array must support the length property. Your replace methods should\nset this property whenever it changes.

\n", + "itemtype": "property", + "name": "length", + "type": "Number", + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 304, + "description": "

This is the handler for the special array content property. If you get\nthis property, it will return this. If you set this property to a new\narray, it will replace the current content.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let peopleToMoon = ['Armstrong', 'Aldrin'];\n\npeopleToMoon.get('[]'); // ['Armstrong', 'Aldrin']\n\npeopleToMoon.set('[]', ['Collins']); // ['Collins']\npeopleToMoon.get('[]'); // ['Collins']
\n
\n
\n \n", + "itemtype": "property", + "name": "[]", + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 324, + "description": "

The first object in the array, or undefined if the array is empty.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let vowels = ['a', 'e', 'i', 'o', 'u'];\nvowels.firstObject; // 'a'\n\nvowels.shiftObject();\nvowels.firstObject; // 'e'\n\nvowels.reverseObjects();\nvowels.firstObject; // 'u'\n\nvowels.clear();\nvowels.firstObject; // undefined
\n
\n
\n \n", + "itemtype": "property", + "name": "firstObject", + "return": { + "description": "The first object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 346, + "description": "

The last object in the array, or undefined if the array is empty.

\n", + "itemtype": "property", + "name": "lastObject", + "return": { + "description": "The last object in the array", + "type": "Object | undefined" + }, + "access": "public", + "tagname": "", + "class": "MutableArray", + "module": "@ember/array", + "inherited": true, + "inheritedFrom": "EmberArray" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/array", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-Namespace.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-Namespace.json new file mode 100644 index 000000000..5a00dc5ac --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-Namespace.json @@ -0,0 +1,536 @@ +{ + "data": { + "id": "ember-5.3.0-Namespace", + "type": "class", + "attributes": { + "name": "Namespace", + "shortname": "Namespace", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/application/namespace", + "namespace": "", + "file": "packages/@ember/application/namespace.ts", + "line": 20, + "description": "

A Namespace is an object usually used to contain other objects or methods\nsuch as an application or framework. Create a namespace anytime you want\nto define one of these new containers.

\n

Example Usage

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
MyFramework = Ember.Namespace.create({\n  VERSION: '1.0.0'\n});
\n
\n
\n \n", + "extends": "EmberObject", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/object/core.ts", + "line": 322, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 541, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 568, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 576, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 164, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 212, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 229, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 247, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 333, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 354, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 371, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 388, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 403, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 433, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 453, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 497, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/object/core.ts", + "line": 356, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 430, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 505, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 523, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Namespace", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-5.3.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/application/namespace", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-NoneLocation.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-NoneLocation.json new file mode 100644 index 000000000..70a154628 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-NoneLocation.json @@ -0,0 +1,639 @@ +{ + "data": { + "id": "ember-5.3.0-NoneLocation", + "type": "class", + "attributes": { + "name": "NoneLocation", + "shortname": "NoneLocation", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing/none-location", + "namespace": "", + "file": "packages/@ember/routing/none-location.ts", + "line": 9, + "description": "

NoneLocation does not interact with the browser. It is useful for\ntesting, or when you need to manage state with your Router, but temporarily\ndon't want it to muck with the URL (for example when you embed your\napplication in a larger page).

\n

Using NoneLocation causes Ember to not store the applications URL state\nin the actual URL. This is generally used for testing purposes, and is one\nof the changes made when calling App.setupForTesting().

\n", + "extends": "EmberObject", + "access": "protected", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/routing/none-location.ts", + "line": 53, + "description": "

Returns the current path without rootURL.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "getURL", + "return": { + "description": "path", + "type": "String" + }, + "class": "NoneLocation", + "module": "@ember/routing/none-location" + }, + { + "file": "packages/@ember/routing/none-location.ts", + "line": 70, + "description": "

Set the path and remembers what was set. Using this method\nto change the path will not invoke the updateURL callback.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setURL", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + } + ], + "class": "NoneLocation", + "module": "@ember/routing/none-location" + }, + { + "file": "packages/@ember/routing/none-location.ts", + "line": 82, + "description": "

Register a callback to be invoked when the path changes. These\ncallbacks will execute when the user presses the back or forward\nbutton, but not after setURL is invoked.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "onUpdateURL", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "class": "NoneLocation", + "module": "@ember/routing/none-location" + }, + { + "file": "packages/@ember/routing/none-location.ts", + "line": 95, + "description": "

Sets the path and calls the updateURL callback.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "handleURL", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "class": "NoneLocation", + "module": "@ember/routing/none-location" + }, + { + "file": "packages/@ember/routing/none-location.ts", + "line": 109, + "description": "

Given a URL, formats it to be placed into the page as part\nof an element's href attribute.

\n

This is used, for example, when using the {{action}} helper\nto generate a URL based on an event.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "formatURL", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "NoneLocation", + "module": "@ember/routing/none-location" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 322, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 541, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 568, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 576, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 164, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 212, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 229, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 247, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 333, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 354, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 371, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 388, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 403, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 433, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 453, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 497, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/routing/none-location.ts", + "line": 29, + "description": "

Will be pre-pended to path.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "rootURL", + "default": "'/'", + "class": "NoneLocation", + "module": "@ember/routing/none-location" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 356, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 430, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 505, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 523, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "NoneLocation", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-5.3.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/routing/none-location", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-ObjectProxy.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-ObjectProxy.json new file mode 100644 index 000000000..113d81d8a --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-ObjectProxy.json @@ -0,0 +1,571 @@ +{ + "data": { + "id": "ember-5.3.0-ObjectProxy", + "type": "class", + "attributes": { + "name": "ObjectProxy", + "shortname": "ObjectProxy", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object/proxy", + "namespace": "", + "file": "packages/@ember/object/proxy.ts", + "line": 8, + "description": "

ObjectProxy forwards all properties not defined by the proxy itself\nto a proxied content object.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import EmberObject from '@ember/object';\nimport ObjectProxy from '@ember/object/proxy';\n\nlet exampleObject = EmberObject.create({\n  name: 'Foo'\n});\n\nlet exampleProxy = ObjectProxy.create({\n  content: exampleObject\n});\n\n// Access and change existing properties\nexampleProxy.get('name');          // 'Foo'\nexampleProxy.set('name', 'Bar');\nexampleObject.get('name');         // 'Bar'\n\n// Create new 'description' property on `exampleObject`\nexampleProxy.set('description', 'Foo is a whizboo baz');\nexampleObject.get('description');  // 'Foo is a whizboo baz'
\n
\n
\n \n

While content is unset, setting a property to be delegated will throw an\nError.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import ObjectProxy from '@ember/object/proxy';\n\nlet exampleProxy = ObjectProxy.create({\n  content: null,\n  flag: null\n});\nexampleProxy.set('flag', true);\nexampleProxy.get('flag');         // true\nexampleProxy.get('foo');          // undefined\nexampleProxy.set('foo', 'data');  // throws Error
\n
\n
\n \n

Delegated properties can be bound to and will change when content is updated.

\n

Computed properties on the proxy itself can depend on delegated properties.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n
import { computed } from '@ember/object';\nimport ObjectProxy from '@ember/object/proxy';\n\nProxyWithComputedProperty = ObjectProxy.extend({\n  fullName: computed('firstName', 'lastName', function() {\n    var firstName = this.get('firstName'),\n        lastName = this.get('lastName');\n    if (firstName && lastName) {\n      return firstName + ' ' + lastName;\n    }\n    return firstName || lastName;\n  })\n});\n\nlet exampleProxy = ProxyWithComputedProperty.create();\n\nexampleProxy.get('fullName');  // undefined\nexampleProxy.set('content', {\n  firstName: 'Tom', lastName: 'Dale'\n}); // triggers property change for fullName on proxy\n\nexampleProxy.get('fullName');  // 'Tom Dale'
\n
\n
\n \n", + "extends": "EmberObject", + "uses": [ + "Ember.ProxyMixin" + ], + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/object/core.ts", + "line": 322, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 541, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 568, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 576, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 164, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 212, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 229, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 247, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 333, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 354, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 371, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 388, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 403, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 433, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 453, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 497, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/runtime/lib/mixins/-proxy.ts", + "line": 72, + "description": "

The object whose properties will be forwarded.

\n", + "itemtype": "property", + "name": "content", + "type": "{unknown}", + "default": "null", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ProxyMixin" + }, + { + "file": "packages/@ember/-internals/runtime/lib/mixins/-proxy.ts", + "line": 94, + "description": "

The object whose properties will be forwarded.

\n", + "itemtype": "property", + "name": "content", + "type": "{unknown}", + "default": "null", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "ember", + "namespace": "Ember", + "inherited": true, + "inheritedFrom": "Ember.ProxyMixin" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 356, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 430, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 505, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 523, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "ObjectProxy", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-5.3.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/object/proxy", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-Observable.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-Observable.json new file mode 100644 index 000000000..59beef3c7 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-Observable.json @@ -0,0 +1,388 @@ +{ + "data": { + "id": "ember-5.3.0-Observable", + "type": "class", + "attributes": { + "name": "Observable", + "shortname": "Observable", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Ember.NativeArray", + "EmberObject" + ], + "module": "@ember/object/observable", + "namespace": "", + "file": "packages/@ember/object/observable.ts", + "line": 22, + "description": "

Overview

\n

This mixin provides properties and property observing functionality, core\nfeatures of the Ember object model.

\n

Properties and observers allow one object to observe changes to a\nproperty on another object. This is one of the fundamental ways that\nmodels, controllers and views communicate with each other in an Ember\napplication.

\n

Any object that has this mixin applied can be used in observer\noperations. That includes EmberObject and most objects you will\ninteract with as you write your Ember application.

\n

Note that you will not generally apply this mixin to classes yourself,\nbut you will use the features provided by this module frequently, so it\nis important to understand how to use it.

\n

Using get() and set()

\n

Because of Ember's support for bindings and observers, you will always\naccess properties using the get method, and set properties using the\nset method. This allows the observing objects to be notified and\ncomputed properties to be handled properly.

\n

More documentation about get and set are below.

\n

Observing Property Changes

\n

You typically observe property changes simply by using the observer\nfunction in classes that you write.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import { observer } from '@ember/object';\nimport EmberObject from '@ember/object';\n\nEmberObject.extend({\n  valueObserver: observer('value', function(sender, key, value, rev) {\n    // Executes whenever the "value" property changes\n    // See the addObserver method for more information about the callback arguments\n  })\n});
\n
\n
\n \n

Although this is the most common way to add an observer, this capability\nis actually built into the EmberObject class on top of two methods\ndefined in this mixin: addObserver and removeObserver. You can use\nthese two methods to add and remove observers yourself if you need to\ndo so at runtime.

\n

To add an observer for a property, call:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
object.addObserver('propertyKey', targetObject, targetAction)
\n
\n
\n \n

This will call the targetAction method on the targetObject whenever\nthe value of the propertyKey changes.

\n

Note that if propertyKey is a computed property, the observer will be\ncalled when any of the property dependencies are changed, even if the\nresulting value of the computed property is unchanged. This is necessary\nbecause computed properties are not computed until get is called.

\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object/observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object/observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 164, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object/observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 212, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object/observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 229, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object/observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 247, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object/observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 333, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object/observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 354, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object/observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 371, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object/observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 388, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object/observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 403, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Observable", + "module": "@ember/object/observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 433, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Observable", + "module": "@ember/object/observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 453, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Observable", + "module": "@ember/object/observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 497, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Observable", + "module": "@ember/object/observable" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/object/observable", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-Owner.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-Owner.json new file mode 100644 index 000000000..77d37cc9e --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-Owner.json @@ -0,0 +1,134 @@ +{ + "data": { + "id": "ember-5.3.0-Owner", + "type": "class", + "attributes": { + "name": "Owner", + "shortname": "Owner", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/owner", + "namespace": "", + "file": "packages/@ember/-internals/owner/index.ts", + "line": 294, + "description": "

Framework objects in an Ember application (components, services, routes,\netc.) are created via a factory and dependency injection system. Each of\nthese objects is the responsibility of an "owner", which handles its\ninstantiation and manages its lifetime.

\n

An Owner is not a class you construct; it is one the framework constructs\nfor you. The normal way to get access to the relevant Owner is using the\ngetOwner function.

\n", + "uses": [ + "BasicContainer", + "BasicRegistry" + ], + "since": "4.10.0", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 198, + "description": "

Given a fullName return a corresponding instance.

\n

The default behavior is for lookup to return a singleton instance.\nThe singleton is scoped to the container, allowing multiple containers\nto all have their own locally scoped singletons.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter');\n\ntwitter instanceof Twitter; // => true\n\n// by default the container will return singletons\nlet twitter2 = container.lookup('api:twitter');\ntwitter2 instanceof Twitter; // => true\n\ntwitter === twitter2; //=> true
\n
\n
\n \n

If singletons are not wanted an optional flag can be provided at lookup.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let registry = new Registry();\nlet container = registry.container();\n\nregistry.register('api:twitter', Twitter);\n\nlet twitter = container.lookup('api:twitter', { singleton: false });\nlet twitter2 = container.lookup('api:twitter', { singleton: false });\n\ntwitter === twitter2; //=> false
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "lookup", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "RegisterOptions" + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "Owner", + "module": "@ember/owner", + "inherited": true, + "inheritedFrom": "BasicContainer" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 247, + "description": "

Given a FullName, of the form "type:name" return a FactoryManager.

\n

This method returns a manager which can be used for introspection of the\nfactory's class or for the creation of factory instances with initial\nproperties. The manager is an object with the following properties:

\n
    \n
  • class - The registered or resolved class.
  • \n
  • create - A function that will create an instance of the class with\nany dependencies injected.
  • \n
\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import { getOwner } from '@ember/application';\n\nlet owner = getOwner(otherInstance);\n// the owner is commonly the `applicationInstance`, and can be accessed via\n// an instance initializer.\n\nlet factory = owner.factoryFor('service:bespoke');\n\nfactory.class;\n// The registered or resolved class. For example when used with an Ember-CLI\n// app, this would be the default export from `app/services/bespoke.js`.\n\nlet instance = factory.create({\n  someProperty: 'an initial property value'\n});\n// Create an instance with any injections and the passed options as\n// initial properties.
\n
\n
\n \n

Any instances created via the factory's .create() method must be destroyed\nmanually by the caller of .create(). Typically, this is done during the creating\nobjects own destroy or willDestroy methods.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "factoryFor", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "FactoryManager" + }, + "class": "Owner", + "module": "@ember/owner", + "inherited": true, + "inheritedFrom": "BasicContainer" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 107, + "description": "

Registers a factory that can be used for dependency injection (with\ninject) or for service lookup. Each factory is registered with\na full name including two parts: type:name.

\n

A simple example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Orange = EmberObject.extend();\nApp.register('fruit:favorite', App.Orange);
\n
\n
\n \n

Ember will resolve factories from the App namespace automatically.\nFor example App.CarsController will be discovered and returned if\nan application requests controller:cars.

\n

An example of registering a controller with a non-standard name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Application from '@ember/application';\nimport Controller from '@ember/controller';\n\nlet App = Application.create();\nlet Session = Controller.extend();\n\nApp.register('controller:session', Session);\n\n// The Session controller can now be treated like a normal controller,\n// despite its non-standard name.\nApp.ApplicationController = Controller.extend({\n  needs: ['session']\n});
\n
\n
\n \n

Registered factories are instantiated by having create\ncalled on them. Additionally they are singletons, each time\nthey are looked up they return the same instance.

\n

Some examples modifying that default behavior:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Person = EmberObject.extend();\nApp.Orange = EmberObject.extend();\nApp.Email = EmberObject.extend();\nApp.session = EmberObject.create();\n\nApp.register('model:user', App.Person, { singleton: false });\nApp.register('fruit:favorite', App.Orange);\nApp.register('communication:main', App.Email, { singleton: false });\nApp.register('session', App.session, { instantiate: false });
\n
\n
\n \n", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "type:name (e.g., 'model:user')", + "type": "String" + }, + { + "name": "factory", + "description": "(e.g., App.Person)", + "type": "Factory|object" + }, + { + "name": "options", + "description": "(optional) disable instantiation or singleton usage", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "Owner", + "module": "@ember/owner", + "inherited": true, + "inheritedFrom": "BasicRegistry" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/owner", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-Promise.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-Promise.json new file mode 100644 index 000000000..0450fc50c --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-Promise.json @@ -0,0 +1,246 @@ +{ + "data": { + "id": "ember-5.3.0-Promise", + "type": "class", + "attributes": { + "name": "Promise", + "shortname": "Promise", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "rsvp", + "file": "node_modules/rsvp/lib/rsvp/promise.js", + "line": 26, + "description": "

Promise objects represent the eventual result of an asynchronous operation. The\nprimary way of interacting with a promise is through its then method, which\nregisters callbacks to receive either a promise’s eventual value or the reason\nwhy the promise cannot be fulfilled.

\n

Terminology

\n
    \n
  • promise is an object or function with a then method whose behavior conforms to this specification.
  • \n
  • thenable is an object or function that defines a then method.
  • \n
  • value is any legal JavaScript value (including undefined, a thenable, or a promise).
  • \n
  • exception is a value that is thrown using the throw statement.
  • \n
  • reason is a value that indicates why a promise was rejected.
  • \n
  • settled the final resting state of a promise, fulfilled or rejected.
  • \n
\n

A promise can be in one of three states: pending, fulfilled, or rejected.

\n

Promises that are fulfilled have a fulfillment value and are in the fulfilled\nstate. Promises that are rejected have a rejection reason and are in the\nrejected state. A fulfillment value is never a thenable.

\n

Promises can also be said to resolve a value. If this value is also a\npromise, then the original promise's settled state will match the value's\nsettled state. So a promise that resolves a promise that rejects will\nitself reject, and a promise that resolves a promise that fulfills will\nitself fulfill.

\n

Basic Usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
let promise = new Promise(function(resolve, reject) {\n  // on success\n  resolve(value);\n\n  // on failure\n  reject(reason);\n});\n\npromise.then(function(value) {\n  // on fulfillment\n}, function(reason) {\n  // on rejection\n});
\n
\n
\n \n

Advanced Usage:

\n

Promises shine when abstracting away asynchronous interactions such as\nXMLHttpRequests.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n
function getJSON(url) {\n  return new Promise(function(resolve, reject){\n    let xhr = new XMLHttpRequest();\n\n    xhr.open('GET', url);\n    xhr.onreadystatechange = handler;\n    xhr.responseType = 'json';\n    xhr.setRequestHeader('Accept', 'application/json');\n    xhr.send();\n\n    function handler() {\n      if (this.readyState === this.DONE) {\n        if (this.status === 200) {\n          resolve(this.response);\n        } else {\n          reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']'));\n        }\n      }\n    };\n  });\n}\n\ngetJSON('/posts.json').then(function(json) {\n  // on fulfillment\n}, function(reason) {\n  // on rejection\n});
\n
\n
\n \n

Unlike callbacks, promises are great composable primitives.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
Promise.all([\n  getJSON('/posts'),\n  getJSON('/comments')\n]).then(function(values){\n  values[0] // => postsJSON\n  values[1] // => commentsJSON\n\n  return values;\n});
\n
\n
\n \n", + "access": "public", + "tagname": "", + "params": [ + { + "name": "resolver", + "description": "", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "is_constructor": 1, + "methods": [ + { + "file": "node_modules/rsvp/lib/rsvp/promise/all.js", + "line": 3, + "description": "

Promise.all accepts an array of promises, and returns a new promise which\nis fulfilled with an array of fulfillment values for the passed promises, or\nrejected with the reason of the first passed promise to be rejected. It casts all\nelements of the passed iterable to promises as it runs this algorithm.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Promise, { resolve } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = resolve(2);\nlet promise3 = resolve(3);\nlet promises = [ promise1, promise2, promise3 ];\n\nPromise.all(promises).then(function(array){\n  // The array here would be [ 1, 2, 3 ];\n});
\n
\n
\n \n

If any of the promises given to RSVP.all are rejected, the first promise\nthat is rejected will be given as an argument to the returned promises's\nrejection handler. For example:

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Promise, { resolve, reject } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = reject(new Error("2"));\nlet promise3 = reject(new Error("3"));\nlet promises = [ promise1, promise2, promise3 ];\n\nPromise.all(promises).then(function(array){\n  // Code here never runs because there are rejected promises!\n}, function(error) {\n  // error.message === "2"\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "all", + "params": [ + { + "name": "entries", + "description": "array of promises", + "type": "Array" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled when all `promises` have been\nfulfilled, or rejected if any of them become rejected.", + "type": "Promise" + }, + "static": 1, + "class": "Promise" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise/race.js", + "line": 9, + "description": "

Promise.race returns a new promise which is settled in the same way as the\nfirst passed promise to settle.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import Promise from 'rsvp';\n\nlet promise1 = new Promise(function(resolve, reject){\n  setTimeout(function(){\n    resolve('promise 1');\n  }, 200);\n});\n\nlet promise2 = new Promise(function(resolve, reject){\n  setTimeout(function(){\n    resolve('promise 2');\n  }, 100);\n});\n\nPromise.race([promise1, promise2]).then(function(result){\n  // result === 'promise 2' because it was resolved before promise1\n  // was resolved.\n});
\n
\n
\n \n

Promise.race is deterministic in that only the state of the first\nsettled promise matters. For example, even if other promises given to the\npromises array argument are resolved, but the first settled promise has\nbecome rejected before the other promises became fulfilled, the returned\npromise will become rejected:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n
import Promise from 'rsvp';\n\nlet promise1 = new Promise(function(resolve, reject){\n  setTimeout(function(){\n    resolve('promise 1');\n  }, 200);\n});\n\nlet promise2 = new Promise(function(resolve, reject){\n  setTimeout(function(){\n    reject(new Error('promise 2'));\n  }, 100);\n});\n\nPromise.race([promise1, promise2]).then(function(result){\n  // Code here never runs\n}, function(reason){\n  // reason.message === 'promise 2' because promise 2 became rejected before\n  // promise 1 became fulfilled\n});
\n
\n
\n \n

An example real-world use case is implementing timeouts:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
import Promise from 'rsvp';\n\nPromise.race([ajax('foo.json'), timeout(5000)])
\n
\n
\n \n", + "itemtype": "method", + "name": "race", + "static": 1, + "params": [ + { + "name": "entries", + "description": "array of promises to observe", + "type": "Array" + }, + { + "name": "label", + "description": "optional string for describing the promise returned.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise which settles in the same way as the first passed\npromise to settle.", + "type": "Promise" + }, + "class": "Promise" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise/reject.js", + "line": 6, + "description": "

Promise.reject returns a promise rejected with the passed reason.\nIt is shorthand for the following:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Promise from 'rsvp';\n\nlet promise = new Promise(function(resolve, reject){\n  reject(new Error('WHOOPS'));\n});\n\npromise.then(function(value){\n  // Code here doesn't run because the promise is rejected!\n}, function(reason){\n  // reason.message === 'WHOOPS'\n});
\n
\n
\n \n

Instead of writing the above, your code now simply becomes the following:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Promise from 'rsvp';\n\nlet promise = Promise.reject(new Error('WHOOPS'));\n\npromise.then(function(value){\n  // Code here doesn't run because the promise is rejected!\n}, function(reason){\n  // reason.message === 'WHOOPS'\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "reject", + "static": 1, + "params": [ + { + "name": "reason", + "description": "value that the returned promise will be rejected with.", + "type": "*" + }, + { + "name": "label", + "description": "optional string for identifying the returned promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise rejected with the given `reason`.", + "type": "Promise" + }, + "class": "Promise" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise/resolve.js", + "line": 6, + "description": "

Promise.resolve returns a promise that will become resolved with the\npassed value. It is shorthand for the following:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Promise from 'rsvp';\n\nlet promise = new Promise(function(resolve, reject){\n  resolve(1);\n});\n\npromise.then(function(value){\n  // value === 1\n});
\n
\n
\n \n

Instead of writing the above, your code now simply becomes the following:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Promise from 'rsvp';\n\nlet promise = RSVP.Promise.resolve(1);\n\npromise.then(function(value){\n  // value === 1\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "resolve", + "static": 1, + "params": [ + { + "name": "object", + "description": "value that the returned promise will be resolved with", + "type": "*" + }, + { + "name": "label", + "description": "optional string for identifying the returned promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise that will become fulfilled with the given\n`value`", + "type": "Promise" + }, + "class": "Promise" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise.js", + "line": 155, + "description": "

catch is simply sugar for then(undefined, onRejection) which makes it the same\nas the catch block of a try/catch statement.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
function findAuthor(){\n  throw new Error('couldn\\'t find that author');\n}\n\n// synchronous\ntry {\n  findAuthor();\n} catch(reason) {\n  // something went wrong\n}\n\n// async with promises\nfindAuthor().catch(function(reason){\n  // something went wrong\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "catch", + "params": [ + { + "name": "onRejection", + "description": "", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "Promise", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise.js", + "line": 187, + "description": "

finally will be invoked regardless of the promise's fate just as native\ntry/catch/finally behaves

\n

Synchronous example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
findAuthor() {\n  if (Math.random() > 0.5) {\n    throw new Error();\n  }\n  return new Author();\n}\n\ntry {\n  return findAuthor(); // succeed or fail\n} catch(error) {\n  return findOtherAuthor();\n} finally {\n  // always runs\n  // doesn't affect the return value\n}
\n
\n
\n \n

Asynchronous example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
findAuthor().catch(function(reason){\n  return findOtherAuthor();\n}).finally(function(){\n  // author was either found, or not\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "finally", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "Promise", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise.js", + "line": 248, + "description": "

The primary way of interacting with a promise is through its then method,\nwhich registers callbacks to receive either a promise's eventual value or the\nreason why the promise cannot be fulfilled.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
findUser().then(function(user){\n  // user is available\n}, function(reason){\n  // user is unavailable, and you are given the reason why\n});
\n
\n
\n \n

Chaining

\n

The return value of then is itself a promise. This second, 'downstream'\npromise is resolved with the return value of the first promise's fulfillment\nor rejection handler, or rejected if the handler throws an exception.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
findUser().then(function (user) {\n  return user.name;\n}, function (reason) {\n  return 'default name';\n}).then(function (userName) {\n  // If `findUser` fulfilled, `userName` will be the user's name, otherwise it\n  // will be `'default name'`\n});\n\nfindUser().then(function (user) {\n  throw new Error('Found user, but still unhappy');\n}, function (reason) {\n  throw new Error('`findUser` rejected and we\\'re unhappy');\n}).then(function (value) {\n  // never reached\n}, function (reason) {\n  // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.\n  // If `findUser` rejected, `reason` will be '`findUser` rejected and we\\'re unhappy'.\n});
\n
\n
\n \n

If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
findUser().then(function (user) {\n  throw new PedagogicalException('Upstream error');\n}).then(function (value) {\n  // never reached\n}).then(function (value) {\n  // never reached\n}, function (reason) {\n  // The `PedgagocialException` is propagated all the way down to here\n});
\n
\n
\n \n

Assimilation

\n

Sometimes the value you want to propagate to a downstream promise can only be\nretrieved asynchronously. This can be achieved by returning a promise in the\nfulfillment or rejection handler. The downstream promise will then be pending\nuntil the returned promise is settled. This is called assimilation.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
findUser().then(function (user) {\n  return findCommentsByAuthor(user);\n}).then(function (comments) {\n  // The user's comments are now available\n});
\n
\n
\n \n

If the assimliated promise rejects, then the downstream promise will also reject.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
findUser().then(function (user) {\n  return findCommentsByAuthor(user);\n}).then(function (comments) {\n  // If `findCommentsByAuthor` fulfills, we'll have the value here\n}, function (reason) {\n  // If `findCommentsByAuthor` rejects, we'll have the reason here\n});
\n
\n
\n \n

Simple Example

\n

Synchronous Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
let result;\n\ntry {\n  result = findResult();\n  // success\n} catch(reason) {\n  // failure\n}
\n
\n
\n \n

Errback Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
findResult(function(result, err){\n  if (err) {\n    // failure\n  } else {\n    // success\n  }\n});
\n
\n
\n \n

Promise Example;

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
findResult().then(function(result){\n  // success\n}, function(reason){\n  // failure\n});
\n
\n
\n \n

Advanced Example

\n

Synchronous Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let author, books;\n\ntry {\n  author = findAuthor();\n  books  = findBooksByAuthor(author);\n  // success\n} catch(reason) {\n  // failure\n}
\n
\n
\n \n

Errback Example

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n
function foundBooks(books) {\n\n}\n\nfunction failure(reason) {\n\n}\n\nfindAuthor(function(author, err){\n  if (err) {\n    failure(err);\n    // failure\n  } else {\n    try {\n      findBoooksByAuthor(author, function(books, err) {\n        if (err) {\n          failure(err);\n        } else {\n          try {\n            foundBooks(books);\n          } catch(reason) {\n            failure(reason);\n          }\n        }\n      });\n    } catch(error) {\n      failure(err);\n    }\n    // success\n  }\n});
\n
\n
\n \n

Promise Example;

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
findAuthor().\n  then(findBooksByAuthor).\n  then(function(books){\n    // found books\n}).catch(function(reason){\n  // something went wrong\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "then", + "params": [ + { + "name": "onFulfillment", + "description": "", + "type": "Function" + }, + { + "name": "onRejection", + "description": "", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "Promise", + "module": "rsvp" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-rsvp", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-PromiseProxyMixin.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-PromiseProxyMixin.json new file mode 100644 index 000000000..3f2b30d50 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-PromiseProxyMixin.json @@ -0,0 +1,186 @@ +{ + "data": { + "id": "ember-5.3.0-PromiseProxyMixin", + "type": "class", + "attributes": { + "name": "PromiseProxyMixin", + "shortname": "PromiseProxyMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object/promise-proxy-mixin", + "namespace": "", + "file": "packages/@ember/object/promise-proxy-mixin.ts", + "line": 46, + "description": "

A low level mixin making ObjectProxy promise-aware.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { resolve } from 'rsvp';\nimport $ from 'jquery';\nimport ObjectProxy from '@ember/object/proxy';\nimport PromiseProxyMixin from '@ember/object/promise-proxy-mixin';\n\nlet ObjectPromiseProxy = ObjectProxy.extend(PromiseProxyMixin);\n\nlet proxy = ObjectPromiseProxy.create({\n  promise: resolve($.getJSON('/some/remote/data.json'))\n});\n\nproxy.then(function(json){\n   // the json\n}, function(reason) {\n   // the reason why you have no json\n});
\n
\n
\n \n

the proxy has bindable attributes which\ntrack the promises life cycle

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
proxy.get('isPending')   //=> true\nproxy.get('isSettled')  //=> false\nproxy.get('isRejected')  //=> false\nproxy.get('isFulfilled') //=> false
\n
\n
\n \n

When the $.getJSON completes, and the promise is fulfilled\nwith json, the life cycle attributes will update accordingly.\nNote that $.getJSON doesn't return an ECMA specified promise,\nit is useful to wrap this with an RSVP.resolve so that it behaves\nas a spec compliant promise.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
proxy.get('isPending')   //=> false\nproxy.get('isSettled')   //=> true\nproxy.get('isRejected')  //=> false\nproxy.get('isFulfilled') //=> true
\n
\n
\n \n

As the proxy is an ObjectProxy, and the json now its content,\nall the json properties will be available directly from the proxy.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
// Assuming the following json:\n{\n  firstName: 'Stefan',\n  lastName: 'Penner'\n}\n\n// both properties will accessible on the proxy\nproxy.get('firstName') //=> 'Stefan'\nproxy.get('lastName')  //=> 'Penner'
\n
\n
\n \n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/object/promise-proxy-mixin.ts", + "line": 176, + "description": "

An alias to the proxied promise's then.

\n

See RSVP.Promise.then.

\n", + "itemtype": "method", + "name": "then", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "", + "type": "RSVP.Promise" + }, + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object/promise-proxy-mixin" + }, + { + "file": "packages/@ember/object/promise-proxy-mixin.ts", + "line": 187, + "description": "

An alias to the proxied promise's catch.

\n

See RSVP.Promise.catch.

\n", + "itemtype": "method", + "name": "catch", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "", + "type": "RSVP.Promise" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object/promise-proxy-mixin" + }, + { + "file": "packages/@ember/object/promise-proxy-mixin.ts", + "line": 199, + "description": "

An alias to the proxied promise's finally.

\n

See RSVP.Promise.finally.

\n", + "itemtype": "method", + "name": "finally", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "", + "type": "RSVP.Promise" + }, + "since": "1.3.0", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object/promise-proxy-mixin" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/object/promise-proxy-mixin.ts", + "line": 110, + "description": "

If the proxied promise is rejected this will contain the reason\nprovided.

\n", + "itemtype": "property", + "name": "reason", + "default": "null", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object/promise-proxy-mixin" + }, + { + "file": "packages/@ember/object/promise-proxy-mixin.ts", + "line": 120, + "description": "

Once the proxied promise has settled this will become false.

\n", + "itemtype": "property", + "name": "isPending", + "default": "true", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object/promise-proxy-mixin" + }, + { + "file": "packages/@ember/object/promise-proxy-mixin.ts", + "line": 128, + "description": "

Once the proxied promise has settled this will become true.

\n", + "itemtype": "property", + "name": "isSettled", + "default": "false", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object/promise-proxy-mixin" + }, + { + "file": "packages/@ember/object/promise-proxy-mixin.ts", + "line": 137, + "description": "

Will become true if the proxied promise is rejected.

\n", + "itemtype": "property", + "name": "isRejected", + "default": "false", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object/promise-proxy-mixin" + }, + { + "file": "packages/@ember/object/promise-proxy-mixin.ts", + "line": 145, + "description": "

Will become true if the proxied promise is fulfilled.

\n", + "itemtype": "property", + "name": "isFulfilled", + "default": "false", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object/promise-proxy-mixin" + }, + { + "file": "packages/@ember/object/promise-proxy-mixin.ts", + "line": 154, + "description": "

The promise whose fulfillment value is being proxied by this object.

\n

This property must be specified upon creation, and should not be\nchanged once created.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
import ObjectProxy from '@ember/object/proxy';\nimport PromiseProxyMixin from '@ember/object/promise-proxy-mixin';\n\nObjectProxy.extend(PromiseProxyMixin).create({\n  promise: <thenable>\n});
\n
\n
\n \n", + "itemtype": "property", + "name": "promise", + "access": "public", + "tagname": "", + "class": "PromiseProxyMixin", + "module": "@ember/object/promise-proxy-mixin" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/object/promise-proxy-mixin", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-RegisterOptions.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-RegisterOptions.json new file mode 100644 index 000000000..3f3fbbe0a --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-RegisterOptions.json @@ -0,0 +1,74 @@ +{ + "data": { + "id": "ember-5.3.0-RegisterOptions", + "type": "class", + "attributes": { + "name": "RegisterOptions", + "shortname": "RegisterOptions", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/owner", + "namespace": "", + "file": "packages/@ember/-internals/owner/index.ts", + "line": 313, + "description": "

Interface representing the options for registering an item as a factory.

\n", + "access": "public", + "tagname": "", + "methods": [], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 321, + "description": "

Whether to instantiate the item when returning it from a lookup. Defaults\nto true.

\n", + "itemtype": "property", + "name": "instantiate", + "type": "Boolean", + "optional": 1, + "default": "true", + "access": "public", + "tagname": "", + "class": "RegisterOptions", + "module": "@ember/owner" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 332, + "description": "

Whether the item is a singleton (like a service) and so should return the\nsame instance every time, or should generate a new instance on each call.\nDefaults to true.

\n", + "itemtype": "property", + "name": "singleton", + "type": "Boolean", + "optional": 1, + "default": "true", + "access": "public", + "tagname": "", + "class": "RegisterOptions", + "module": "@ember/owner" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/owner", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-Registry.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-Registry.json new file mode 100644 index 000000000..7ac233381 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-Registry.json @@ -0,0 +1,407 @@ +{ + "data": { + "id": "ember-5.3.0-Registry", + "type": "class", + "attributes": { + "name": "Registry", + "shortname": "Registry", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "rsvp", + "namespace": "", + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 36, + "description": "

A registry used to store factory and option information keyed\nby type.

\n

A Registry stores the factory and option information needed by a\nContainer to instantiate and cache objects.

\n

The API for Registry is still in flux and should not be considered stable.

\n", + "access": "private", + "tagname": "", + "since": "1.11.0", + "methods": [ + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 125, + "description": "

Creates a container based on this registry.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "container", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "created container", + "type": "Container" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 137, + "description": "

Registers a factory for later injection.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let registry = new Registry();\n\nregistry.register('model:user', Person, {singleton: false });\nregistry.register('fruit:favorite', Orange);\nregistry.register('communication:main', Email, {singleton: false});
\n
\n
\n \n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "factory", + "description": "", + "type": "Function" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 186, + "description": "

Unregister a fullName

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let registry = new Registry();\nregistry.register('model:user', User);\n\nregistry.resolve('model:user').create() instanceof User //=> true\n\nregistry.unregister('model:user')\nregistry.resolve('model:user') === undefined //=> true
\n
\n
\n \n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 214, + "description": "

Given a fullName return the corresponding factory.

\n

By default resolve will retrieve the factory from\nthe registry.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let registry = new Registry();\nregistry.register('api:twitter', Twitter);\n\nregistry.resolve('api:twitter') // => Twitter
\n
\n
\n \n

Optionally the registry can be provided with a custom resolver.\nIf provided, resolve will first provide the custom resolver\nthe opportunity to resolve the fullName, otherwise it will fallback\nto the registry.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
let registry = new Registry();\nregistry.resolver = function(fullName) {\n   // lookup via the module system of choice\n };\n\n// the twitter factory is added to the module system\nregistry.resolve('api:twitter') // => Twitter
\n
\n
\n \n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "resolve", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "fullName's factory", + "type": "Function" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 255, + "description": "

A hook that can be used to describe how the resolver will\nattempt to find the factory.

\n

For example, the default Ember .describe returns the full\nclass name (including namespace) where Ember's resolver expects\nto find the fullName.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "describe", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "described fullName", + "type": "String" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 278, + "description": "

A hook to enable custom fullName normalization behavior

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "normalizeFullName", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "normalized fullName", + "type": "String" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 296, + "description": "

Normalize a fullName based on the application's conventions

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "normalize", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "normalized fullName", + "type": "String" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 311, + "itemtype": "method", + "name": "makeToString", + "access": "private", + "tagname": "", + "params": [ + { + "name": "factory", + "description": "", + "type": "Any" + }, + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "toString function", + "type": "Function" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 329, + "description": "

Given a fullName check if the container is aware of its factory\nor singleton instance.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object", + "optional": true, + "props": [ + { + "name": "source", + "description": "the fullname of the request source (used for local lookups)", + "type": "String", + "optional": true + } + ] + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 348, + "description": "

Allow registering options for all factories of a type.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
let registry = new Registry();\nlet container = registry.container();\n\n// if all of type `connection` must not be singletons\nregistry.optionsForType('connection', { singleton: false });\n\nregistry.register('connection:twitter', TwitterConnection);\nregistry.register('connection:facebook', FacebookConnection);\n\nlet twitter = container.lookup('connection:twitter');\nlet twitter2 = container.lookup('connection:twitter');\n\ntwitter === twitter2; // => false\n\nlet facebook = container.lookup('connection:facebook');\nlet facebook2 = container.lookup('connection:facebook');\n\nfacebook === facebook2; // => false
\n
\n
\n \n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "optionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 389, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "options", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 432, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "knownForType", + "params": [ + { + "name": "type", + "description": "the type to iterate over", + "type": "String" + } + ], + "class": "Registry", + "module": "rsvp" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 75, + "description": "

A backup registry for resolving registrations when no matches can be found.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "fallback", + "type": "Registry", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 83, + "description": "

An object that has a resolve method that resolves a name.

\n", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "resolver", + "type": "Resolver", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 91, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "registrations", + "type": "InheritingDict", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 97, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_normalizeCache", + "type": "InheritingDict", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 104, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_resolveCache", + "type": "InheritingDict", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 111, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_options", + "type": "InheritingDict", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 118, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_typeOptions", + "type": "InheritingDict", + "class": "Registry", + "module": "rsvp" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-rsvp", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-RegistryProxy.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-RegistryProxy.json new file mode 100644 index 000000000..0d40e71c5 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-RegistryProxy.json @@ -0,0 +1,84 @@ +{ + "data": { + "id": "ember-5.3.0-RegistryProxy", + "type": "class", + "attributes": { + "name": "RegistryProxy", + "shortname": "RegistryProxy", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/owner", + "namespace": "", + "file": "packages/@ember/-internals/owner/index.ts", + "line": 599, + "extends": "BasicRegistry", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 107, + "description": "

Registers a factory that can be used for dependency injection (with\ninject) or for service lookup. Each factory is registered with\na full name including two parts: type:name.

\n

A simple example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Orange = EmberObject.extend();\nApp.register('fruit:favorite', App.Orange);
\n
\n
\n \n

Ember will resolve factories from the App namespace automatically.\nFor example App.CarsController will be discovered and returned if\nan application requests controller:cars.

\n

An example of registering a controller with a non-standard name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Application from '@ember/application';\nimport Controller from '@ember/controller';\n\nlet App = Application.create();\nlet Session = Controller.extend();\n\nApp.register('controller:session', Session);\n\n// The Session controller can now be treated like a normal controller,\n// despite its non-standard name.\nApp.ApplicationController = Controller.extend({\n  needs: ['session']\n});
\n
\n
\n \n

Registered factories are instantiated by having create\ncalled on them. Additionally they are singletons, each time\nthey are looked up they return the same instance.

\n

Some examples modifying that default behavior:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Person = EmberObject.extend();\nApp.Orange = EmberObject.extend();\nApp.Email = EmberObject.extend();\nApp.session = EmberObject.create();\n\nApp.register('model:user', App.Person, { singleton: false });\nApp.register('fruit:favorite', App.Orange);\nApp.register('communication:main', App.Email, { singleton: false });\nApp.register('session', App.session, { instantiate: false });
\n
\n
\n \n", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "type:name (e.g., 'model:user')", + "type": "String" + }, + { + "name": "factory", + "description": "(e.g., App.Person)", + "type": "Factory|object" + }, + { + "name": "options", + "description": "(optional) disable instantiation or singleton usage", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "RegistryProxy", + "module": "@ember/owner", + "inherited": true, + "inheritedFrom": "BasicRegistry" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-5.3.0-BasicRegistry", + "type": "class" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-5.3.0-RegistryProxyMixin" + } + ] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/owner", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-RegistryProxyMixin.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-RegistryProxyMixin.json new file mode 100644 index 000000000..a4134c108 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-RegistryProxyMixin.json @@ -0,0 +1,83 @@ +{ + "data": { + "id": "ember-5.3.0-RegistryProxyMixin", + "type": "class", + "attributes": { + "name": "RegistryProxyMixin", + "shortname": "RegistryProxyMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Engine", + "EngineInstance" + ], + "module": "ember", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 12, + "description": "

RegistryProxyMixin is used to provide public access to specific\nregistry functionality.

\n", + "extends": "RegistryProxy", + "access": "private", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 107, + "description": "

Registers a factory that can be used for dependency injection (with\ninject) or for service lookup. Each factory is registered with\na full name including two parts: type:name.

\n

A simple example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Orange = EmberObject.extend();\nApp.register('fruit:favorite', App.Orange);
\n
\n
\n \n

Ember will resolve factories from the App namespace automatically.\nFor example App.CarsController will be discovered and returned if\nan application requests controller:cars.

\n

An example of registering a controller with a non-standard name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Application from '@ember/application';\nimport Controller from '@ember/controller';\n\nlet App = Application.create();\nlet Session = Controller.extend();\n\nApp.register('controller:session', Session);\n\n// The Session controller can now be treated like a normal controller,\n// despite its non-standard name.\nApp.ApplicationController = Controller.extend({\n  needs: ['session']\n});
\n
\n
\n \n

Registered factories are instantiated by having create\ncalled on them. Additionally they are singletons, each time\nthey are looked up they return the same instance.

\n

Some examples modifying that default behavior:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Application from '@ember/application';\nimport EmberObject from '@ember/object';\n\nlet App = Application.create();\n\nApp.Person = EmberObject.extend();\nApp.Orange = EmberObject.extend();\nApp.Email = EmberObject.extend();\nApp.session = EmberObject.create();\n\nApp.register('model:user', App.Person, { singleton: false });\nApp.register('fruit:favorite', App.Orange);\nApp.register('communication:main', App.Email, { singleton: false });\nApp.register('session', App.session, { instantiate: false });
\n
\n
\n \n", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "type:name (e.g., 'model:user')", + "type": "String" + }, + { + "name": "factory", + "description": "(e.g., App.Person)", + "type": "Factory|object" + }, + { + "name": "options", + "description": "(optional) disable instantiation or singleton usage", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "RegistryProxyMixin", + "module": "@ember/owner", + "inherited": true, + "inheritedFrom": "BasicRegistry" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-5.3.0-RegistryProxy", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-Renderer.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-Renderer.json new file mode 100644 index 000000000..4edccf670 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-Renderer.json @@ -0,0 +1,60 @@ +{ + "data": { + "id": "ember-5.3.0-Renderer", + "type": "class", + "attributes": { + "name": "Renderer", + "shortname": "Renderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/renderer", + "namespace": "", + "file": "packages/@ember/renderer/index.ts", + "line": 6, + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/renderer/index.ts", + "line": 11, + "description": "

Returns a promise which will resolve when rendering has completed. In\nthis context, rendering is completed when all auto-tracked state that is\nconsumed in the template (including any tracked state in models, services,\netc. that are then used in a template) has been updated in the DOM.

\n

For example, in a test you might want to update some tracked state and\nthen run some assertions after rendering has completed. You could use\nawait settled() in that location, but in some contexts you don't want to\nwait for full settledness (which includes test waiters, pending AJAX/fetch,\nrun loops, etc) but instead only want to know when that updated value has\nbeen rendered in the DOM. THAT is what await renderSettled() is\nperfect for.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n
import { renderSettled } from '@ember/renderer';\nimport { render } from '@ember/test-helpers';\nimport { tracked } from '@glimmer/tracking';\nimport { hbs } from 'ember-cli-htmlbars';\nimport { setupRenderingTest } from 'my-app/tests/helpers';\nimport { module, test } from 'qunit';\n\nmodule('Integration | Component | profile-card', function (hooks) {\n  setupRenderingTest(hooks);\n\n  test("it renders the person's name", async function (assert) {\n    class Person {\n      @tracked name = '';\n    }\n\n    this.person = new Person();\n    this.person.name = 'John';\n\n    await render(hbs`\n      <ProfileCard @name={{this.person.name}} />\n    `);\n\n    assert.dom(this.element).hasText('John');\n\n    this.person.name = 'Jane';\n\n    await renderSettled(); // Wait until rendering has completed.\n\n    assert.dom(this.element).hasText('Jane');\n  });\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "renderSettled", + "return": { + "description": "a promise which fulfills when rendering has completed", + "type": "Promise" + }, + "access": "public", + "tagname": "", + "class": "Renderer", + "module": "@ember/renderer" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/renderer", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-Resolver.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-Resolver.json new file mode 100644 index 000000000..edd65d765 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-Resolver.json @@ -0,0 +1,154 @@ +{ + "data": { + "id": "ember-5.3.0-Resolver", + "type": "class", + "attributes": { + "name": "Resolver", + "shortname": "Resolver", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/owner", + "namespace": "", + "file": "packages/@ember/-internals/owner/index.ts", + "line": 416, + "description": "

A Resolver is the mechanism responsible for looking up code in your\napplication and converting its naming conventions into the actual classes,\nfunctions, and templates that Ember needs to resolve its dependencies, for\nexample, what template to render for a given route. It is a system that helps\nthe app resolve the lookup of JavaScript modules agnostic of what kind of\nmodule system is used, which can be AMD, CommonJS or just plain globals. It\nis used to lookup routes, models, components, templates, or anything that is\nused in your Ember app.

\n

This interface is not a concrete class; instead, it represents the contract a\ncustom resolver must implement. Most apps never need to think about this: in\nthe default blueprint, this is supplied by the ember-resolver package.

\n", + "since": "4.10.0", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 436, + "description": "

The one required method for a Resolver. Given a string, resolve it to a\nFactory, if one exists.

\n", + "itemtype": "method", + "name": "resolve", + "params": [ + { + "name": "name", + "description": "", + "type": "String" + } + ], + "access": "public", + "tagname": "", + "class": "Resolver", + "module": "@ember/owner" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 446, + "itemtype": "method", + "name": "knownForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Resolver", + "module": "@ember/owner" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 454, + "itemtype": "method", + "name": "lookupDescription", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Resolver", + "module": "@ember/owner" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 462, + "itemtype": "method", + "name": "makeToString", + "params": [ + { + "name": "factory", + "description": "", + "type": "Factory" + }, + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Resolver", + "module": "@ember/owner" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 471, + "itemtype": "method", + "name": "normalize", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Resolver", + "module": "@ember/owner" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/owner", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-Route.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-Route.json new file mode 100644 index 000000000..bca7ca5c0 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-Route.json @@ -0,0 +1,1620 @@ +{ + "data": { + "id": "ember-5.3.0-Route", + "type": "class", + "attributes": { + "name": "Route", + "shortname": "Route", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing/route", + "namespace": "", + "file": "packages/@ember/routing/route.ts", + "line": 79, + "description": "

The Route class is used to define individual routes. Refer to\nthe routing guide for documentation.

\n", + "extends": "EmberObject", + "uses": [ + "Evented", + "ActionHandler" + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/routing/route.ts", + "line": 303, + "description": "

A hook you can implement to convert the route's model into parameters\nfor the URL.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n
// ...\n\nRouter.map(function() {\n  this.route('post', { path: '/posts/:post_id' });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n  model({ post_id }) {\n    // the server returns `{ id: 12 }`\n    return fetch(`/posts/${post_id}`;\n  }\n\n  serialize(model) {\n    // this will make the URL `/posts/12`\n    return { post_id: model.id };\n  }\n}
\n
\n
\n \n

The default serialize method will insert the model's id into the\nroute's dynamic segment (in this case, :post_id) if the segment contains '_id'.\nIf the route has multiple dynamic segments or does not contain '_id', serialize\nwill return getProperties(model, params)

\n

This method is called when transitionTo is called with a context\nin order to populate the URL.

\n", + "itemtype": "method", + "name": "serialize", + "params": [ + { + "name": "model", + "description": "the routes model", + "type": "Object" + }, + { + "name": "params", + "description": "an Array of parameter names for the current\n route (in the example, `['post_id']`.", + "type": "Array" + } + ], + "return": { + "description": "the serialized parameters", + "type": "Object" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 540, + "description": "

Sets the name for this route, including a fully resolved name for routes\ninside engines.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_setRouteName", + "params": [ + { + "name": "name", + "description": "", + "type": "String" + } + ], + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 555, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_stashNames", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 598, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_updatingQPChanged", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 606, + "description": "

Returns a hash containing the parameters of an ancestor route.

\n

You may notice that this.paramsFor sometimes works when referring to a\nchild route, but this behavior should not be relied upon as only ancestor\nroutes are certain to be loaded in time.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n
// ...\n\nRouter.map(function() {\n  this.route('member', { path: ':name' }, function() {\n    this.route('interest', { path: ':interest' });\n  });\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/member.js
1\n2\n3\n4\n5\n6\n7\n
import Route from '@ember/routing/route';\n\nexport default class MemberRoute extends Route {\n  queryParams = {\n    memberQp: { refreshModel: true }\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/member/interest.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\n\nexport default class MemberInterestRoute extends Route {\n  queryParams = {\n    interestQp: { refreshModel: true }\n  }\n\n  model() {\n    return this.paramsFor('member');\n  }\n}
\n
\n
\n \n

If we visit /turing/maths?memberQp=member&interestQp=interest the model for\nthe member.interest route is a hash with:

\n
    \n
  • name: turing
  • \n
  • memberQp: member
  • \n
\n", + "itemtype": "method", + "name": "paramsFor", + "params": [ + { + "name": "name", + "description": "", + "type": "String" + } + ], + "return": { + "description": "hash containing the parameters of the route `name`", + "type": "Object" + }, + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 687, + "description": "

Serializes the query parameter key

\n", + "itemtype": "method", + "name": "serializeQueryParamKey", + "params": [ + { + "name": "controllerPropertyName", + "description": "", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 698, + "description": "

Serializes value of the query parameter based on defaultValueType

\n", + "itemtype": "method", + "name": "serializeQueryParam", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + }, + { + "name": "urlKey", + "description": "", + "type": "String" + }, + { + "name": "defaultValueType", + "description": "", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 714, + "description": "

Deserializes value of the query parameter based on defaultValueType

\n", + "itemtype": "method", + "name": "deserializeQueryParam", + "params": [ + { + "name": "value", + "description": "", + "type": "Object" + }, + { + "name": "urlKey", + "description": "", + "type": "String" + }, + { + "name": "defaultValueType", + "description": "", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 746, + "description": "

A hook you can use to reset controller values either when the model\nchanges or the route is exiting.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/articles.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class ArticlesRoute extends Route {\n  resetController(controller, isExiting, transition) {\n    if (isExiting && transition.targetName !== 'error') {\n      controller.set('page', 1);\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "resetController", + "params": [ + { + "name": "controller", + "description": "instance", + "type": "Controller" + }, + { + "name": "isExiting", + "description": "", + "type": "Boolean" + }, + { + "name": "transition", + "description": "", + "type": "Object" + } + ], + "since": "1.7.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 776, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "exit", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 787, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "_internalReset", + "since": "3.6.0", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 801, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "enter", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 852, + "description": "

This hook is executed when the router completely exits this route. It is\nnot executed when the model for the route changes.

\n", + "itemtype": "method", + "name": "deactivate", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 863, + "description": "

This hook is executed when the router enters the route. It is not executed\nwhen the model for the route changes.

\n", + "itemtype": "method", + "name": "activate", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 874, + "description": "

Perform a synchronous transition into another route without attempting\nto resolve promises, update the URL, or abort any currently active\nasynchronous transitions (i.e. regular transitions caused by\ntransitionTo or URL changes).

\n

This method is handy for performing intermediate transitions on the\nway to a final destination route, and is called internally by the\ndefault implementations of the error and loading handlers.

\n", + "itemtype": "method", + "name": "intermediateTransitionTo", + "params": [ + { + "name": "name", + "description": "the name of the route", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) to be used while transitioning\nto the route.", + "type": "...Object" + } + ], + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 896, + "description": "

Refresh the model on this route and any child routes, firing the\nbeforeModel, model, and afterModel hooks in a similar fashion\nto how routes are entered when transitioning in from other route.\nThe current route params (e.g. article_id) will be passed in\nto the respective model hooks, and if a different model is returned,\nsetupController and associated route hooks will re-fire as well.

\n

An example usage of this method is re-querying the server for the\nlatest information using the same parameters as when the route\nwas first entered.

\n

Note that this will cause model hooks to fire even on routes\nthat were provided a model object when the route was initially\nentered.

\n", + "itemtype": "method", + "name": "refresh", + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 922, + "description": "

This hook is the entry point for router.js

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "setup", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 997, + "description": "

This hook is the first of the route entry validation hooks\ncalled when an attempt is made to transition into a route\nor one of its children. It is called before model and\nafterModel, and is appropriate for cases when:

\n

1) A decision can be made to redirect elsewhere without\n needing to resolve the model first.\n2) Any async operations need to occur first before the\n model is attempted to be resolved.

\n

This hook is provided the current transition attempt\nas a parameter, which can be used to .abort() the transition,\nsave it for a later .retry(), or retrieve values set\non it from a previous hook. You can also just call\nthis.transitionTo to another route to implicitly\nabort the transition.

\n

You can return a promise from this hook to pause the\ntransition until the promise resolves (or rejects). This could\nbe useful, for instance, for retrieving async code from\nthe server that is required to enter a route.

\n", + "itemtype": "method", + "name": "beforeModel", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "return": { + "description": "if the value returned from this hook is\n a promise, the transition will pause until the transition\n resolves. Otherwise, non-promise return values are not\n utilized in any way.", + "type": "Any | Promise" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1032, + "description": "

This hook is called after this route's model has resolved.\nIt follows identical async/promise semantics to beforeModel\nbut is provided the route's resolved model in addition to\nthe transition, and is therefore suited to performing\nlogic that can only take place after the model has already\nresolved.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/posts.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class PostsRoute extends Route {\n  afterModel(posts, transition) {\n    if (posts.get('length') === 1) {\n      this.transitionTo('post.show', posts.get('firstObject'));\n    }\n  }\n}
\n
\n
\n \n

Refer to documentation for beforeModel for a description\nof transition-pausing semantics when a promise is returned\nfrom this hook.

\n", + "itemtype": "method", + "name": "afterModel", + "params": [ + { + "name": "resolvedModel", + "description": "the value returned from `model`,\n or its resolved value if it was a promise", + "type": "Object" + }, + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "return": { + "description": "if the value returned from this hook is\n a promise, the transition will pause until the transition\n resolves. Otherwise, non-promise return values are not\n utilized in any way.", + "type": "Any | Promise" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1073, + "description": "

A hook you can implement to optionally redirect to another route.

\n

Calling this.transitionTo from inside of the redirect hook will\nabort the current transition (into the route that has implemented redirect).

\n

redirect and afterModel behave very similarly and are\ncalled almost at the same time, but they have an important\ndistinction when calling this.transitionTo to a child route\nof the current route. From afterModel, this new transition\ninvalidates the current transition, causing beforeModel,\nmodel, and afterModel hooks to be called again. But the\nsame transition started from redirect does not invalidate\nthe current transition. In other words, by the time the redirect\nhook has been called, both the resolved model and the attempted\nentry into this route are considered fully validated.

\n", + "itemtype": "method", + "name": "redirect", + "params": [ + { + "name": "model", + "description": "the model for this route", + "type": "Object" + }, + { + "name": "transition", + "description": "the transition object associated with the current transition", + "type": "Transition" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1098, + "description": "

Called when the context is changed by router.js.

\n", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "contextDidChange", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1108, + "description": "

A hook you can implement to convert the URL into the model for\nthis route.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n
// ...\n\nRouter.map(function() {\n  this.route('post', { path: '/posts/:post_id' });\n});\n\nexport default Router;
\n
\n
\n \n

Note that for routes with dynamic segments, this hook is not always\nexecuted. If the route is entered through a transition (e.g. when\nusing the link-to Handlebars helper or the transitionTo method\nof routes), and a model context is already provided this hook\nis not called.

\n

A model context does not include a primitive string or number,\nwhich does cause the model hook to be called.

\n

Routes without dynamic segments will always execute the model hook.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
// no dynamic segment, model hook always called\nthis.transitionTo('posts');\n\n// model passed in, so model hook not called\nthePost = store.findRecord('post', 1);\nthis.transitionTo('post', thePost);\n\n// integer passed in, model hook is called\nthis.transitionTo('post', 1);\n\n// model id passed in, model hook is called\n// useful for forcing the hook to execute\nthePost = store.findRecord('post', 1);\nthis.transitionTo('post', thePost.id);
\n
\n
\n \n

This hook follows the asynchronous/promise semantics\ndescribed in the documentation for beforeModel. In particular,\nif a promise returned from model fails, the error will be\nhandled by the error hook on Route.

\n

Note that the legacy behavior of automatically defining a model\nhook when a dynamic segment ending in _id is present is\ndeprecated.\nYou should explicitly define a model hook whenever any segments are\npresent.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Route from '@ember/routing/route';\nimport { service } from '@ember/service';\n\nexport default class PostRoute extends Route {\n  @service store;\n\n  model(params) {\n    return this.store.findRecord('post', params.post_id);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "model", + "params": [ + { + "name": "params", + "description": "the parameters extracted from the URL", + "type": "Object" + }, + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "return": { + "description": "the model for this route. If\n a promise is returned, the transition will pause until\n the promise resolves, and the resolved value of the promise\n will be used as the model for this route.", + "type": "Any | Promise" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1226, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "deserialize", + "params": [ + { + "name": "params", + "description": "the parameters extracted from the URL", + "type": "Object" + }, + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "return": { + "description": "the model for this route.\n\nRouter.js hook.", + "type": "Any | Promise" + }, + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1239, + "itemtype": "method", + "name": "findModel", + "params": [ + { + "name": "type", + "description": "the model type", + "type": "String" + }, + { + "name": "value", + "description": "the value passed to find", + "type": "Object" + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1267, + "description": "

A hook you can use to setup the controller for the current route.

\n

This method is called with the controller for the current route and the\nmodel supplied by the model hook.

\n

By default, the setupController hook sets the model property of\nthe controller to the specified model when it is not undefined.

\n

If you implement the setupController hook in your Route, it will\nprevent this default behavior. If you want to preserve that behavior\nwhen implementing your setupController function, make sure to call\nsuper:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/photos.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport { service } from '@ember/service';\n\nexport default class PhotosRoute extends Route {\n  @service store;\n\n  model() {\n    return this.store.findAll('photo');\n  }\n\n  setupController(controller, model) {\n    super.setupController(controller, model);\n\n    this.controllerFor('application').set('showingPhotos', true);\n  }\n}
\n
\n
\n \n

The provided controller will be one resolved based on the name\nof this route.

\n

If no explicit controller is defined, Ember will automatically create one.

\n

As an example, consider the router:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n
// ...\n\nRouter.map(function() {\n  this.route('post', { path: '/posts/:post_id' });\n});\n\nexport default Router;
\n
\n
\n \n

If you have defined a file for the post controller,\nthe framework will use it.\nIf it is not defined, a basic Controller instance would be used.

\n", + "example": [ + " Behavior of a basic Controller\n\n```app/routes/post.js\nimport Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n setupController(controller, model) {\n controller.set('model', model);\n }\n});\n```" + ], + "itemtype": "method", + "name": "setupController", + "params": [ + { + "name": "controller", + "description": "instance", + "type": "Controller" + }, + { + "name": "model", + "description": "", + "type": "Object" + }, + { + "name": "transition", + "description": "", + "type": "Transition", + "optional": true + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1346, + "description": "

Returns the controller of the current route, or a parent (or any ancestor)\nroute in a route hierarchy.

\n

The controller instance must already have been created, either through entering the\nassociated route or using generateController.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n  setupController(controller, post) {\n    super.setupController(controller, post);\n\n    this.controllerFor('posts').set('currentPost', post);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "controllerFor", + "params": [ + { + "name": "name", + "description": "the name of the route or controller", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Controller | undefined" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1400, + "description": "

Generates a controller for a route.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class Post extends Route {\n  setupController(controller, post) {\n    super.setupController(controller, post);\n\n    this.generateController('posts');\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "generateController", + "params": [ + { + "name": "name", + "description": "the name of the controller", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1428, + "description": "

Returns the resolved model of a parent (or any ancestor) route\nin a route hierarchy. During a transition, all routes\nmust resolve a model object, and if a route\nneeds access to a parent route's model in order to\nresolve a model (or just reuse the model from a parent),\nit can call this.modelFor(theNameOfParentRoute) to\nretrieve it. If the ancestor route's model was a promise,\nits resolved result is returned.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
// ...\n\nRouter.map(function() {\n  this.route('post', { path: '/posts/:post_id' }, function() {\n    this.route('comments');\n  });\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/post/comments.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\n\nexport default class PostCommentsRoute extends Route {\n  model() {\n    let post = this.modelFor('post');\n\n    return post.comments;\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "modelFor", + "params": [ + { + "name": "name", + "description": "the name of the route", + "type": "String" + } + ], + "return": { + "description": "the model object", + "type": "Object" + }, + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1500, + "description": "

this[RENDER] is used to render a template into a region of another template\n(indicated by an {{outlet}}).

\n", + "itemtype": "method", + "name": "this[RENDER]", + "params": [ + { + "name": "name", + "description": "the name of the template to render", + "type": "String" + }, + { + "name": "options", + "description": "the options", + "type": "Object", + "optional": true, + "props": [ + { + "name": "into", + "description": "the template to render into,\n referenced by name. Defaults to the parent template", + "type": "String", + "optional": true + }, + { + "name": "outlet", + "description": "the outlet inside `options.into` to render into.\n Defaults to 'main'", + "type": "String", + "optional": true + }, + { + "name": "controller", + "description": "the controller to use for this template,\n referenced by name or as a controller instance. Defaults to the Route's paired controller", + "type": "String|Object", + "optional": true + }, + { + "name": "model", + "description": "the model object to set on `options.controller`.\n Defaults to the return value of the Route's model hook", + "type": "Object", + "optional": true + } + ] + } + ], + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1527, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "teardownViews", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1540, + "description": "

Allows you to produce custom metadata for the route.\nThe return value of this method will be attached to\nits corresponding RouteInfoWithAttributes object.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/posts/index.js
1\n2\n3\n4\n5\n6\n7\n
import Route from '@ember/routing/route';\n\nexport default class PostsIndexRoute extends Route {\n  buildRouteInfoMetadata() {\n    return { title: 'Posts Page' }\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Route from '@ember/routing/route';\nimport { service } from '@ember/service';\n\nexport default class ApplicationRoute extends Route {\n  @service router\n\n  constructor() {\n    super(...arguments);\n\n    this.router.on('routeDidChange', transition => {\n      document.title = transition.to.metadata.title;\n      // would update document's title to "Posts Page"\n    });\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "buildRouteInfoMetadata", + "return": { + "description": "any" + }, + "since": "3.10.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1779, + "description": "

Sends an action to the router, which will delegate it to the currently\nactive route hierarchy per the bubbling rules explained under actions.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n7\n
// ...\n\nRouter.map(function() {\n  this.route('index');\n});\n\nexport default Router;
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class ApplicationRoute extends Route {\n  @action\n  track(arg) {\n    console.log(arg, 'was clicked');\n  }\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/index.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class IndexRoute extends Route {\n  @action\n  trackIfDebug(arg) {\n    if (debug) {\n      this.send('track', arg);\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "send", + "params": [ + { + "name": "name", + "description": "the name of the action to trigger", + "type": "String" + }, + { + "name": "args", + "description": "", + "type": "...*" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 2193, + "description": "

This action is called when one or more query params have changed. Bubbles.

\n", + "itemtype": "method", + "name": "queryParamsDidChange", + "params": [ + { + "name": "changed", + "description": "Keys are names of query params that have changed.", + "type": "Object" + }, + { + "name": "totalPresent", + "description": "Keys are names of query params that are currently set.", + "type": "Object" + }, + { + "name": "removed", + "description": "Keys are names of query params that have been removed.", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 51, + "description": "

Subscribes to a named event with given function.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
person.on('didLoad', function() {\n  // fired once the person has loaded\n});
\n
\n
\n \n

An optional target can be passed in as the 2nd argument that will\nbe set as the "this" for the callback. This is a good way to give your\nfunction access to the object triggering the event. When the target\nparameter is used the callback method becomes the third argument.

\n", + "itemtype": "method", + "name": "on", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 78, + "description": "

Subscribes a function to a named event and then cancels the subscription\nafter the first time the event is triggered. It is good to use one when\nyou only care about the first time an event has taken place.

\n

This function takes an optional 2nd argument that will become the "this"\nvalue for the callback. When the target parameter is used the callback method\nbecomes the third argument.

\n", + "itemtype": "method", + "name": "one", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The \"this\" binding for the callback", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 100, + "description": "

Triggers a named event for the object. Any additional arguments\nwill be passed as parameters to the functions that are subscribed to the\nevent.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
person.on('didEat', function(food) {\n  console.log('person ate some ' + food);\n});\n\nperson.trigger('didEat', 'broccoli');\n\n// outputs: person ate some broccoli
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "args", + "description": "Optional arguments to pass on", + "type": "Object..." + } + ], + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 121, + "description": "

Cancels subscription for given name, target, and method.

\n", + "itemtype": "method", + "name": "off", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + }, + { + "name": "target", + "description": "The target of the subscription", + "type": "Object" + }, + { + "name": "method", + "description": "The function or the name of a function of the subscription", + "type": "Function|String" + } + ], + "return": { + "description": "this" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/evented.ts", + "line": 137, + "description": "

Checks to see if object has any subscriptions for named event.

\n", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "name", + "description": "The name of the event", + "type": "String" + } + ], + "return": { + "description": "does the object have a subscription for event", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/evented", + "inherited": true, + "inheritedFrom": "Evented" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 322, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 541, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 568, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 576, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 164, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 212, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 229, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 247, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 333, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 354, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 371, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 388, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 403, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 433, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 453, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 497, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Route", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [ + { + "file": "packages/@ember/routing/route.ts", + "line": 91, + "description": "

The willTransition action is fired at the beginning of any\nattempted transition with a Transition object as the sole\nargument. This action can be used for aborting, redirecting,\nor decorating the transition from the currently active routes.

\n

A good example is preventing navigation when a form is\nhalf-filled out:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class ContactFormRoute extends Route {\n  @action\n  willTransition(transition) {\n    if (this.controller.get('userHasEnteredData')) {\n      this.controller.displayNavigationConfirm();\n      transition.abort();\n    }\n  }\n}
\n
\n
\n \n

You can also redirect elsewhere by calling\nthis.transitionTo('elsewhere') from within willTransition.\nNote that willTransition will not be fired for the\nredirecting transitionTo, since willTransition doesn't\nfire when there is already a transition underway. If you want\nsubsequent willTransition actions to fire for the redirecting\ntransition, you must first explicitly call\ntransition.abort().

\n

To allow the willTransition event to continue bubbling to the parent\nroute, use return true;. When the willTransition method has a\nreturn value of true then the parent route's willTransition method\nwill be fired, enabling "bubbling" behavior for the event.

\n", + "itemtype": "event", + "name": "willTransition", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 136, + "description": "

The didTransition action is fired after a transition has\nsuccessfully been completed. This occurs after the normal model\nhooks (beforeModel, model, afterModel, setupController)\nhave resolved. The didTransition action has no arguments,\nhowever, it can be useful for tracking page views or resetting\nstate on the controller.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/login.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class LoginRoute extends Route {\n  @action\n  didTransition() {\n    // your code there\n    return true; // Bubble the didTransition event\n  }\n}
\n
\n
\n \n", + "itemtype": "event", + "name": "didTransition", + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 163, + "description": "

The loading action is fired on the route when a route's model\nhook returns a promise that is not already resolved. The current\nTransition object is the first parameter and the route that\ntriggered the loading event is the second parameter.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class ApplicationRoute extends Route {\n  @action\n  loading(transition, route) {\n    let controller = this.controllerFor('foo');\n\n    // The controller may not be instantiated when initially loading\n    if (controller) {\n      controller.currentlyLoading = true;\n\n      transition.finally(function() {\n        controller.currentlyLoading = false;\n      });\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "event", + "name": "loading", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + }, + { + "name": "route", + "description": "The route that triggered the loading event", + "type": "Route" + } + ], + "since": "1.2.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 198, + "description": "

When attempting to transition into a route, any of the hooks\nmay return a promise that rejects, at which point an error\naction will be fired on the partially-entered routes, allowing\nfor per-route error handling logic, or shared error handling\nlogic defined on a parent route.

\n

Here is an example of an error handler that will be invoked\nfor rejected promises from the various hooks on the route,\nas well as any unhandled errors from child routes:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/admin.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n
import { reject } from 'rsvp';\nimport Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class AdminRoute extends Route {\n  beforeModel() {\n    return reject('bad things!');\n  }\n\n  @action\n  error(error, transition) {\n    // Assuming we got here due to the error in `beforeModel`,\n    // we can expect that error === "bad things!",\n    // but a promise model rejecting would also\n    // call this hook, as would any errors encountered\n    // in `afterModel`.\n\n    // The `error` hook is also provided the failed\n    // `transition`, which can be stored and later\n    // `.retry()`d if desired.\n\n    this.transitionTo('login');\n  }\n}
\n
\n
\n \n

error actions that bubble up all the way to ApplicationRoute\nwill fire a default error handler that logs the error. You can\nspecify your own global default error handler by overriding the\nerror handler on ApplicationRoute:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class ApplicationRoute extends Route {\n  @action\n  error(error, transition) {\n    this.controllerFor('banner').displayError(error.message);\n  }\n}
\n
\n
\n \n", + "itemtype": "event", + "name": "error", + "params": [ + { + "name": "error", + "description": "", + "type": "Error" + }, + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 812, + "description": "

This event is triggered when the router enters the route. It is\nnot executed when the model for the route changes.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n
import { on } from '@ember/object/evented';\nimport Route from '@ember/routing/route';\n\nexport default Route.extend({\n  collectAnalytics: on('activate', function(){\n    collectAnalytics();\n  })\n});
\n
\n
\n \n", + "itemtype": "event", + "name": "activate", + "since": "1.9.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 832, + "description": "

This event is triggered when the router completely exits this\nroute. It is not executed when the model for the route changes.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/index.js
1\n2\n3\n4\n5\n6\n7\n8\n
import { on } from '@ember/object/evented';\nimport Route from '@ember/routing/route';\n\nexport default Route.extend({\n  trackPageLeaveAnalytics: on('deactivate', function(){\n    trackPageLeaveAnalytics();\n  })\n});
\n
\n
\n \n", + "itemtype": "event", + "name": "deactivate", + "since": "1.9.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + } + ], + "properties": [ + { + "file": "packages/@ember/routing/route.ts", + "line": 371, + "description": "

Configuration hash for this route's queryParams. The possible\nconfiguration options and their defaults are as follows\n(assuming a query param whose controller property is page):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n
queryParams = {\n  page: {\n    // By default, controller query param properties don't\n    // cause a full transition when they are changed, but\n    // rather only cause the URL to update. Setting\n    // `refreshModel` to true will cause an "in-place"\n    // transition to occur, whereby the model hooks for\n    // this route (and any child routes) will re-fire, allowing\n    // you to reload models (e.g., from the server) using the\n    // updated query param values.\n    refreshModel: false,\n\n    // By default, changes to controller query param properties\n    // cause the URL to update via `pushState`, which means an\n    // item will be added to the browser's history, allowing\n    // you to use the back button to restore the app to the\n    // previous state before the query param property was changed.\n    // Setting `replace` to true will use `replaceState` (or its\n    // hash location equivalent), which causes no browser history\n    // item to be added. This options name and default value are\n    // the same as the `link-to` helper's `replace` option.\n    replace: false,\n\n    // By default, the query param URL key is the same name as\n    // the controller property name. Use `as` to specify a\n    // different URL key.\n    as: 'page'\n  }\n};
\n
\n
\n \n", + "itemtype": "property", + "name": "queryParams", + "type": "Object", + "since": "1.6.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 424, + "description": "

The name of the template to use by default when rendering this route's\ntemplate.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/posts/list.js
1\n2\n3\n4\n5\n
import Route from '@ember/routing/route';\n\nexport default class PostsListRoute extends Route {\n  templateName = 'posts/list';\n}
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/posts/index.js
1\n2\n3\n
import PostsListRoute from '../posts/list';\n\nexport default class PostsIndexRoute extends PostsListRoute {};
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/posts/archived.js
1\n2\n3\n
import PostsListRoute from '../posts/list';\n\nexport default class PostsArchivedRoute extends PostsListRoute {};
\n
\n
\n \n", + "itemtype": "property", + "name": "templateName", + "type": "String", + "default": "null", + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 457, + "description": "

The name of the controller to associate with this route.

\n

By default, Ember will lookup a route's controller that matches the name\nof the route (i.e. posts.new). However,\nif you would like to define a specific controller to use, you can do so\nusing this property.

\n

This is useful in many ways, as the controller specified will be:

\n
    \n
  • passed to the setupController method.
  • \n
  • used as the controller for the template being rendered by the route.
  • \n
  • returned from a call to controllerFor for the route.
  • \n
\n", + "itemtype": "property", + "name": "controllerName", + "type": "String", + "default": "null", + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 480, + "description": "

The controller associated with this route.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class FormRoute extends Route {\n  @action\n  willTransition(transition) {\n    if (this.controller.get('userHasEnteredData') &&\n        !confirm('Are you sure you want to abandon progress?')) {\n      transition.abort();\n    } else {\n      // Bubble the `willTransition` action so that\n      // parent routes can decide whether or not to abort.\n      return true;\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "property", + "name": "controller", + "type": "Controller", + "since": "1.6.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 511, + "description": "

The name of the route, dot-delimited.

\n

For example, a route found at app/routes/posts/post.js will have\na routeName of posts.post.

\n", + "itemtype": "property", + "name": "routeName", + "type": "String", + "since": "1.0.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 525, + "description": "

The name of the route, dot-delimited, including the engine prefix\nif applicable.

\n

For example, a route found at addon/routes/posts/post.js within an\nengine named admin will have a fullRouteName of admin.posts.post.

\n", + "itemtype": "property", + "name": "fullRouteName", + "type": "String", + "since": "2.10.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 589, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_activeQPChanged", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 730, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_optionsForQueryParam", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 1640, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_qp", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/routing/route.ts", + "line": 2162, + "description": "

The controller associated with this route.

\n

Example

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class FormRoute extends Route {\n  @action\n  willTransition(transition) {\n    if (this.controller.get('userHasEnteredData') &&\n        !confirm('Are you sure you want to abandon progress?')) {\n      transition.abort();\n    } else {\n      // Bubble the `willTransition` action so that\n      // parent routes can decide whether or not to abort.\n      return true;\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "property", + "name": "controller", + "type": "Controller", + "since": "1.6.0", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/routing/route" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 356, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 430, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 505, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 523, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Route", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-5.3.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/routing/route", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-RouteInfo.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-RouteInfo.json new file mode 100644 index 000000000..badf95e51 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-RouteInfo.json @@ -0,0 +1,176 @@ +{ + "data": { + "id": "ember-5.3.0-RouteInfo", + "type": "class", + "attributes": { + "name": "RouteInfo", + "shortname": "RouteInfo", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing/route-info", + "namespace": "", + "file": "packages/@ember/routing/route-info.ts", + "line": 20, + "description": "

A RouteInfo is an object that contains metadata about a specific route\nwithin a Transition. It is read-only and internally immutable. It is also\nnot observable, because a Transition instance is never changed after\ncreation.

\n

A RouteInfo is not user-constructible; the only legal way to get one is from\na valid Transition. However, you can import the type by using import type\nsyntax with TypeScript or import() in JSDoc comments.

\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/routing/route-info.ts", + "line": 91, + "description": "

Allows you to traverse through the linked list of RouteInfos from the\ntopmost to leafmost. Returns the first RouteInfo in the linked list for\nwhich the callback returns true.

\n

This method is similar to the find() method defined in ECMAScript 2015.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the true to include the item in the results, false\notherwise.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context.

\n", + "itemtype": "method", + "name": "find", + "params": [ + { + "name": "callback", + "description": "the callback to execute", + "type": "Function" + }, + { + "name": "target*", + "description": "optional target to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Found item or undefined", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "@ember/routing/route-info" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/routing/route-info.ts", + "line": 34, + "description": "

The dot-separated, fully-qualified name of the route, like "people.index".

\n", + "itemtype": "property", + "name": "name", + "type": "String", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "@ember/routing/route-info" + }, + { + "file": "packages/@ember/routing/route-info.ts", + "line": 40, + "description": "

The final segment of the fully-qualified name of the route, like "index"

\n", + "itemtype": "property", + "name": "localName", + "type": "String", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "@ember/routing/route-info" + }, + { + "file": "packages/@ember/routing/route-info.ts", + "line": 46, + "description": "

The values of the route's parameters. These are the same params that are\nreceived as arguments to the route's model hook. Contains only the\nparameters valid for this route, if any (params for parent or child routes are\nnot merged).

\n", + "itemtype": "property", + "name": "params", + "type": "Object", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "@ember/routing/route-info" + }, + { + "file": "packages/@ember/routing/route-info.ts", + "line": 55, + "description": "

The ordered list of the names of the params required for this route. It will\ncontain the same strings as Object.keys(params), but here the order is\nsignificant. This allows users to correctly pass params into routes\nprogrammatically.

\n", + "itemtype": "property", + "name": "paramNames", + "type": "Array", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "@ember/routing/route-info" + }, + { + "file": "packages/@ember/routing/route-info.ts", + "line": 64, + "description": "

The values of any queryParams on this route.

\n", + "itemtype": "property", + "name": "queryParams", + "type": "Object", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "@ember/routing/route-info" + }, + { + "file": "packages/@ember/routing/route-info.ts", + "line": 70, + "description": "

Will contain the result Route#buildRouteInfoMetadata for the corresponding\nRoute.

\n", + "itemtype": "property", + "name": "metadata", + "type": "Any", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "@ember/routing/route-info" + }, + { + "file": "packages/@ember/routing/route-info.ts", + "line": 77, + "description": "

A reference to the parent route's RouteInfo. This can be used to traverse\nupward to the topmost RouteInfo.

\n", + "itemtype": "property", + "name": "parent", + "type": "RouteInfo|null", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "@ember/routing/route-info" + }, + { + "file": "packages/@ember/routing/route-info.ts", + "line": 84, + "description": "

A reference to the child route's RouteInfo. This can be used to traverse\ndownward to the leafmost RouteInfo.

\n", + "itemtype": "property", + "name": "child", + "type": "RouteInfo|null", + "access": "public", + "tagname": "", + "class": "RouteInfo", + "module": "@ember/routing/route-info" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-5.3.0-RouteInfoWithAttributes" + } + ] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/routing/route-info", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-RouteInfoWithAttributes.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-RouteInfoWithAttributes.json new file mode 100644 index 000000000..c151d0233 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-RouteInfoWithAttributes.json @@ -0,0 +1,205 @@ +{ + "data": { + "id": "ember-5.3.0-RouteInfoWithAttributes", + "type": "class", + "attributes": { + "name": "RouteInfoWithAttributes", + "shortname": "RouteInfoWithAttributes", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing/route-info", + "namespace": "", + "file": "packages/@ember/routing/route-info.ts", + "line": 124, + "description": "

A RouteInfoWithAttributes is an object that contains metadata, including the\nresolved value from the routes model hook. Like RouteInfo, a\nRouteInfoWithAttributes represents a specific route within a Transition. It\nis read-only and internally immutable. It is also not observable, because a\nTransition instance is never changed after creation.

\n

A RouteInfoWithAttributes is not user-constructible; the only legal way to\nget one is from a valid Transition. However, you can import the type by\nusing import type syntax with TypeScript or import() in JSDoc comments.

\n", + "extends": "RouteInfo", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/routing/route-info.ts", + "line": 91, + "description": "

Allows you to traverse through the linked list of RouteInfos from the\ntopmost to leafmost. Returns the first RouteInfo in the linked list for\nwhich the callback returns true.

\n

This method is similar to the find() method defined in ECMAScript 2015.

\n

The callback method you provide should have the following signature (all\nparameters are optional):

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
function(item, index, array);
\n
\n
\n \n
    \n
  • item is the current item in the iteration.
  • \n
  • index is the current index in the iteration.
  • \n
  • array is the array itself.
  • \n
\n

It should return the true to include the item in the results, false\notherwise.

\n

Note that in addition to a callback, you can also pass an optional target\nobject that will be set as this on the context.

\n", + "itemtype": "method", + "name": "find", + "params": [ + { + "name": "callback", + "description": "the callback to execute", + "type": "Function" + }, + { + "name": "target*", + "description": "optional target to use", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Found item or undefined", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "@ember/routing/route-info", + "inherited": true, + "inheritedFrom": "RouteInfo" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/routing/route-info.ts", + "line": 140, + "description": "

This is the resolved return value from the\nroute's model hook.

\n", + "itemtype": "property", + "name": "attributes", + "type": "Object|Array|String|undefined", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "@ember/routing/route-info" + }, + { + "file": "packages/@ember/routing/route-info.ts", + "line": 34, + "description": "

The dot-separated, fully-qualified name of the route, like "people.index".

\n", + "itemtype": "property", + "name": "name", + "type": "String", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "@ember/routing/route-info", + "inherited": true, + "inheritedFrom": "RouteInfo" + }, + { + "file": "packages/@ember/routing/route-info.ts", + "line": 40, + "description": "

The final segment of the fully-qualified name of the route, like "index"

\n", + "itemtype": "property", + "name": "localName", + "type": "String", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "@ember/routing/route-info", + "inherited": true, + "inheritedFrom": "RouteInfo" + }, + { + "file": "packages/@ember/routing/route-info.ts", + "line": 46, + "description": "

The values of the route's parameters. These are the same params that are\nreceived as arguments to the route's model hook. Contains only the\nparameters valid for this route, if any (params for parent or child routes are\nnot merged).

\n", + "itemtype": "property", + "name": "params", + "type": "Object", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "@ember/routing/route-info", + "inherited": true, + "inheritedFrom": "RouteInfo" + }, + { + "file": "packages/@ember/routing/route-info.ts", + "line": 55, + "description": "

The ordered list of the names of the params required for this route. It will\ncontain the same strings as Object.keys(params), but here the order is\nsignificant. This allows users to correctly pass params into routes\nprogrammatically.

\n", + "itemtype": "property", + "name": "paramNames", + "type": "Array", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "@ember/routing/route-info", + "inherited": true, + "inheritedFrom": "RouteInfo" + }, + { + "file": "packages/@ember/routing/route-info.ts", + "line": 64, + "description": "

The values of any queryParams on this route.

\n", + "itemtype": "property", + "name": "queryParams", + "type": "Object", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "@ember/routing/route-info", + "inherited": true, + "inheritedFrom": "RouteInfo" + }, + { + "file": "packages/@ember/routing/route-info.ts", + "line": 70, + "description": "

Will contain the result Route#buildRouteInfoMetadata for the corresponding\nRoute.

\n", + "itemtype": "property", + "name": "metadata", + "type": "Any", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "@ember/routing/route-info", + "inherited": true, + "inheritedFrom": "RouteInfo" + }, + { + "file": "packages/@ember/routing/route-info.ts", + "line": 77, + "description": "

A reference to the parent route's RouteInfo. This can be used to traverse\nupward to the topmost RouteInfo.

\n", + "itemtype": "property", + "name": "parent", + "type": "RouteInfo|null", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "@ember/routing/route-info", + "inherited": true, + "inheritedFrom": "RouteInfo" + }, + { + "file": "packages/@ember/routing/route-info.ts", + "line": 84, + "description": "

A reference to the child route's RouteInfo. This can be used to traverse\ndownward to the leafmost RouteInfo.

\n", + "itemtype": "property", + "name": "child", + "type": "RouteInfo|null", + "access": "public", + "tagname": "", + "class": "RouteInfoWithAttributes", + "module": "@ember/routing/route-info", + "inherited": true, + "inheritedFrom": "RouteInfo" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-5.3.0-RouteInfo", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/routing/route-info", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-RouterService.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-RouterService.json new file mode 100644 index 000000000..bfe2a11bf --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-RouterService.json @@ -0,0 +1,882 @@ +{ + "data": { + "id": "ember-5.3.0-RouterService", + "type": "class", + "attributes": { + "name": "RouterService", + "shortname": "RouterService", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing/router-service", + "namespace": "", + "file": "packages/@ember/routing/router-service.ts", + "line": 27, + "description": "

The Router service is the public API that provides access to the router.

\n

The immediate benefit of the Router service is that you can inject it into components,\ngiving them a friendly way to initiate transitions and ask questions about the current\nglobal router state.

\n

In this example, the Router service is injected into a component to initiate a transition\nto a dedicated route:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/example.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { service } from '@ember/service';\n\nexport default class ExampleComponent extends Component {\n  @service router;\n\n  @action\n  next() {\n    this.router.transitionTo('other.route');\n  }\n}
\n
\n
\n \n

Like any service, it can also be injected into helpers, routes, etc.

\n", + "access": "public", + "tagname": "", + "extends": "Service", + "methods": [ + { + "file": "packages/@ember/routing/router-service.ts", + "line": 89, + "description": "

Transition the application into another route. The route may\nbe either a single route or route path:

\n

Calling transitionTo from the Router service will cause default query parameter values to be included in the URL.\nThis behavior is different from calling transitionTo on a route or transitionToRoute on a controller.\nSee the Router Service RFC for more info.

\n

In the following example we use the Router service to navigate to a route with a\nspecific model from a Component in the first action, and in the second we trigger\na query-params only transition.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/example.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { service } from '@ember/service';\n\nexport default class extends Component {\n  @service router;\n\n  @action\n  goToComments(post) {\n    this.router.transitionTo('comments', post);\n  }\n\n  @action\n  fetchMoreComments(latestComment) {\n    this.router.transitionTo({\n      queryParams: { commentsAfter: latestComment }\n    });\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "transitionTo", + "params": [ + { + "name": "routeNameOrUrl", + "description": "the name of the route or a URL", + "type": "String", + "optional": true + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route.", + "type": "...Object", + "optional": true + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters. May be supplied as the only\n parameter to trigger a query-parameter-only transition.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/routing/router-service.ts", + "line": 148, + "description": "

Similar to transitionTo, but instead of adding the destination to the browser's URL history,\nit replaces the entry for the current route.\nWhen the user clicks the "back" button in the browser, there will be fewer steps.\nThis is most commonly used to manage redirects in a way that does not cause confusing additions\nto the user's browsing history.

\n

Calling replaceWith from the Router service will cause default query parameter values to be included in the URL.\nThis behavior is different from calling replaceWith on a route.\nSee the Router Service RFC for more info.

\n

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/routes/application.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Route from '@ember/routing/route';\nimport { service } from '@ember/service';\n\nexport default class extends Route {\n  @service router;\n  beforeModel() {\n    if (!authorized()){\n      this.router.replaceWith('unauthorized');\n    }\n  }\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "replaceWith", + "params": [ + { + "name": "routeNameOrUrl", + "description": "the name of the route or a URL of the desired destination", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used while\n transitioning to the route i.e. an object of params to pass to the destination route", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the transition object associated with this\n attempted transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/routing/router-service.ts", + "line": 189, + "description": "

Generate a URL based on the supplied route name and optionally a model. The\nURL is returned as a string that can be used for any purpose.

\n

In this example, the URL for the author.books route for a given author\nis copied to the clipboard.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<CopyLink @author={{hash id="tomster" name="Tomster"}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
link.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
import Component from '@glimmer/component';\nimport { service } from '@ember/service';\nimport { action } from '@ember/object';\n\nexport default class CopyLinkComponent extends Component {\n  @service router;\n  @service clipboard;\n\n  @action\n  copyBooksURL() {\n    if (this.author) {\n      const url = this.router.urlFor('author.books', this.args.author);\n      this.clipboard.set(url);\n      // Clipboard now has /author/tomster/books\n    }\n  }\n}
\n
\n
\n \n

Just like with transitionTo and replaceWith, urlFor can also handle\nquery parameters.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<CopyLink @author={{hash id="tomster" name="Tomster"}} />
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
link.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n
import Component from '@glimmer/component';\nimport { service } from '@ember/service';\nimport { action } from '@ember/object';\n\nexport default class CopyLinkComponent extends Component {\n  @service router;\n  @service clipboard;\n\n  @action\n  copyOnlyEmberBooksURL() {\n    if (this.author) {\n      const url = this.router.urlFor('author.books', this.author, {\n        queryParams: { filter: 'emberjs' }\n      });\n      this.clipboard.set(url);\n      // Clipboard now has /author/tomster/books?filter=emberjs\n    }\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "urlFor", + "params": [ + { + "name": "routeName", + "description": "the name of the route", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) for the route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "the string representing the generated URL", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/routing/router-service.ts", + "line": 265, + "description": "

Returns true if routeName/models/queryParams is the active route, where models and queryParams are optional.\nSee model and\nqueryParams for more information about these arguments.

\n

In the following example, isActive will return true if the current route is /posts.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/posts.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Component from '@glimmer/component';\nimport { service } from '@ember/service';\n\nexport default class extends Component {\n  @service router;\n\n  displayComments() {\n    return this.router.isActive('posts');\n  }\n});
\n
\n
\n \n

The next example includes a dynamic segment, and will return true if the current route is /posts/1,\nassuming the post has an id of 1:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/posts.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
import Component from '@glimmer/component';\nimport { service } from '@ember/service';\n\nexport default class extends Component {\n  @service router;\n\n  displayComments(post) {\n    return this.router.isActive('posts', post.id);\n  }\n});
\n
\n
\n \n

Where post.id is the id of a specific post, which is represented in the route as /posts/[post.id].\nIf post.id is equal to 1, then isActive will return true if the current route is /posts/1, and false if the route is anything else.

\n", + "itemtype": "method", + "name": "isActive", + "params": [ + { + "name": "routeName", + "description": "the name of the route", + "type": "String" + }, + { + "name": "models", + "description": "the model(s) or identifier(s) to be used when determining the active route.", + "type": "...Object" + }, + { + "name": "options", + "description": "optional hash with a queryParams property\n containing a mapping of query parameters", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "true if the provided routeName/models/queryParams are active", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/routing/router-service.ts", + "line": 369, + "description": "

Takes a string URL and returns a RouteInfo for the leafmost route represented\nby the URL. Returns null if the URL is not recognized. This method expects to\nreceive the actual URL as seen by the browser including the app's rootURL.

\n

See RouteInfo for more info.

\n

In the following example recognize is used to verify if a path belongs to our\napplication before transitioning to it.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Component from '@ember/component';\nimport { service } from '@ember/service';\n\nexport default class extends Component {\n  @service router;\n  path = '/';\n\n  click() {\n    if (this.router.recognize(this.path)) {\n      this.router.transitionTo(this.path);\n    }\n  }\n}
\n
\n
\n ", + "itemtype": "method", + "name": "recognize", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "RouteInfo | null" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/routing/router-service.ts", + "line": 410, + "description": "

Takes a string URL and returns a promise that resolves to a\nRouteInfoWithAttributes for the leafmost route represented by the URL.\nThe promise rejects if the URL is not recognized or an unhandled exception\nis encountered. This method expects to receive the actual URL as seen by\nthe browser including the app's rootURL.

\n", + "itemtype": "method", + "name": "recognizeAndLoad", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "RouteInfo" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/routing/router-service.ts", + "line": 432, + "description": "

You can register a listener for events emitted by this service with .on():

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Route from '@ember/routing';\nimport { service } from '@ember/service';\n\nexport default class extends Route {\n  @service router;\n\n  activate() {\n    this.router.on('routeWillChange', (transition) => {\n      if (!transition.to.find(route => route.name === this.routeName)) {\n        alert("Please save or cancel your changes.");\n        transition.abort();\n      }\n    })\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "on", + "params": [ + { + "name": "eventName", + "description": "", + "type": "String" + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/routing/router-service.ts", + "line": 459, + "description": "

You can unregister a listener for events emitted by this service with .off():

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Route from '@ember/routing';\nimport { service } from '@ember/service';\n\nexport default class ContactFormRoute extends Route {\n  @service router;\n\n  callback = (transition) => {\n    if (!transition.to.find(route => route.name === this.routeName)) {\n      alert('Please save or cancel your changes.');\n      transition.abort();\n    }\n  };\n\n  activate() {\n    this.router.on('routeWillChange', this.callback);\n  }\n\n  deactivate() {\n    this.router.off('routeWillChange', this.callback);\n  }\n}
\n
\n
\n \n", + "itemtype": "method", + "name": "off", + "params": [ + { + "name": "eventName", + "description": "", + "type": "String" + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/routing/router-service.ts", + "line": 566, + "description": "

Refreshes all currently active routes, doing a full transition.\nIf a route name is provided and refers to a currently active route,\nit will refresh only that route and its descendents.\nReturns a promise that will be resolved once the refresh is complete.\nAll resetController, beforeModel, model, afterModel, redirect, and setupController\nhooks will be called again. You will get new data from the model hook.

\n", + "itemtype": "method", + "name": "refresh", + "params": [ + { + "name": "routeName", + "description": "the route to refresh (along with all child routes)", + "type": "String", + "optional": true + } + ], + "return": { + "description": "Transition" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 322, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 541, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 568, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 576, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 164, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 212, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 229, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 247, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 333, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 354, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 371, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 388, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 403, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 433, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 453, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 497, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [ + { + "file": "packages/@ember/routing/router-service.ts", + "line": 492, + "description": "

The routeWillChange event is fired at the beginning of any\nattempted transition with a Transition object as the sole\nargument. This action can be used for aborting, redirecting,\nor decorating the transition from the currently active routes.

\n

A good example is preventing navigation when a form is\nhalf-filled out:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Route from '@ember/routing';\nimport { service } from '@ember/service';\n\nexport default class extends Route {\n  @service router;\n\n  activate() {\n    this.router.on('routeWillChange', (transition) => {\n      if (!transition.to.find(route => route.name === this.routeName)) {\n        alert("Please save or cancel your changes.");\n        transition.abort();\n      }\n    })\n  }\n}
\n
\n
\n \n

The routeWillChange event fires whenever a new route is chosen as the desired target of a transition. This includes transitionTo, replaceWith, all redirection for any reason including error handling, and abort. Aborting implies changing the desired target back to where you already were. Once a transition has completed, routeDidChange fires.

\n", + "itemtype": "event", + "name": "routeWillChange", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/routing/router-service.ts", + "line": 526, + "description": "

The routeDidChange event only fires once a transition has settled.\nThis includes aborts and error substates. Like the routeWillChange event\nit receives a Transition as the sole argument.

\n

A good example is sending some analytics when the route has transitioned:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
form.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
import Route from '@ember/routing';\nimport { service } from '@ember/service';\n\nexport default class extends Route {\n  @service router;\n\n  activate() {\n    this.router.on('routeDidChange', (transition) => {\n      ga.send('pageView', {\n        current: transition.to.name,\n        from: transition.from.name\n      });\n    })\n  }\n}
\n
\n
\n \n

routeDidChange will be called after any Route's\ndidTransition\naction has been fired.\nThe updates of properties\ncurrentURL,\ncurrentRouteName\nand\ncurrentRoute\nare completed at the time routeDidChange is called.

\n", + "itemtype": "event", + "name": "routeDidChange", + "params": [ + { + "name": "transition", + "description": "", + "type": "Transition" + } + ], + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + } + ], + "properties": [ + { + "file": "packages/@ember/routing/router-service.ts", + "line": 594, + "description": "

Name of the current route.

\n

This property represents the logical name of the route,\n which is dot separated.\n For the following router:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n
 Router.map(function() {\n   this.route('about');\n   this.route('blog', function () {\n     this.route('post', { path: ':post_id' });\n   });\n });
\n
\n
\n \n

It will return:

\n
    \n
  • index when you visit /
  • \n
  • about when you visit /about
  • \n
  • blog.index when you visit /blog
  • \n
  • blog.post when you visit /blog/some-post-id
  • \n
\n", + "itemtype": "property", + "name": "currentRouteName", + "type": "{String | null}", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/routing/router-service.ts", + "line": 624, + "description": "

Current URL for the application.

\n

This property represents the URL path for this route.\n For the following router:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/router.js
1\n2\n3\n4\n5\n6\n
 Router.map(function() {\n   this.route('about');\n   this.route('blog', function () {\n     this.route('post', { path: ':post_id' });\n   });\n });
\n
\n
\n \n

It will return:

\n
    \n
  • / when you visit /
  • \n
  • /about when you visit /about
  • \n
  • /blog when you visit /blog
  • \n
  • /blog/some-post-id when you visit /blog/some-post-id
  • \n
\n", + "itemtype": "property", + "name": "currentURL", + "type": "String", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/routing/router-service.ts", + "line": 653, + "description": "

The location property returns what implementation of the location API\nyour application is using, which determines what type of URL is being used.

\n

See Location for more information.

\n

To force a particular location API implementation to be used in your\napplication you can set a location type on your config/environment.\nFor example, to set the history type:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
config/environment.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
'use strict';\n\nmodule.exports = function(environment) {\n  let ENV = {\n    modulePrefix: 'router-service',\n    environment,\n    rootURL: '/',\n    locationType: 'history',\n    ...\n  }\n}
\n
\n
\n \n

The following location types are available by default:\nhash, history, none.

\n

See HashLocation.\nSee HistoryLocation.\nSee NoneLocation.

\n", + "itemtype": "property", + "name": "location", + "default": "'hash'", + "see": [ + "{Location}" + ], + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/routing/router-service.ts", + "line": 692, + "description": "

The rootURL property represents the URL of the root of\nthe application, '/' by default.\nThis prefix is assumed on all routes defined on this app.

\n

If you change the rootURL in your environment configuration\nlike so:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
config/environment.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
'use strict';\n\nmodule.exports = function(environment) {\n  let ENV = {\n    modulePrefix: 'router-service',\n    environment,\n    rootURL: '/my-root',\n  …\n  }\n]
\n
\n
\n \n

This property will return /my-root.

\n", + "itemtype": "property", + "name": "rootURL", + "default": "'/'", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/routing/router-service.ts", + "line": 722, + "description": "

The currentRoute property contains metadata about the current leaf route.\nIt returns a RouteInfo object that has information like the route name,\nparams, query params and more.

\n

See RouteInfo for more info.

\n

This property is guaranteed to change whenever a route transition\nhappens (even when that transition only changes parameters\nand doesn't change the active route).

\n

Usage example:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/components/header.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n
  import Component from '@glimmer/component';\n  import { service } from '@ember/service';\n  import { notEmpty } from '@ember/object/computed';\n\n  export default class extends Component {\n    @service router;\n\n    @notEmpty('router.currentRoute.child') isChildRoute;\n  });
\n
\n
\n \n", + "itemtype": "property", + "name": "currentRoute", + "type": "RouteInfo", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/routing/router-service" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 356, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 430, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 505, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 523, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "RouterService", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-5.3.0-Service", + "type": "class" + } + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/routing/router-service", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-RoutingService.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-RoutingService.json new file mode 100644 index 000000000..562db4d66 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-RoutingService.json @@ -0,0 +1,45 @@ +{ + "data": { + "id": "ember-5.3.0-RoutingService", + "type": "class", + "attributes": { + "name": "RoutingService", + "shortname": "RoutingService", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "", + "file": "packages/@ember/routing/lib/routing-service.ts", + "line": 15, + "description": "

The Routing service is used by LinkTo, and provides facilities for\nthe component/view layer to interact with the router.

\n

This is a private service for internal usage only. For public usage,\nrefer to the Router service.

\n", + "access": "private", + "tagname": "", + "methods": [], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-ember", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-SafeString.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-SafeString.json new file mode 100644 index 000000000..d8a9f8532 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-SafeString.json @@ -0,0 +1,77 @@ +{ + "data": { + "id": "ember-5.3.0-SafeString", + "type": "class", + "attributes": { + "name": "SafeString", + "shortname": "SafeString", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/template", + "namespace": "", + "file": "packages/@ember/-internals/glimmer/lib/utils/string.ts", + "line": 7, + "description": "

A wrapper around a string that has been marked as safe ("trusted"). When\nrendered in HTML, Ember will not perform any escaping.

\n

Note:

\n
    \n
  1. This does not make the string safe; it means that some code in your\napplication has marked it as safe using the htmlSafe() function.

    \n
  2. \n
  3. The only public API for getting a SafeString is calling htmlSafe(). It\nis not user-constructible.

    \n
  4. \n
\n

If a string contains user inputs or other untrusted data, you must sanitize\nthe string before using the htmlSafe method. Otherwise your code is\nvulnerable to Cross-Site Scripting. There are many open source\nsanitization libraries to choose from, both for front end and server-side\nsanitization.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { htmlSafe } from '@ember/template';\n\nlet someTrustedOrSanitizedString = "<div>Hello!</div>"\n\nhtmlSafe(someTrustedorSanitizedString);
\n
\n
\n \n", + "since": "4.12.0", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/-internals/glimmer/lib/utils/string.ts", + "line": 47, + "description": "

Get the string back to use as a string.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "toString", + "return": { + "description": "The string marked as trusted", + "type": "String" + }, + "class": "SafeString", + "module": "@ember/template" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/utils/string.ts", + "line": 58, + "description": "

Get the wrapped string as HTML to use without escaping.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "toHTML", + "return": { + "description": "the trusted string, without any escaping applied", + "type": "String" + }, + "class": "SafeString", + "module": "@ember/template" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/template", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-Service.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-Service.json new file mode 100644 index 000000000..ad0352a41 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-Service.json @@ -0,0 +1,541 @@ +{ + "data": { + "id": "ember-5.3.0-Service", + "type": "class", + "attributes": { + "name": "Service", + "shortname": "Service", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/service", + "namespace": "", + "file": "packages/@ember/service/index.ts", + "line": 87, + "extends": "EmberObject", + "since": "1.10.0", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/object/core.ts", + "line": 322, + "description": "

An overridable method called when objects are instantiated. By default,\ndoes nothing unless it is overridden during class definition.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n  init() {\n    alert(`Name is ${this.get('name')}`);\n  }\n});\n\nlet steve = Person.create({\n  name: 'Steve'\n});\n\n// alerts 'Name is Steve'.
\n
\n
\n \n

NOTE: If you do override init for a framework class like Component\nfrom @ember/component, be sure to call this._super(...arguments)\nin your init declaration!\nIf you don't, Ember may not have an opportunity to\ndo important setup work, and you'll see strange behavior in your\napplication.

\n", + "itemtype": "method", + "name": "init", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 541, + "description": "

Destroys an object by setting the isDestroyed flag and removing its\nmetadata, which effectively destroys observers and bindings.

\n

If you try to set a property on a destroyed object, an exception will be\nraised.

\n

Note that destruction is scheduled for the end of the run loop and does not\nhappen immediately. It will set an isDestroying flag immediately.

\n", + "itemtype": "method", + "name": "destroy", + "return": { + "description": "receiver", + "type": "EmberObject" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 568, + "description": "

Override to implement teardown.

\n", + "itemtype": "method", + "name": "willDestroy", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 576, + "description": "

Returns a string representation which attempts to provide more information\nthan Javascript's toString typically does, in a generic way for all Ember\nobjects.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend();\nperson = Person.create();\nperson.toString(); //=> "<Person:ember1024>"
\n
\n
\n \n

If the object's class is not defined on an Ember namespace, it will\nindicate it is a subclass of the registered superclass:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
const Student = Person.extend();\nlet student = Student.create();\nstudent.toString(); //=> "<(subclass of Person):ember1025>"
\n
\n
\n \n

If the method toStringExtension is defined, its return value will be\nincluded in the output.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
const Teacher = Person.extend({\n  toStringExtension() {\n    return this.get('fullName');\n  }\n});\nteacher = Teacher.create();\nteacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
\n
\n
\n \n", + "itemtype": "method", + "name": "toString", + "return": { + "description": "string representation", + "type": "String" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 93, + "description": "

Retrieves the value of a property from the object.

\n

This method is usually similar to using object[keyName] or object.keyName,\nhowever it supports both computed properties and the unknownProperty\nhandler.

\n

Because get unifies the syntax for accessing all these kinds\nof properties, it can make many refactorings easier, such as replacing a\nsimple property with a computed property, or vice versa.

\n

Computed Properties

\n

Computed properties are methods defined with the property modifier\ndeclared at the end, such as:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { computed } from '@ember/object';\n\nfullName: computed('firstName', 'lastName', function() {\n  return this.get('firstName') + ' ' + this.get('lastName');\n})
\n
\n
\n \n

When you call get on a computed property, the function will be\ncalled and the return value will be returned instead of the function\nitself.

\n

Unknown Properties

\n

Likewise, if you try to call get on a property whose value is\nundefined, the unknownProperty() method will be called on the object.\nIf this method returns any value other than undefined, it will be returned\ninstead. This allows you to implement "virtual" properties that are\nnot defined upfront.

\n", + "itemtype": "method", + "name": "get", + "params": [ + { + "name": "keyName", + "description": "The property to retrieve", + "type": "String" + } + ], + "return": { + "description": "The property value or undefined.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 137, + "description": "

To get the values of multiple properties at once, call getProperties\nwith a list of strings or an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties('firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n

is equivalent to:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
record.getProperties(['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
\n
\n
\n \n", + "itemtype": "method", + "name": "getProperties", + "params": [ + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 164, + "description": "

Sets the provided key or path to the value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.set("key", value);
\n
\n
\n \n

This method is generally very similar to calling object["key"] = value or\nobject.key = value, except that it provides support for computed\nproperties, the setUnknownProperty() method and property observers.

\n

Computed Properties

\n

If you try to set a value on a key that has a computed property handler\ndefined (see the get() method for an example), then set() will call\nthat method, passing both the value and key instead of simply changing\nthe value itself. This is useful for those times when you need to\nimplement a property that is composed of one or more member\nproperties.

\n

Unknown Properties

\n

If you try to set a value on a key that is undefined in the target\nobject, then the setUnknownProperty() handler will be called instead. This\ngives you an opportunity to implement complex "virtual" properties that\nare not predefined on the object. If setUnknownProperty() returns\nundefined, then set() will simply set the value on the object.

\n

Property Observers

\n

In addition to changing the property, set() will also register a property\nchange with the object. Unless you have placed this call inside of a\nbeginPropertyChanges() and endPropertyChanges(), any "local" observers\n(i.e. observer methods declared on the same object), will be called\nimmediately. Any "remote" observers (i.e. observer methods declared on\nanother object) will be placed in a queue and called at a later time in a\ncoalesced manner.

\n", + "itemtype": "method", + "name": "set", + "params": [ + { + "name": "keyName", + "description": "The property to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set or `null`.", + "type": "Object" + } + ], + "return": { + "description": "The passed value", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 212, + "description": "

Sets a list of properties at once. These properties are set inside\na single beginPropertyChanges and endPropertyChanges batch, so\nobservers will be buffered.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
\n
\n
\n \n", + "itemtype": "method", + "name": "setProperties", + "params": [ + { + "name": "hash", + "description": "the hash of keys and values to set", + "type": "Object" + } + ], + "return": { + "description": "The passed in hash", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 229, + "description": "

Convenience method to call propertyWillChange and propertyDidChange in\nsuccession.

\n

Notify the observer system that a property has just changed.

\n

Sometimes you need to change a value directly or indirectly without\nactually calling get() or set() on it. In this case, you can use this\nmethod instead. Calling this method will notify all observers that the\nproperty has potentially changed value.

\n", + "itemtype": "method", + "name": "notifyPropertyChange", + "params": [ + { + "name": "keyName", + "description": "The property key to be notified about.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 247, + "description": "

Adds an observer on a property.

\n

This is the core method used to register an observer for a property.

\n

Once you call this method, any time the key's value is set, your observer\nwill be notified. Note that the observers are triggered any time the\nvalue is set, regardless of whether it has actually changed. Your\nobserver should be prepared to handle that.

\n

There are two common invocation patterns for .addObserver():

\n
    \n
  • Passing two arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the function to invoke (an actual function)
    • \n
    \n
  • \n
  • Passing three arguments:
      \n
    • the name of the property to observe (as a string)
    • \n
    • the target object (will be used to look up and invoke a\nfunction on)
    • \n
    • the name of the function to invoke on the target object\n(as a string).
    • \n
    \n
  • \n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n\n    // the following are equivalent:\n\n    // using three arguments\n    this.addObserver('foo', this, 'fooDidChange');\n\n    // using two arguments\n    this.addObserver('foo', (...args) => {\n      this.fooDidChange(...args);\n    });\n  },\n\n  fooDidChange() {\n    // your custom logic code\n  }\n});
\n
\n
\n \n

Observer Methods

\n

Observer methods have the following signature:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
component.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  init() {\n    this._super(...arguments);\n    this.addObserver('foo', this, 'fooDidChange');\n  },\n\n  fooDidChange(sender, key, value, rev) {\n    // your code\n  }\n});
\n
\n
\n \n

The sender is the object that changed. The key is the property that\nchanges. The value property is currently reserved and unused. The rev\nis the last property revision of the object when it changed, which you can\nuse to detect if the key value has really changed or not.

\n

Usually you will not need the value or revision parameters at\nthe end. In this case, it is common to write observer methods that take\nonly a sender and key value as parameters or, if you aren't interested in\nany of these values, to write an observer that has no parameters at all.

\n", + "itemtype": "method", + "name": "addObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is sync or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 333, + "description": "

Remove an observer you have previously registered on this object. Pass\nthe same key, target, and method you passed to addObserver() and your\ntarget will no longer receive notifications.

\n", + "itemtype": "method", + "name": "removeObserver", + "params": [ + { + "name": "key", + "description": "The key to observe", + "type": "String" + }, + { + "name": "target", + "description": "The target object to invoke", + "type": "Object" + }, + { + "name": "method", + "description": "The method to invoke", + "type": "String|Function" + }, + { + "name": "sync", + "description": "Whether the observer is async or not", + "type": "Boolean" + } + ], + "return": { + "description": "", + "type": "Observable" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 354, + "description": "

Set the value of a property to the current value plus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
person.incrementProperty('age');\nteam.incrementProperty('score', 2);
\n
\n
\n \n", + "itemtype": "method", + "name": "incrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to increment", + "type": "String" + }, + { + "name": "increment", + "description": "The amount to increment by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 371, + "description": "

Set the value of a property to the current value minus some amount.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
player.decrementProperty('lives');\norc.decrementProperty('health', 5);
\n
\n
\n \n", + "itemtype": "method", + "name": "decrementProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to decrement", + "type": "String" + }, + { + "name": "decrement", + "description": "The amount to decrement by. Defaults to 1", + "type": "Number" + } + ], + "return": { + "description": "The new property value", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 388, + "description": "

Set the value of a boolean property to the opposite of its\ncurrent value.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
starship.toggleProperty('warpDriveEngaged');
\n
\n
\n \n", + "itemtype": "method", + "name": "toggleProperty", + "params": [ + { + "name": "keyName", + "description": "The name of the property to toggle", + "type": "String" + } + ], + "return": { + "description": "The new property value", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 403, + "description": "

Returns the cached value of a computed property, if it exists.\nThis allows you to inspect the value of a computed property\nwithout accidentally invoking it if it is intended to be\ngenerated lazily.

\n", + "itemtype": "method", + "name": "cacheFor", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The cached value of the computed property, if any", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 433, + "description": "

Begins a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call this\nmethod at the beginning of the changes to begin deferring change\nnotifications. When you are done making changes, call\nendPropertyChanges() to deliver the deferred change notifications and end\ndeferring.

\n", + "itemtype": "method", + "name": "beginPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Service", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 453, + "description": "

Ends a grouping of property changes.

\n

You can use this method to group property changes so that notifications\nwill not be sent until the changes are finished. If you plan to make a\nlarge number of changes to an object at one time, you should call\nbeginPropertyChanges() at the beginning of the changes to defer change\nnotifications. When you are done making changes, call this method to\ndeliver the deferred change notifications and end deferring.

\n", + "itemtype": "method", + "name": "endPropertyChanges", + "return": { + "description": "", + "type": "Observable" + }, + "access": "private", + "tagname": "", + "class": "Service", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + }, + { + "file": "packages/@ember/object/observable.ts", + "line": 497, + "description": "

Returns true if the object currently has observers registered for a\nparticular key. You can use this method to potentially defer performing\nan expensive action until someone begins observing a particular property\non the object.

\n", + "itemtype": "method", + "name": "hasObserverFor", + "params": [ + { + "name": "key", + "description": "Key to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "Service", + "module": "@ember/object/observable", + "inherited": true, + "inheritedFrom": "Observable" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/object/core.ts", + "line": 356, + "description": "

Defines the properties that will be concatenated from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by combining the superclass' property\nvalue with the subclass' value. An example of this in use within Ember\nis the classNames property of Component from @ember/component.

\n

Here is some sample code showing the difference between a concatenated\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties to concatenate\n  concatenatedProperties: ['concatenatedProperty'],\n\n  someNonConcatenatedProperty: ['bar'],\n  concatenatedProperty: ['bar']\n});\n\nconst FooBar = Bar.extend({\n  someNonConcatenatedProperty: ['foo'],\n  concatenatedProperty: ['foo']\n});\n\nlet fooBar = FooBar.create();\nfooBar.get('someNonConcatenatedProperty'); // ['foo']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo']
\n
\n
\n \n

This behavior extends to object creation as well. Continuing the\nabove example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fooBar = FooBar.create({\n  someNonConcatenatedProperty: ['baz'],\n  concatenatedProperty: ['baz']\n})\nfooBar.get('someNonConcatenatedProperty'); // ['baz']\nfooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Adding a single property that is not an array will just add it in the array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fooBar = FooBar.create({\n  concatenatedProperty: 'baz'\n})\nview.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
\n
\n
\n \n

Using the concatenatedProperties property, we can tell Ember to mix the\ncontent of the properties.

\n

In Component the classNames, classNameBindings and\nattributeBindings properties are concatenated.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual concatenated property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "concatenatedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 430, + "description": "

Defines the properties that will be merged from the superclass\n(instead of overridden).

\n

By default, when you extend an Ember class a property defined in\nthe subclass overrides a property with the same name that is defined\nin the superclass. However, there are some cases where it is preferable\nto build up a property's value by merging the superclass property value\nwith the subclass property's value. An example of this in use within Ember\nis the queryParams property of routes.

\n

Here is some sample code showing the difference between a merged\nproperty and a normal one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n
import EmberObject from '@ember/object';\n\nconst Bar = EmberObject.extend({\n  // Configure which properties are to be merged\n  mergedProperties: ['mergedProperty'],\n\n  someNonMergedProperty: {\n    nonMerged: 'superclass value of nonMerged'\n  },\n  mergedProperty: {\n    page: { replace: false },\n    limit: { replace: true }\n  }\n});\n\nconst FooBar = Bar.extend({\n  someNonMergedProperty: {\n    completelyNonMerged: 'subclass value of nonMerged'\n  },\n  mergedProperty: {\n    limit: { replace: false }\n  }\n});\n\nlet fooBar = FooBar.create();\n\nfooBar.get('someNonMergedProperty');\n// => { completelyNonMerged: 'subclass value of nonMerged' }\n//\n// Note the entire object, including the nonMerged property of\n// the superclass object, has been replaced\n\nfooBar.get('mergedProperty');\n// => {\n//   page: {replace: false},\n//   limit: {replace: false}\n// }\n//\n// Note the page remains from the superclass, and the\n// `limit` property's value of `false` has been merged from\n// the subclass.
\n
\n
\n \n

This behavior is not available during object create calls. It is only\navailable at extend time.

\n

In Route the queryParams property is merged.

\n

This feature is available for you to use throughout the Ember object model,\nalthough typical app developers are likely to use it infrequently. Since\nit changes expectations about behavior of properties, you should properly\ndocument its usage in each individual merged property (to not\nmislead your users to think they can override the property in a subclass).

\n", + "itemtype": "property", + "name": "mergedProperties", + "type": "Array", + "default": "null", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 505, + "description": "

Destroyed object property flag.

\n

if this property is true the observers and bindings were already\nremoved by the effect of calling the destroy() method.

\n", + "itemtype": "property", + "name": "isDestroyed", + "default": "false", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 523, + "description": "

Destruction scheduled flag. The destroy() method has been called.

\n

The object stays intact until the end of the run loop at which point\nthe isDestroyed flag is set.

\n", + "itemtype": "property", + "name": "isDestroying", + "default": "false", + "access": "public", + "tagname": "", + "class": "Service", + "module": "@ember/object/core", + "inherited": true, + "inheritedFrom": "CoreObject" + } + ] + }, + "relationships": { + "parent-class": { + "data": { + "id": "ember-5.3.0-EmberObject", + "type": "class" + } + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-5.3.0-RouterService" + } + ] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/service", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-TestAdapter.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-TestAdapter.json new file mode 100644 index 000000000..0d8f551f9 --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-TestAdapter.json @@ -0,0 +1,91 @@ +{ + "data": { + "id": "ember-5.3.0-TestAdapter", + "type": "class", + "attributes": { + "name": "TestAdapter", + "shortname": "TestAdapter", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/test", + "namespace": "", + "file": "packages/ember-testing/lib/adapters/adapter.ts", + "line": 7, + "description": "

The primary purpose of this class is to create hooks that can be implemented\nby an adapter for various test frameworks.

\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/ember-testing/lib/adapters/adapter.ts", + "line": 20, + "description": "

This callback will be called whenever an async operation is about to start.

\n

Override this to call your framework's methods that handle async\noperations.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "asyncStart", + "class": "TestAdapter", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/adapters/adapter.ts", + "line": 31, + "description": "

This callback will be called whenever an async operation has completed.

\n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "asyncEnd", + "class": "TestAdapter", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/adapters/adapter.ts", + "line": 39, + "description": "

Override this method with your testing framework's false assertion.\nThis function is called whenever an exception occurs causing the testing\npromise to fail.

\n

QUnit example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
  exception: function(error) {\n    ok(false, error);\n  };
\n
\n
\n \n", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "exception", + "params": [ + { + "name": "error", + "description": "The exception to be raised.", + "type": "String" + } + ], + "class": "TestAdapter", + "module": "@ember/test" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [ + { + "type": "class", + "id": "ember-5.3.0-Ember.Test.QUnitAdapter" + } + ] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/test", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-Transition.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-Transition.json new file mode 100644 index 000000000..7de328c0f --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-Transition.json @@ -0,0 +1,307 @@ +{ + "data": { + "id": "ember-5.3.0-Transition", + "type": "class", + "attributes": { + "name": "Transition", + "shortname": "Transition", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing/transition", + "namespace": "", + "file": "packages/@ember/routing/transition.ts", + "line": 10, + "description": "

A Transition is a thennable (a Promise-like object) that represents an\nattempt to transition to another route. It can be aborted, either explicitly\nvia abort or by attempting another transition while a previous one is still\nunderway. An aborted transition can also be retry()d later.

\n

A Transition is not user-constructible; the only legal way to get one is in\na Route hook or a RouterService.on() callback. However, you can import the\ntype by using import type syntax with TypeScript or import() in JSDoc\ncomments.

\n", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/routing/transition.ts", + "line": 48, + "description": "

A standard promise hook that resolves if the Transition succeeds and rejects\nif it fails/redirects/aborts.

\n

Forwards to the internal promise property which you can use in situations\nwhere you want to pass around a thennable, but not the Transition itself.

\n", + "itemtype": "method", + "name": "then", + "params": [ + { + "name": "onFulfilled", + "description": "", + "type": "Function" + }, + { + "name": "onRejected", + "description": "", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise. Useful for\n tooling.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "access": "public", + "tagname": "", + "class": "Transition", + "module": "@ember/routing/transition" + }, + { + "file": "packages/@ember/routing/transition.ts", + "line": 64, + "description": "

Forwards to the internal promise property which you can use in situations\nwhere you want to pass around a thennable, but not the Transition itself.

\n", + "itemtype": "method", + "name": "catch", + "params": [ + { + "name": "onRejection", + "description": "", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise. Useful for\n tooling.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "access": "public", + "tagname": "", + "class": "Transition", + "module": "@ember/routing/transition" + }, + { + "file": "packages/@ember/routing/transition.ts", + "line": 76, + "description": "

Forwards to the internal promise property which you can use in situations\nwhere you want to pass around a thennable, but not the Transition itself.

\n", + "itemtype": "method", + "name": "finally", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise. Useful for\n tooling.", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "access": "public", + "tagname": "", + "class": "Transition", + "module": "@ember/routing/transition" + }, + { + "file": "packages/@ember/routing/transition.ts", + "line": 88, + "description": "

Aborts the Transition. Note you can also implicitly abort a transition\nby initiating another transition while a previous one is underway.

\n", + "itemtype": "method", + "name": "abort", + "return": { + "description": "this transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "Transition", + "module": "@ember/routing/transition" + }, + { + "file": "packages/@ember/routing/transition.ts", + "line": 97, + "description": "

Retries a previously-aborted transition (making sure to abort the transition\nif it's still active). Returns a new transition that represents the new\nattempt to transition.

\n", + "itemtype": "method", + "name": "retry", + "return": { + "description": "new transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "Transition", + "module": "@ember/routing/transition" + }, + { + "file": "packages/@ember/routing/transition.ts", + "line": 107, + "description": "

Sets the URL-changing method to be employed at the end of a successful\ntransition. By default, a new Transition will just use updateURL, but\npassing 'replace' to this method will cause the URL to update using\n'replaceWith' instead. Omitting a parameter will disable the URL change,\nallowing for transitions that don't update the URL at completion (this is also\nused for handleURL, since the URL has already changed before the transition\ntook place).

\n", + "itemtype": "method", + "name": "method", + "params": [ + { + "name": "method", + "description": "the type of URL-changing method to use at the end of a\n transition. Accepted values are 'replace', falsy values, or any other\n non-falsy value (which is interpreted as an updateURL transition).", + "type": "String" + } + ], + "return": { + "description": "this transition", + "type": "Transition" + }, + "access": "public", + "tagname": "", + "class": "Transition", + "module": "@ember/routing/transition" + }, + { + "file": "packages/@ember/routing/transition.ts", + "line": 125, + "description": "

Fires an event on the current list of resolved/resolving handlers within this\n transition. Useful for firing events on route hierarchies that haven't fully\n been entered yet.\nNote: This method is also aliased as send

\n", + "itemtype": "method", + "name": "trigger", + "params": [ + { + "name": "ignoreFailure", + "description": "a boolean specifying whether unhandled\n events throw an error", + "type": "Boolean", + "optional": true, + "optdefault": "false" + }, + { + "name": "name", + "description": "the name of the event to fire", + "type": "String" + } + ], + "access": "public", + "tagname": "", + "class": "Transition", + "module": "@ember/routing/transition" + }, + { + "file": "packages/@ember/routing/transition.ts", + "line": 157, + "description": "

Transitions are aborted and their promises rejected when redirects occur; this\nmethod returns a promise that will follow any redirects that occur and fulfill\nwith the value fulfilled by any redirecting transitions that occur.

\n", + "itemtype": "method", + "name": "followRedirects", + "return": { + "description": "a promise that fulfills with the same value that the final\n redirecting transition fulfills with", + "type": "Promise" + }, + "access": "public", + "tagname": "", + "class": "Transition", + "module": "@ember/routing/transition" + }, + { + "file": "packages/@ember/routing/transition.ts", + "line": 168, + "description": "

In non-production builds, this function will return the stack that this\nTransition was created within. In production builds, this function will not\nbe present.

\n", + "itemtype": "method", + "name": "debugCreationStack", + "return": { + "description": "string" + }, + "class": "Transition", + "module": "@ember/routing/transition" + }, + { + "file": "packages/@ember/routing/transition.ts", + "line": 177, + "description": "

In non-production builds, this function will return the stack that this\nTransition was aborted within (or undefined if the Transition has not\nbeen aborted yet). In production builds, this function will not be present.

\n", + "itemtype": "method", + "name": "debugAbortStack", + "return": { + "description": "string" + }, + "class": "Transition", + "module": "@ember/routing/transition" + } + ], + "events": [], + "properties": [ + { + "file": "packages/@ember/routing/transition.ts", + "line": 25, + "description": "

The Transition's internal Promise. Calling .then on this property is\nthat same as calling .then on the Transition object itself, but this\nproperty is exposed for when you want to pass around a Transition's promise,\nbut not the Transition object itself, since Transition object can be\nexternally aborted, while the promise cannot.

\n", + "itemtype": "property", + "name": "promise", + "type": "{Promise}", + "access": "public", + "tagname": "", + "class": "Transition", + "module": "@ember/routing/transition" + }, + { + "file": "packages/@ember/routing/transition.ts", + "line": 37, + "description": "

Custom state can be stored on a Transition's data object. This can be\nuseful for decorating a Transition within an earlier hook and shared with a\nlater hook. Properties set on data will be copied to new transitions\ngenerated by calling retry on this transition.

\n", + "itemtype": "property", + "name": "data", + "type": "{Object}", + "access": "public", + "tagname": "", + "class": "Transition", + "module": "@ember/routing/transition" + }, + { + "file": "packages/@ember/routing/transition.ts", + "line": 140, + "description": "

This property is a RouteInfo object that represents where the router is\ntransitioning to. It's important to note that a RouteInfo is a linked list\nand this property represents the leafmost route.

\n", + "itemtype": "property", + "name": "to", + "type": "Null|RouteInfo|RouteInfoWithAttributes", + "access": "public", + "tagname": "", + "class": "Transition", + "module": "@ember/routing/transition" + }, + { + "file": "packages/@ember/routing/transition.ts", + "line": 148, + "description": "

This property is a RouteInfo object that represents where transition\noriginated from. It's important to note that a RouteInfo is a linked list\nand this property represents the head node of the list. In the case of an\ninitial render, from will be set to null.

\n", + "itemtype": "property", + "name": "from", + "type": "Null|RouteInfoWithAttributes", + "access": "public", + "tagname": "", + "class": "Transition", + "module": "@ember/routing/transition" + }, + { + "file": "packages/@ember/routing/transition.ts", + "line": 186, + "description": "

In non-production builds, this property references the Transition that\nthis Transition was derived from or undefined if this transition did not\nderive from another. In production builds, this property will not be present.

\n", + "itemtype": "property", + "name": "debugPreviousTransition", + "type": "{Transition | undefined}", + "class": "Transition", + "module": "@ember/routing/transition" + } + ] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/routing/transition", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/classes/ember-5.3.0-rsvp.json b/json-docs/ember/5.3.0/classes/ember-5.3.0-rsvp.json new file mode 100644 index 000000000..d9c3dd19a --- /dev/null +++ b/json-docs/ember/5.3.0/classes/ember-5.3.0-rsvp.json @@ -0,0 +1,445 @@ +{ + "data": { + "id": "ember-5.3.0-rsvp", + "type": "class", + "attributes": { + "name": "rsvp", + "shortname": "rsvp", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "rsvp", + "namespace": "", + "methods": [ + { + "file": "node_modules/rsvp/lib/rsvp/all-settled.js", + "line": 20, + "description": "

RSVP.allSettled is similar to RSVP.all, but instead of implementing\na fail-fast method, it waits until all the promises have returned and\nshows you all the results. This is useful if you want to handle multiple\npromises' failure states together as a set.

\n

Returns a promise that is fulfilled when all the given promises have been\nsettled. The return promise is fulfilled with an array of the states of\nthe promises passed into the promises array argument.

\n

Each state object will either indicate fulfillment or rejection, and\nprovide the corresponding value or reason. The states will take one of\nthe following formats:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{ state: 'fulfilled', value: value }\n  or\n{ state: 'rejected', reason: reason }
\n
\n
\n \n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n
let promise1 = RSVP.Promise.resolve(1);\nlet promise2 = RSVP.Promise.reject(new Error('2'));\nlet promise3 = RSVP.Promise.reject(new Error('3'));\nlet promises = [ promise1, promise2, promise3 ];\n\nRSVP.allSettled(promises).then(function(array){\n  // array == [\n  //   { state: 'fulfilled', value: 1 },\n  //   { state: 'rejected', reason: Error },\n  //   { state: 'rejected', reason: Error }\n  // ]\n  // Note that for the second item, reason.message will be '2', and for the\n  // third item, reason.message will be '3'.\n}, function(error) {\n  // Not run. (This block would only be called if allSettled had failed,\n  // for instance if passed an incorrect argument type.)\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "allSettled", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "entries", + "description": "", + "type": "Array" + }, + { + "name": "label", + "description": "- optional string that describes the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled with an array of the settled\nstates of the constituent promises.", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/all.js", + "line": 3, + "description": "

This is a convenient alias for Promise.all.

\n", + "itemtype": "method", + "name": "all", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "array", + "description": "Array of promises.", + "type": "Array" + }, + { + "name": "label", + "description": "An optional label. This is useful\nfor tooling.", + "type": "String", + "optional": true + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/defer.js", + "line": 3, + "description": "

defer returns an object similar to jQuery's $.Deferred.\ndefer should be used when porting over code reliant on $.Deferred's\ninterface. New code should use the Promise constructor instead.

\n

The object returned from defer is a plain object with three properties:

\n
    \n
  • promise - an Promise.
  • \n
  • reject - a function that causes the promise property on this object to\nbecome rejected
  • \n
  • resolve - a function that causes the promise property on this object to\nbecome fulfilled.
  • \n
\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n
 let deferred = defer();\n\n deferred.resolve("Success!");\n\n deferred.promise.then(function(value){\n   // value here is "Success!"\n });
\n
\n
\n \n", + "itemtype": "method", + "name": "defer", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/events.js", + "line": 19, + "description": "

EventTarget.mixin extends an object with EventTarget methods. For\nExample:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import EventTarget from 'rsvp';\n\nlet object = {};\n\nEventTarget.mixin(object);\n\nobject.on('finished', function(event) {\n  // handle event\n});\n\nobject.trigger('finished', { detail: value });
\n
\n
\n \n

EventTarget.mixin also works with prototypes:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import EventTarget from 'rsvp';\n\nlet Person = function() {};\nEventTarget.mixin(Person.prototype);\n\nlet yehuda = new Person();\nlet tom = new Person();\n\nyehuda.on('poke', function(event) {\n  console.log('Yehuda says OW');\n});\n\ntom.on('poke', function(event) {\n  console.log('Tom says OW');\n});\n\nyehuda.trigger('poke');\ntom.trigger('poke');
\n
\n
\n \n", + "itemtype": "method", + "name": "mixin", + "access": "private", + "tagname": "", + "params": [ + { + "name": "object", + "description": "object to extend with EventTarget methods", + "type": "Object" + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/events.js", + "line": 107, + "description": "

You can use off to stop firing a particular callback for an event:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n
function doStuff() { // do stuff! }\nobject.on('stuff', doStuff);\n\nobject.trigger('stuff'); // doStuff will be called\n\n// Unregister ONLY the doStuff callback\nobject.off('stuff', doStuff);\nobject.trigger('stuff'); // doStuff will NOT be called
\n
\n
\n \n

If you don't pass a callback argument to off, ALL callbacks for the\nevent will not be executed when the event fires. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n
let callback1 = function(){};\nlet callback2 = function(){};\n\nobject.on('stuff', callback1);\nobject.on('stuff', callback2);\n\nobject.trigger('stuff'); // callback1 and callback2 will be executed.\n\nobject.off('stuff');\nobject.trigger('stuff'); // callback1 and callback2 will not be executed!
\n
\n
\n \n", + "itemtype": "method", + "name": "off", + "access": "private", + "tagname": "", + "params": [ + { + "name": "eventName", + "description": "event to stop listening to", + "type": "String" + }, + { + "name": "callback", + "description": "optional argument. If given, only the function\ngiven will be removed from the event's callback queue. If no `callback`\nargument is given, all callbacks will be removed from the event's callback\nqueue.", + "type": "Function", + "optional": true + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/events.js", + "line": 162, + "description": "

Use trigger to fire custom events. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
object.on('foo', function(){\n  console.log('foo event happened!');\n});\nobject.trigger('foo');\n// 'foo event happened!' logged to the console
\n
\n
\n \n

You can also pass a value as a second argument to trigger that will be\npassed as an argument to all event listeners for the event:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
object.on('foo', function(value){\n  console.log(value.name);\n});\n\nobject.trigger('foo', { name: 'bar' });\n// 'bar' logged to the console
\n
\n
\n \n", + "itemtype": "method", + "name": "trigger", + "access": "private", + "tagname": "", + "params": [ + { + "name": "eventName", + "description": "name of the event to be triggered", + "type": "String" + }, + { + "name": "options", + "description": "optional value to be passed to any event handlers for\nthe given `eventName`", + "type": "*", + "optional": true + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/filter.js", + "line": 42, + "description": "

filter is similar to JavaScript's native filter method.\nfilterFn is eagerly called meaning that as soon as any promise\n resolves its value will be passed to filterFn. filter returns\n a promise that will become fulfilled with the result of running\n filterFn on the values the promises become fulfilled with.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n
 import { filter, resolve } from 'rsvp';\n\n let promise1 = resolve(1);\n let promise2 = resolve(2);\n let promise3 = resolve(3);\n\n let promises = [promise1, promise2, promise3];\n\n let filterFn = function(item){\n   return item > 1;\n };\n\n filter(promises, filterFn).then(function(result){\n   // result is [ 2, 3 ]\n });
\n
\n
\n \n

If any of the promises given to filter are rejected, the first promise\n that is rejected will be given as an argument to the returned promise's\n rejection handler. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
 import { filter, reject, resolve } from 'rsvp';\n\n let promise1 = resolve(1);\n let promise2 = reject(new Error('2'));\n let promise3 = reject(new Error('3'));\n let promises = [ promise1, promise2, promise3 ];\n\n let filterFn = function(item){\n   return item > 1;\n };\n\n filter(promises, filterFn).then(function(array){\n   // Code here never runs because there are rejected promises!\n }, function(reason) {\n   // reason.message === '2'\n });
\n
\n
\n \n

filter will also wait for any promises returned from filterFn.\n For instance, you may want to fetch a list of users then return a subset\n of those users based on some asynchronous operation:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n
 import { filter, resolve } from 'rsvp';\n\n let alice = { name: 'alice' };\n let bob   = { name: 'bob' };\n let users = [ alice, bob ];\n\n let promises = users.map(function(user){\n   return resolve(user);\n });\n\n let filterFn = function(user){\n   // Here, Alice has permissions to create a blog post, but Bob does not.\n   return getPrivilegesForUser(user).then(function(privs){\n     return privs.can_create_blog_post === true;\n   });\n };\n filter(promises, filterFn).then(function(users){\n   // true, because the server told us only Alice can create a blog post.\n   users.length === 1;\n   // false, because Alice is the only user present in `users`\n   users[0] === bob;\n });
\n
\n
\n \n", + "itemtype": "method", + "name": "filter", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "promises", + "description": "", + "type": "Array" + }, + { + "name": "filterFn", + "description": "- function to be called on each resolved value to\n filter the final results.", + "type": "Function" + }, + { + "name": "label", + "description": "optional string describing the promise. Useful for\n tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/hash-settled.js", + "line": 16, + "description": "

hashSettled is similar to allSettled, but takes an object\ninstead of an array for its promises argument.

\n

Unlike all or hash, which implement a fail-fast method,\nbut like allSettled, hashSettled waits until all the\nconstituent promises have returned and then shows you all the results\nwith their states and values/reasons. This is useful if you want to\nhandle multiple promises' failure states together as a set.

\n

Returns a promise that is fulfilled when all the given promises have been\nsettled, or rejected if the passed parameters are invalid.

\n

The returned promise is fulfilled with a hash that has the same key names as\nthe promises object argument. If any of the values in the object are not\npromises, they will be copied over to the fulfilled object and marked with state\n'fulfilled'.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { hashSettled, resolve } from 'rsvp';\n\nlet promises = {\n  myPromise: resolve(1),\n  yourPromise: resolve(2),\n  theirPromise: resolve(3),\n  notAPromise: 4\n};\n\nhashSettled(promises).then(function(hash){\n  // hash here is an object that looks like:\n  // {\n  //   myPromise: { state: 'fulfilled', value: 1 },\n  //   yourPromise: { state: 'fulfilled', value: 2 },\n  //   theirPromise: { state: 'fulfilled', value: 3 },\n  //   notAPromise: { state: 'fulfilled', value: 4 }\n  // }\n});
\n
\n
\n \n

If any of the promises given to hash are rejected, the state will\nbe set to 'rejected' and the reason for rejection provided.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
import { hashSettled, reject, resolve } from 'rsvp';\n\nlet promises = {\n  myPromise: resolve(1),\n  rejectedPromise: reject(new Error('rejection')),\n  anotherRejectedPromise: reject(new Error('more rejection')),\n};\n\nhashSettled(promises).then(function(hash){\n  // hash here is an object that looks like:\n  // {\n  //   myPromise:              { state: 'fulfilled', value: 1 },\n  //   rejectedPromise:        { state: 'rejected', reason: Error },\n  //   anotherRejectedPromise: { state: 'rejected', reason: Error },\n  // }\n  // Note that for rejectedPromise, reason.message == 'rejection',\n  // and for anotherRejectedPromise, reason.message == 'more rejection'.\n});
\n
\n
\n \n

An important note: hashSettled is intended for plain JavaScript objects that\nare just a set of keys and values. hashSettled will NOT preserve prototype\nchains.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n
import Promise, { hashSettled, resolve } from 'rsvp';\n\nfunction MyConstructor(){\n  this.example = resolve('Example');\n}\n\nMyConstructor.prototype = {\n  protoProperty: Promise.resolve('Proto Property')\n};\n\nlet myObject = new MyConstructor();\n\nhashSettled(myObject).then(function(hash){\n  // protoProperty will not be present, instead you will just have an\n  // object that looks like:\n  // {\n  //   example: { state: 'fulfilled', value: 'Example' }\n  // }\n  //\n  // hash.hasOwnProperty('protoProperty'); // false\n  // 'undefined' === typeof hash.protoProperty\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "hashSettled", + "access": "public", + "tagname": "", + "params": [ + { + "name": "object", + "description": "", + "type": "Object" + }, + { + "name": "label", + "description": "optional string that describes the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled when when all properties of `promises`\nhave been settled.", + "type": "Promise" + }, + "static": 1, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/hash.js", + "line": 4, + "description": "

hash is similar to all, but takes an object instead of an array\nfor its promises argument.

\n

Returns a promise that is fulfilled when all the given promises have been\nfulfilled, or rejected if any of them become rejected. The returned promise\nis fulfilled with a hash that has the same key names as the promises object\nargument. If any of the values in the object are not promises, they will\nsimply be copied over to the fulfilled object.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
let promises = {\n  myPromise: resolve(1),\n  yourPromise: resolve(2),\n  theirPromise: resolve(3),\n  notAPromise: 4\n};\n\nhash(promises).then(function(hash){\n  // hash here is an object that looks like:\n  // {\n  //   myPromise: 1,\n  //   yourPromise: 2,\n  //   theirPromise: 3,\n  //   notAPromise: 4\n  // }\n});
\n
\n
\n \n

If any of the promises given to hash are rejected, the first promise\nthat is rejected will be given as the reason to the rejection handler.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let promises = {\n  myPromise: resolve(1),\n  rejectedPromise: reject(new Error('rejectedPromise')),\n  anotherRejectedPromise: reject(new Error('anotherRejectedPromise')),\n};\n\nhash(promises).then(function(hash){\n  // Code here never runs because there are rejected promises!\n}, function(reason) {\n  // reason.message === 'rejectedPromise'\n});
\n
\n
\n \n

An important note: hash is intended for plain JavaScript objects that\nare just a set of keys and values. hash will NOT preserve prototype\nchains.

\n

Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n
import { hash, resolve } from 'rsvp';\nfunction MyConstructor(){\n  this.example = resolve('Example');\n}\n\nMyConstructor.prototype = {\n  protoProperty: resolve('Proto Property')\n};\n\nlet myObject = new MyConstructor();\n\nhash(myObject).then(function(hash){\n  // protoProperty will not be present, instead you will just have an\n  // object that looks like:\n  // {\n  //   example: 'Example'\n  // }\n  //\n  // hash.hasOwnProperty('protoProperty'); // false\n  // 'undefined' === typeof hash.protoProperty\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "hash", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "object", + "description": "", + "type": "Object" + }, + { + "name": "label", + "description": "optional string that describes the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled when all properties of `promises`\nhave been fulfilled, or rejected if any of them become rejected.", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/map.js", + "line": 39, + "description": "

map is similar to JavaScript's native map method. mapFn is eagerly called\n meaning that as soon as any promise resolves its value will be passed to mapFn.\n map returns a promise that will become fulfilled with the result of running\n mapFn on the values the promises become fulfilled with.

\n

For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
 import { map, resolve } from 'rsvp';\n\n let promise1 = resolve(1);\n let promise2 = resolve(2);\n let promise3 = resolve(3);\n let promises = [ promise1, promise2, promise3 ];\n\n let mapFn = function(item){\n   return item + 1;\n };\n\n map(promises, mapFn).then(function(result){\n   // result is [ 2, 3, 4 ]\n });
\n
\n
\n \n

If any of the promises given to map are rejected, the first promise\n that is rejected will be given as an argument to the returned promise's\n rejection handler. For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
 import { map, reject, resolve } from 'rsvp';\n\n let promise1 = resolve(1);\n let promise2 = reject(new Error('2'));\n let promise3 = reject(new Error('3'));\n let promises = [ promise1, promise2, promise3 ];\n\n let mapFn = function(item){\n   return item + 1;\n };\n\n map(promises, mapFn).then(function(array){\n   // Code here never runs because there are rejected promises!\n }, function(reason) {\n   // reason.message === '2'\n });
\n
\n
\n \n

map will also wait if a promise is returned from mapFn. For example,\n say you want to get all comments from a set of blog posts, but you need\n the blog posts first because they contain a url to those comments.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
 import { map } from 'rsvp';\n\n let mapFn = function(blogPost){\n   // getComments does some ajax and returns an Promise that is fulfilled\n   // with some comments data\n   return getComments(blogPost.comments_url);\n };\n\n // getBlogPosts does some ajax and returns an Promise that is fulfilled\n // with some blog post data\n map(getBlogPosts(), mapFn).then(function(comments){\n   // comments is the result of asking the server for the comments\n   // of all blog posts returned from getBlogPosts()\n });
\n
\n
\n \n", + "itemtype": "method", + "name": "map", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "promises", + "description": "", + "type": "Array" + }, + { + "name": "mapFn", + "description": "function to be called on each fulfilled promise.", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\n Useful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled with the result of calling\n `mapFn` on each fulfilled promise or value when they become fulfilled.\n The promise will be rejected if any of the given `promises` become rejected.", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/node.js", + "line": 44, + "description": "

denodeify takes a 'node-style' function and returns a function that\nwill return an Promise. You can use denodeify in Node.js or the\nbrowser when you'd prefer to use promises over using callbacks. For example,\ndenodeify transforms the following:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let fs = require('fs');\n\nfs.readFile('myfile.txt', function(err, data){\n  if (err) return handleError(err);\n  handleData(data);\n});
\n
\n
\n \n

into:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
let fs = require('fs');\nlet readFile = denodeify(fs.readFile);\n\nreadFile('myfile.txt').then(handleData, handleError);
\n
\n
\n \n

If the node function has multiple success parameters, then denodeify\njust returns the first one:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
let request = denodeify(require('request'));\n\nrequest('http://example.com').then(function(res) {\n  // ...\n});
\n
\n
\n \n

However, if you need all success parameters, setting denodeify's\nsecond parameter to true causes it to return all success parameters\nas an array:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let request = denodeify(require('request'), true);\n\nrequest('http://example.com').then(function(result) {\n  // result[0] -> res\n  // result[1] -> body\n});
\n
\n
\n \n

Or if you pass it an array with names it returns the parameters as a hash:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let request = denodeify(require('request'), ['res', 'body']);\n\nrequest('http://example.com').then(function(result) {\n  // result.res\n  // result.body\n});
\n
\n
\n \n

Sometimes you need to retain the this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
let app = require('express')();\nlet render = denodeify(app.render.bind(app));
\n
\n
\n \n

The denodified function inherits from the original function. It works in all\nenvironments, except IE 10 and below. Consequently all properties of the original\nfunction are available to you. However, any properties you change on the\ndenodeified function won't be changed on the original function. Example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n
let request = denodeify(require('request')),\n    cookieJar = request.jar(); // <- Inheritance is used here\n\nrequest('http://example.com', {jar: cookieJar}).then(function(res) {\n  // cookieJar.cookies holds now the cookies returned by example.com\n});
\n
\n
\n \n

Using denodeify makes it easier to compose asynchronous operations instead\nof using callbacks. For example, instead of:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n
let fs = require('fs');\n\nfs.readFile('myfile.txt', function(err, data){\n  if (err) { ... } // Handle error\n  fs.writeFile('myfile2.txt', data, function(err){\n    if (err) { ... } // Handle error\n    console.log('done')\n  });\n});
\n
\n
\n \n

you can chain the operations together using then from the returned promise:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
let fs = require('fs');\nlet readFile = denodeify(fs.readFile);\nlet writeFile = denodeify(fs.writeFile);\n\nreadFile('myfile.txt').then(function(data){\n  return writeFile('myfile2.txt', data);\n}).then(function(){\n  console.log('done')\n}).catch(function(error){\n  // Handle error\n});
\n
\n
\n \n", + "itemtype": "method", + "name": "denodeify", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "nodeFunc", + "description": "a 'node-style' function that takes a callback as\nits last argument. The callback expects an error to be passed as its first\nargument (if an error occurred, otherwise null), and the value from the\noperation as its second argument ('function(err, value){ }').", + "type": "Function" + }, + { + "name": "options", + "description": "An optional paramter that if set\nto `true` causes the promise to fulfill with the callback's success arguments\nas an array. This is useful if the node function has multiple success\nparamters. If you set this paramter to an array with names, the promise will\nfulfill with a hash with these names as keys and the success parameters as\nvalues.", + "type": "Boolean|Array", + "optional": true + } + ], + "return": { + "description": "a function that wraps `nodeFunc` to return a `Promise`", + "type": "Function" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/race.js", + "line": 3, + "description": "

This is a convenient alias for Promise.race.

\n", + "itemtype": "method", + "name": "race", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "array", + "description": "Array of promises.", + "type": "Array" + }, + { + "name": "label", + "description": "An optional label. This is useful\nfor tooling.", + "type": "String", + "optional": true + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/reject.js", + "line": 3, + "description": "

This is a convenient alias for Promise.reject.

\n", + "itemtype": "method", + "name": "reject", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "reason", + "description": "value that the returned promise will be rejected with.", + "type": "*" + }, + { + "name": "label", + "description": "optional string for identifying the returned promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise rejected with the given `reason`.", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/resolve.js", + "line": 3, + "description": "

This is a convenient alias for Promise.resolve.

\n", + "itemtype": "method", + "name": "resolve", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "value", + "description": "value that the returned promise will be resolved with", + "type": "*" + }, + { + "name": "label", + "description": "optional string for identifying the returned promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise that will become fulfilled with the given\n`value`", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/rethrow.js", + "line": 1, + "description": "

rethrow will rethrow an error on the next turn of the JavaScript event\nloop in order to aid debugging.

\n

Promises A+ specifies that any exceptions that occur with a promise must be\ncaught by the promises implementation and bubbled to the last handler. For\nthis reason, it is recommended that you always specify a second rejection\nhandler function to then. However, rethrow will throw the exception\noutside of the promise, so it bubbles up to your console if in the browser,\nor domain/cause uncaught exception in Node. rethrow will also throw the\nerror again so the error can be handled by the promise per the spec.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import { rethrow } from 'rsvp';\n\nfunction throws(){\n  throw new Error('Whoops!');\n}\n\nlet promise = new Promise(function(resolve, reject){\n  throws();\n});\n\npromise.catch(rethrow).then(function(){\n  // Code here doesn't run because the promise became rejected due to an\n  // error!\n}, function (err){\n  // handle the error here\n});
\n
\n
\n \n

The 'Whoops' error will be thrown on the next turn of the event loop\nand you can watch for it in your console. You can also handle it using a\nrejection handler given to .then or .catch on the returned promise.

\n", + "itemtype": "method", + "name": "rethrow", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "reason", + "description": "reason the promise became rejected.", + "type": "Error" + } + ], + "throws": { + "description": "Error" + }, + "class": "rsvp", + "module": "rsvp" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-rsvp", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/missings/Ember.Namespace.json b/json-docs/ember/5.3.0/missings/Ember.Namespace.json new file mode 100644 index 000000000..cd60de9f2 --- /dev/null +++ b/json-docs/ember/5.3.0/missings/Ember.Namespace.json @@ -0,0 +1,9 @@ +{ + "data": { + "id": "Ember.Namespace", + "type": "missing", + "attributes": { + "name": "Ember.Namespace" + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/application.json b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/application.json new file mode 100644 index 000000000..c393ecf71 --- /dev/null +++ b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/application.json @@ -0,0 +1,117 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/application", + "type": "module", + "attributes": { + "name": "@ember/application", + "submodules": {}, + "elements": {}, + "fors": { + "@ember/application": 1 + }, + "namespaces": { + "ApplicationInstance": 1 + }, + "tag": "module", + "file": "packages/@ember/application/instance.ts", + "line": 316, + "parent": null, + "publicclasses": [ + "Application", + "ApplicationInstance", + "ApplicationInstance.BootOptions" + ], + "privateclasses": [], + "staticfunctions": {}, + "allstaticfunctions": { + "Application": [ + { + "file": "packages/@ember/application/index.ts", + "line": 196, + "description": "This creates a registry with the default Ember naming conventions.\n\nIt also configures the registry:\n\n* registered views are created every time they are looked up (they are\n not singletons)\n* registered templates are not factories; the registered value is\n returned directly.\n* the router receives the application as its `namespace` property\n* all controllers receive the router as their `target` and `controllers`\n properties\n* all controllers receive the application as their `namespace` property\n* the application view receives the application controller as its\n `controller` property\n* the application view receives the application template as its\n `defaultTemplate` property", + "itemtype": "method", + "name": "buildRegistry", + "static": 1, + "params": [ + { + "name": "namespace", + "description": "the application for which to\n build the registry", + "type": "Application" + } + ], + "return": { + "description": "the built registry", + "type": "Ember.Registry" + }, + "access": "private", + "tagname": "", + "class": "Application", + "module": "@ember/application" + } + ], + "@ember/application": [ + { + "file": "packages/@ember/application/lib/lazy_load.ts", + "line": 14, + "description": "Detects when a specific package of Ember (e.g. 'Application')\nhas fully loaded and is available for extension.\n\nThe provided `callback` will be called with the `name` passed\nresolved from a string into the object:\n\n``` javascript\nimport { onLoad } from '@ember/application';\n\nonLoad('Ember.Application' function(hbars) {\n hbars.registerHelper(...);\n});\n```", + "itemtype": "method", + "name": "onLoad", + "static": 1, + "params": [ + { + "name": "name", + "description": "name of hook", + "type": "String" + }, + { + "name": "callback", + "description": "callback to be called", + "type": "Function" + } + ], + "access": "private", + "tagname": "", + "class": "@ember/application", + "module": "@ember/application" + }, + { + "file": "packages/@ember/application/lib/lazy_load.ts", + "line": 47, + "description": "Called when an Ember.js package (e.g Application) has finished\nloading. Triggers any callbacks registered for this event.", + "itemtype": "method", + "name": "runLoadHooks", + "static": 1, + "params": [ + { + "name": "name", + "description": "name of hook", + "type": "String" + }, + { + "name": "object", + "description": "object to pass to callbacks", + "type": "Object" + } + ], + "access": "private", + "tagname": "", + "class": "@ember/application", + "module": "@ember/application" + } + ] + }, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/application/namespace.json b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/application/namespace.json new file mode 100644 index 000000000..e04b9e4eb --- /dev/null +++ b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/application/namespace.json @@ -0,0 +1,35 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/application/namespace", + "type": "module", + "attributes": { + "name": "@ember/application/namespace", + "submodules": {}, + "elements": {}, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/application/namespace.ts", + "line": 20, + "parent": null, + "publicclasses": [ + "Namespace" + ], + "privateclasses": [], + "staticfunctions": {}, + "allstaticfunctions": {}, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/array.json b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/array.json new file mode 100644 index 000000000..da1d5a889 --- /dev/null +++ b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/array.json @@ -0,0 +1,145 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/array", + "type": "module", + "attributes": { + "name": "@ember/array", + "submodules": {}, + "elements": {}, + "fors": { + "@ember/array": 1 + }, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/array/index.ts", + "line": 1463, + "parent": null, + "publicclasses": [ + "EmberArray", + "MutableArray" + ], + "privateclasses": [], + "staticfunctions": { + "@ember/array": [ + { + "file": "packages/@ember/array/index.ts", + "line": 1859, + "description": "Creates an `Ember.NativeArray` from an Array-like object.\nDoes not modify the original object's contents. `A()` is not needed if\n`EmberENV.EXTEND_PROTOTYPES` is `true` (the default value). However,\nit is recommended that you use `A()` when creating addons for\nember or when you can not guarantee that `EmberENV.EXTEND_PROTOTYPES`\nwill be `true`.\n\nExample\n\n```app/components/my-component.js\nimport Component from '@ember/component';\nimport { A } from '@ember/array';\n\nexport default Component.extend({\n tagName: 'ul',\n classNames: ['pagination'],\n\n init() {\n this._super(...arguments);\n\n if (!this.get('content')) {\n this.set('content', A());\n this.set('otherContent', A([1,2,3]));\n }\n }\n});\n```", + "itemtype": "method", + "name": "A", + "static": 1, + "return": { + "description": "", + "type": "Ember.NativeArray" + }, + "access": "public", + "tagname": "", + "class": "@ember/array", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 140, + "description": "Returns true if the passed object is an array or Array-like.\n\nObjects are considered Array-like if any of the following are true:\n\n - the object is a native Array\n - the object has an objectAt property\n - the object is an Object, and has a length property\n\nUnlike `typeOf` this method returns true even if the passed object is\nnot formally an array but appears to be array-like (i.e. implements `Array`)\n\n```javascript\nimport { isArray } from '@ember/array';\nimport ArrayProxy from '@ember/array/proxy';\n\nisArray(); // false\nisArray([]); // true\nisArray(ArrayProxy.create({ content: [] })); // true\n```", + "itemtype": "method", + "name": "isArray", + "static": 1, + "params": [ + { + "name": "obj", + "description": "The object to test", + "type": "Object" + } + ], + "return": { + "description": "true if the passed object is an array or Array-like", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/array", + "module": "@ember/array" + } + ] + }, + "allstaticfunctions": { + "@ember/array": [ + { + "file": "packages/@ember/array/index.ts", + "line": 1859, + "description": "Creates an `Ember.NativeArray` from an Array-like object.\nDoes not modify the original object's contents. `A()` is not needed if\n`EmberENV.EXTEND_PROTOTYPES` is `true` (the default value). However,\nit is recommended that you use `A()` when creating addons for\nember or when you can not guarantee that `EmberENV.EXTEND_PROTOTYPES`\nwill be `true`.\n\nExample\n\n```app/components/my-component.js\nimport Component from '@ember/component';\nimport { A } from '@ember/array';\n\nexport default Component.extend({\n tagName: 'ul',\n classNames: ['pagination'],\n\n init() {\n this._super(...arguments);\n\n if (!this.get('content')) {\n this.set('content', A());\n this.set('otherContent', A([1,2,3]));\n }\n }\n});\n```", + "itemtype": "method", + "name": "A", + "static": 1, + "return": { + "description": "", + "type": "Ember.NativeArray" + }, + "access": "public", + "tagname": "", + "class": "@ember/array", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/index.ts", + "line": 140, + "description": "Returns true if the passed object is an array or Array-like.\n\nObjects are considered Array-like if any of the following are true:\n\n - the object is a native Array\n - the object has an objectAt property\n - the object is an Object, and has a length property\n\nUnlike `typeOf` this method returns true even if the passed object is\nnot formally an array but appears to be array-like (i.e. implements `Array`)\n\n```javascript\nimport { isArray } from '@ember/array';\nimport ArrayProxy from '@ember/array/proxy';\n\nisArray(); // false\nisArray([]); // true\nisArray(ArrayProxy.create({ content: [] })); // true\n```", + "itemtype": "method", + "name": "isArray", + "static": 1, + "params": [ + { + "name": "obj", + "description": "The object to test", + "type": "Object" + } + ], + "return": { + "description": "true if the passed object is an array or Array-like", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/array", + "module": "@ember/array" + }, + { + "file": "packages/@ember/array/lib/make-array.ts", + "line": 5, + "description": "Forces the passed object to be part of an array. If the object is already\nan array, it will return the object. Otherwise, it will add the object to\nan array. If object is `null` or `undefined`, it will return an empty array.\n\n```javascript\nimport { makeArray } from '@ember/array';\nimport ArrayProxy from '@ember/array/proxy';\n\nmakeArray(); // []\nmakeArray(null); // []\nmakeArray(undefined); // []\nmakeArray('lindsay'); // ['lindsay']\nmakeArray([1, 2, 42]); // [1, 2, 42]\n\nlet proxy = ArrayProxy.create({ content: [] });\n\nmakeArray(proxy) === proxy; // false\n```", + "itemtype": "method", + "name": "makeArray", + "static": 1, + "params": [ + { + "name": "obj", + "description": "the object", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Array" + }, + "access": "private", + "tagname": "", + "class": "@ember/array", + "module": "@ember/array" + } + ] + }, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/array/proxy.json b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/array/proxy.json new file mode 100644 index 000000000..8290c1b36 --- /dev/null +++ b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/array/proxy.json @@ -0,0 +1,35 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/array/proxy", + "type": "module", + "attributes": { + "name": "@ember/array/proxy", + "submodules": {}, + "elements": {}, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/array/proxy.ts", + "line": 59, + "parent": null, + "publicclasses": [ + "ArrayProxy" + ], + "privateclasses": [], + "staticfunctions": {}, + "allstaticfunctions": {}, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/canary-features.json b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/canary-features.json new file mode 100644 index 000000000..99b9e8fa8 --- /dev/null +++ b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/canary-features.json @@ -0,0 +1,36 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/canary-features", + "type": "module", + "attributes": { + "name": "@ember/canary-features", + "submodules": {}, + "elements": {}, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/canary-features/index.ts", + "line": 18, + "description": "

Set EmberENV.FEATURES in your application's config/environment.js file\nto enable canary features in your application.

\n

See the feature flag guide\nfor more details.

\n", + "access": "public", + "tagname": "", + "parent": null, + "publicclasses": [], + "privateclasses": [], + "staticfunctions": {}, + "allstaticfunctions": {}, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/component.json b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/component.json new file mode 100644 index 000000000..0453717e8 --- /dev/null +++ b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/component.json @@ -0,0 +1,89 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/component", + "type": "module", + "attributes": { + "name": "@ember/component", + "submodules": {}, + "elements": {}, + "fors": { + "Ember.Templates.helpers": 1, + "@ember/component": 1, + "Ember.Templates.components": 1, + "@ember/component/helper": 1 + }, + "namespaces": {}, + "tag": "main", + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 53, + "description": "

Glimmer is a templating engine used by Ember.js that is compatible with a subset of the Handlebars syntax.

\n

Showing a property

\n

Templates manage the flow of an application's UI, and display state (through\nthe DOM) to a user. For example, given a component with the property "name",\nthat component's template can use the name in several ways:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.js
1\n2\n3\n4\n5\n
import Component from '@ember/component';\n\nexport default Component.extend({\n  name: 'Jill'\n});
\n
\n
\n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n3\n
{{this.name}}\n<div>{{this.name}}</div>\n<span data-name={{this.name}}></span>
\n
\n
\n \n

Any time the "name" property on the component changes, the DOM will be\nupdated.

\n

Properties can be chained as well:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n
{{@aUserModel.name}}\n<div>{{@listOfUsers.firstObject.name}}</div>
\n
\n
\n \n

Using Ember helpers

\n

When content is passed in mustaches {{}}, Ember will first try to find a helper\nor component with that name. For example, the if helper:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
{{if this.name "I have a name" "I have no name"}}\n<span data-has-name={{if this.name true}}></span>
\n
\n
\n \n

The returned value is placed where the {{}} is called. The above style is\ncalled "inline". A second style of helper usage is called "block". For example:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
{{#if this.name}}\n  I have a name\n{{else}}\n  I have no name\n{{/if}}
\n
\n
\n \n

The block form of helpers allows you to control how the UI is created based\non the values of properties.\nA third form of helper is called "nested". For example here the concat\nhelper will add " Doe" to a displayed name if the person has no last name:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<span data-name={{concat this.firstName (\n  if this.lastName (concat " " this.lastName) "Doe"\n)}}></span>
\n
\n
\n \n

Ember's built-in helpers are described under the Ember.Templates.helpers\nnamespace. Documentation on creating custom helpers can be found under\nhelper (or\nunder Helper if a helper requires access to\ndependency injection).

\n

Invoking a Component

\n

Ember components represent state to the UI of an application. Further\nreading on components can be found under Component.

\n", + "itemtype": "main", + "parent": null, + "publicclasses": [ + "Component", + "Helper" + ], + "privateclasses": [], + "staticfunctions": { + "@ember/component/helper": [ + { + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 333, + "description": "In many cases it is not necessary to use the full `Helper` class.\nThe `helper` method create pure-function helpers without instances.\nFor example:\n\n```app/helpers/format-currency.js\nimport { helper } from '@ember/component/helper';\n\nexport default helper(function([cents], {currency}) {\n return `${currency}${cents * 0.01}`;\n});\n```", + "static": 1, + "params": [ + { + "name": "helper", + "description": "The helper function", + "type": "Function" + } + ], + "itemtype": "method", + "name": "helper", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "@ember/component/helper", + "module": "@ember/component" + } + ] + }, + "allstaticfunctions": { + "@ember/component/helper": [ + { + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 333, + "description": "In many cases it is not necessary to use the full `Helper` class.\nThe `helper` method create pure-function helpers without instances.\nFor example:\n\n```app/helpers/format-currency.js\nimport { helper } from '@ember/component/helper';\n\nexport default helper(function([cents], {currency}) {\n return `${currency}${cents * 0.01}`;\n});\n```", + "static": 1, + "params": [ + { + "name": "helper", + "description": "The helper function", + "type": "Function" + } + ], + "itemtype": "method", + "name": "helper", + "access": "public", + "tagname": "", + "since": "1.13.0", + "class": "@ember/component/helper", + "module": "@ember/component" + } + ] + }, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/component/template-only.json b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/component/template-only.json new file mode 100644 index 000000000..f496495ad --- /dev/null +++ b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/component/template-only.json @@ -0,0 +1,93 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/component/template-only", + "type": "module", + "attributes": { + "name": "@ember/component/template-only", + "submodules": {}, + "elements": {}, + "fors": { + "@ember/component/template-only": 1 + }, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/component/template-only.ts", + "line": 1, + "access": "public", + "tagname": "", + "parent": null, + "publicclasses": [], + "privateclasses": [], + "staticfunctions": { + "@ember/component/template-only": [ + { + "file": "packages/@ember/component/template-only.ts", + "line": 6, + "description": "This utility function is used to declare a given component has no backing class. When the rendering engine detects this it\nis able to perform a number of optimizations. Templates that are associated with `templateOnly()` will be rendered _as is_\nwithout adding a wrapping `
` (or any of the other element customization behaviors of [@ember/component](/ember/release/classes/Component)).\nSpecifically, this means that the template will be rendered as \"outer HTML\".\n\nIn general, this method will be used by build time tooling and would not be directly written in an application. However,\nat times it may be useful to use directly to leverage the \"outer HTML\" semantics mentioned above. For example, if an addon would like\nto use these semantics for its templates but cannot be certain it will only be consumed by applications that have enabled the\n`template-only-glimmer-components` optional feature.", + "example": [ + "\n\n```js\nimport templateOnly from '@ember/component/template-only';\n\nexport default templateOnly();\n```" + ], + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "templateOnly", + "params": [ + { + "name": "moduleName", + "description": "the module name that the template only component represents, this will be used for debugging purposes", + "type": "String" + } + ], + "category": [ + "EMBER_GLIMMER_SET_COMPONENT_TEMPLATE" + ], + "class": "@ember/component/template-only", + "module": "@ember/component/template-only" + } + ] + }, + "allstaticfunctions": { + "@ember/component/template-only": [ + { + "file": "packages/@ember/component/template-only.ts", + "line": 6, + "description": "This utility function is used to declare a given component has no backing class. When the rendering engine detects this it\nis able to perform a number of optimizations. Templates that are associated with `templateOnly()` will be rendered _as is_\nwithout adding a wrapping `
` (or any of the other element customization behaviors of [@ember/component](/ember/release/classes/Component)).\nSpecifically, this means that the template will be rendered as \"outer HTML\".\n\nIn general, this method will be used by build time tooling and would not be directly written in an application. However,\nat times it may be useful to use directly to leverage the \"outer HTML\" semantics mentioned above. For example, if an addon would like\nto use these semantics for its templates but cannot be certain it will only be consumed by applications that have enabled the\n`template-only-glimmer-components` optional feature.", + "example": [ + "\n\n```js\nimport templateOnly from '@ember/component/template-only';\n\nexport default templateOnly();\n```" + ], + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "templateOnly", + "params": [ + { + "name": "moduleName", + "description": "the module name that the template only component represents, this will be used for debugging purposes", + "type": "String" + } + ], + "category": [ + "EMBER_GLIMMER_SET_COMPONENT_TEMPLATE" + ], + "class": "@ember/component/template-only", + "module": "@ember/component/template-only" + } + ] + }, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/controller.json b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/controller.json new file mode 100644 index 000000000..6e757b7a2 --- /dev/null +++ b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/controller.json @@ -0,0 +1,96 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/controller", + "type": "module", + "attributes": { + "name": "@ember/controller", + "submodules": {}, + "elements": {}, + "fors": { + "Ember.ControllerMixin": 1, + "@ember/controller": 1 + }, + "namespaces": { + "Ember": 1 + }, + "tag": "module", + "file": "packages/@ember/controller/index.ts", + "line": 308, + "parent": null, + "publicclasses": [ + "Ember.Controller" + ], + "privateclasses": [ + "Ember.ControllerMixin" + ], + "staticfunctions": { + "Ember.@ember/controller": [ + { + "file": "packages/@ember/controller/index.ts", + "line": 317, + "description": "Creates a property that lazily looks up another controller in the container.\nCan only be used when defining another controller.\n\nExample:\n\n```app/controllers/post.js\nimport Controller, {\n inject as controller\n} from '@ember/controller';\n\nexport default class PostController extends Controller {\n @controller posts;\n}\n```\n\nClassic Class Example:\n\n```app/controllers/post.js\nimport Controller, {\n inject as controller\n} from '@ember/controller';\n\nexport default Controller.extend({\n posts: controller()\n});\n```\n\nThis example will create a `posts` property on the `post` controller that\nlooks up the `posts` controller in the container, making it easy to reference\nother controllers.", + "itemtype": "method", + "name": "inject", + "static": 1, + "since": "1.10.0", + "params": [ + { + "name": "name", + "description": "(optional) name of the controller to inject, defaults to\n the property's name", + "type": "String" + } + ], + "return": { + "description": "injection decorator instance", + "type": "ComputedDecorator" + }, + "access": "public", + "tagname": "", + "class": "Ember.@ember/controller", + "module": "@ember/controller" + } + ] + }, + "allstaticfunctions": { + "Ember.@ember/controller": [ + { + "file": "packages/@ember/controller/index.ts", + "line": 317, + "description": "Creates a property that lazily looks up another controller in the container.\nCan only be used when defining another controller.\n\nExample:\n\n```app/controllers/post.js\nimport Controller, {\n inject as controller\n} from '@ember/controller';\n\nexport default class PostController extends Controller {\n @controller posts;\n}\n```\n\nClassic Class Example:\n\n```app/controllers/post.js\nimport Controller, {\n inject as controller\n} from '@ember/controller';\n\nexport default Controller.extend({\n posts: controller()\n});\n```\n\nThis example will create a `posts` property on the `post` controller that\nlooks up the `posts` controller in the container, making it easy to reference\nother controllers.", + "itemtype": "method", + "name": "inject", + "static": 1, + "since": "1.10.0", + "params": [ + { + "name": "name", + "description": "(optional) name of the controller to inject, defaults to\n the property's name", + "type": "String" + } + ], + "return": { + "description": "injection decorator instance", + "type": "ComputedDecorator" + }, + "access": "public", + "tagname": "", + "class": "Ember.@ember/controller", + "module": "@ember/controller" + } + ] + }, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/debug.json b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/debug.json new file mode 100644 index 000000000..18dce8a0a --- /dev/null +++ b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/debug.json @@ -0,0 +1,505 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/debug", + "type": "module", + "attributes": { + "name": "@ember/debug", + "submodules": {}, + "elements": {}, + "fors": { + "@ember/debug": 1 + }, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/debug/index.ts", + "line": 134, + "access": "public", + "tagname": "", + "parent": null, + "publicclasses": [], + "privateclasses": [], + "staticfunctions": { + "@ember/debug": [ + { + "file": "packages/@ember/debug/index.ts", + "line": 139, + "description": "Verify that a certain expectation is met, or throw a exception otherwise.\n\nThis is useful for communicating assumptions in the code to other human\nreaders as well as catching bugs that accidentally violates these\nexpectations.\n\nAssertions are removed from production builds, so they can be freely added\nfor documentation and debugging purposes without worries of incuring any\nperformance penalty. However, because of that, they should not be used for\nchecks that could reasonably fail during normal usage. Furthermore, care\nshould be taken to avoid accidentally relying on side-effects produced from\nevaluating the condition itself, since the code will not run in production.\n\n```javascript\nimport { assert } from '@ember/debug';\n\n// Test for truthiness\nassert('Must pass a string', typeof str === 'string');\n\n// Fail unconditionally\nassert('This code path should never be run');\n```", + "itemtype": "method", + "name": "assert", + "static": 1, + "params": [ + { + "name": "description", + "description": "Describes the expectation. This will become the\n text of the Error thrown if the assertion fails.", + "type": "String" + }, + { + "name": "condition", + "description": "Must be truthy for the assertion to pass. If\n falsy, an exception will be thrown.", + "type": "Any" + } + ], + "access": "public", + "tagname": "", + "since": "1.0.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/index.ts", + "line": 184, + "description": "Display a debug notice.\n\nCalls to this function are not invoked in production builds.\n\n```javascript\nimport { debug } from '@ember/debug';\n\ndebug('I\\'m a debug notice!');\n```", + "itemtype": "method", + "name": "debug", + "static": 1, + "params": [ + { + "name": "message", + "description": "A debug message to display.", + "type": "String" + } + ], + "access": "public", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/lib/deprecate.ts", + "line": 185, + "description": "Display a deprecation warning with the provided message and a stack trace\n(Chrome and Firefox only).\n\nEmber itself leverages [Semantic Versioning](https://semver.org) to aid\nprojects in keeping up with changes to the framework. Before any\nfunctionality or API is removed, it first flows linearly through a\ndeprecation staging process. The staging process currently contains two\nstages: available and enabled.\n\nDeprecations are initially released into the 'available' stage.\nDeprecations will stay in this stage until the replacement API has been\nmarked as a recommended practice via the RFC process and the addon\necosystem has generally adopted the change.\n\nOnce a deprecation meets the above criteria, it will move into the\n'enabled' stage where it will remain until the functionality or API is\neventually removed.\n\nFor application and addon developers, \"available\" deprecations are not\nurgent and \"enabled\" deprecations require action.\n\n* In a production build, this method is defined as an empty function (NOP).\nUses of this method in Ember itself are stripped from the ember.prod.js build.\n\n```javascript\nimport { deprecate } from '@ember/debug';\n\ndeprecate(\n 'Use of `assign` has been deprecated. Please use `Object.assign` or the spread operator instead.',\n false,\n {\n id: 'ember-polyfills.deprecate-assign',\n until: '5.0.0',\n url: 'https://deprecations.emberjs.com/v4.x/#toc_ember-polyfills-deprecate-assign',\n for: 'ember-source',\n since: {\n available: '4.0.0',\n enabled: '4.0.0',\n },\n }\n);\n```", + "itemtype": "method", + "name": "deprecate", + "params": [ + { + "name": "message", + "description": "A description of the deprecation.", + "type": "String" + }, + { + "name": "test", + "description": "A boolean. If falsy, the deprecation will be displayed.", + "type": "Boolean" + }, + { + "name": "options", + "description": "", + "type": "Object", + "props": [ + { + "name": "id", + "description": "A unique id for this deprecation. The id can be\n used by Ember debugging tools to change the behavior (raise, log or silence)\n for that specific deprecation. The id should be namespaced by dots, e.g.\n \"view.helper.select\".", + "type": "String" + }, + { + "name": "until", + "description": "The version of Ember when this deprecation\n warning will be removed.", + "type": "String" + }, + { + "name": "for", + "description": "A namespace for the deprecation, usually the package name", + "type": "String" + }, + { + "name": "since", + "description": "Describes when the deprecation became available and enabled.", + "type": "Object" + }, + { + "name": "url", + "description": "An optional url to the transition guide on the\n emberjs.com website.", + "type": "String", + "optional": true + } + ] + } + ], + "static": 1, + "access": "public", + "tagname": "", + "since": "1.0.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/lib/deprecate.ts", + "line": 39, + "description": "Allows for runtime registration of handler functions that override the default deprecation behavior.\nDeprecations are invoked by calls to [@ember/debug/deprecate](/ember/release/classes/@ember%2Fdebug/methods/deprecate?anchor=deprecate).\nThe following example demonstrates its usage by registering a handler that throws an error if the\nmessage contains the word \"should\", otherwise defers to the default handler.\n\n```javascript\nimport { registerDeprecationHandler } from '@ember/debug';\n\nregisterDeprecationHandler((message, options, next) => {\n if (message.indexOf('should') !== -1) {\n throw new Error(`Deprecation message with should: ${message}`);\n } else {\n // defer to whatever handler was registered before this one\n next(message, options);\n }\n});\n```\n\nThe handler function takes the following arguments:\n\n
    \n
  • message - The message received from the deprecation call.
  • \n
  • options - An object passed in with the deprecation call containing additional information including:
  • \n
      \n
    • id - An id of the deprecation in the form of package-name.specific-deprecation.
    • \n
    • until - The Ember version number the feature and deprecation will be removed in.
    • \n
    \n
  • next - A function that calls into the previously registered handler.
  • \n
", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "registerDeprecationHandler", + "params": [ + { + "name": "handler", + "description": "A function to handle deprecation calls.", + "type": "Function" + } + ], + "since": "2.1.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/lib/warn.ts", + "line": 29, + "description": "Allows for runtime registration of handler functions that override the default warning behavior.\nWarnings are invoked by calls made to [@ember/debug/warn](/ember/release/classes/@ember%2Fdebug/methods/warn?anchor=warn).\nThe following example demonstrates its usage by registering a handler that does nothing overriding Ember's\ndefault warning behavior.\n\n```javascript\nimport { registerWarnHandler } from '@ember/debug';\n\n// next is not called, so no warnings get the default behavior\nregisterWarnHandler(() => {});\n```\n\nThe handler function takes the following arguments:\n\n
    \n
  • message - The message received from the warn call.
  • \n
  • options - An object passed in with the warn call containing additional information including:
  • \n
      \n
    • id - An id of the warning in the form of package-name.specific-warning.
    • \n
    \n
  • next - A function that calls into the previously registered handler.
  • \n
", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "registerWarnHandler", + "params": [ + { + "name": "handler", + "description": "A function to handle warnings.", + "type": "Function" + } + ], + "since": "2.1.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/index.ts", + "line": 269, + "description": "Run a function meant for debugging.\n\nCalls to this function are removed from production builds, so they can be\nfreely added for documentation and debugging purposes without worries of\nincuring any performance penalty.\n\n```javascript\nimport Component from '@ember/component';\nimport { runInDebug } from '@ember/debug';\n\nrunInDebug(() => {\n Component.reopen({\n didInsertElement() {\n console.log(\"I'm happy\");\n }\n });\n});\n```", + "itemtype": "method", + "name": "runInDebug", + "static": 1, + "params": [ + { + "name": "func", + "description": "The function to be executed.", + "type": "Function" + } + ], + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/lib/warn.ts", + "line": 76, + "description": "Display a warning with the provided message.\n\n* In a production build, this method is defined as an empty function (NOP).\nUses of this method in Ember itself are stripped from the ember.prod.js build.\n\n```javascript\nimport { warn } from '@ember/debug';\nimport tomsterCount from './tomster-counter'; // a module in my project\n\n// Log a warning if we have more than 3 tomsters\nwarn('Too many tomsters!', tomsterCount <= 3, {\n id: 'ember-debug.too-many-tomsters'\n});\n```", + "itemtype": "method", + "name": "warn", + "static": 1, + "params": [ + { + "name": "message", + "description": "A warning to display.", + "type": "String" + }, + { + "name": "test", + "description": "An optional boolean. If falsy, the warning\n will be displayed.", + "type": "Boolean" + }, + { + "name": "options", + "description": "An object that can be used to pass a unique\n `id` for this warning. The `id` can be used by Ember debugging tools\n to change the behavior (raise, log, or silence) for that specific warning.\n The `id` should be namespaced by dots, e.g. \"ember-debug.feature-flag-with-features-stripped\"", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "since": "1.0.0", + "class": "@ember/debug", + "module": "@ember/debug" + } + ] + }, + "allstaticfunctions": { + "@ember/debug": [ + { + "file": "packages/@ember/debug/index.ts", + "line": 139, + "description": "Verify that a certain expectation is met, or throw a exception otherwise.\n\nThis is useful for communicating assumptions in the code to other human\nreaders as well as catching bugs that accidentally violates these\nexpectations.\n\nAssertions are removed from production builds, so they can be freely added\nfor documentation and debugging purposes without worries of incuring any\nperformance penalty. However, because of that, they should not be used for\nchecks that could reasonably fail during normal usage. Furthermore, care\nshould be taken to avoid accidentally relying on side-effects produced from\nevaluating the condition itself, since the code will not run in production.\n\n```javascript\nimport { assert } from '@ember/debug';\n\n// Test for truthiness\nassert('Must pass a string', typeof str === 'string');\n\n// Fail unconditionally\nassert('This code path should never be run');\n```", + "itemtype": "method", + "name": "assert", + "static": 1, + "params": [ + { + "name": "description", + "description": "Describes the expectation. This will become the\n text of the Error thrown if the assertion fails.", + "type": "String" + }, + { + "name": "condition", + "description": "Must be truthy for the assertion to pass. If\n falsy, an exception will be thrown.", + "type": "Any" + } + ], + "access": "public", + "tagname": "", + "since": "1.0.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/lib/capture-render-tree.ts", + "line": 9, + "description": "Ember Inspector calls this function to capture the current render tree.\n\nIn production mode, this requires turning on `ENV._DEBUG_RENDER_TREE`\nbefore loading Ember.", + "access": "private", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "captureRenderTree", + "params": [ + { + "name": "app", + "description": "An `ApplicationInstance`.", + "type": "ApplicationInstance" + } + ], + "since": "3.14.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/index.ts", + "line": 184, + "description": "Display a debug notice.\n\nCalls to this function are not invoked in production builds.\n\n```javascript\nimport { debug } from '@ember/debug';\n\ndebug('I\\'m a debug notice!');\n```", + "itemtype": "method", + "name": "debug", + "static": 1, + "params": [ + { + "name": "message", + "description": "A debug message to display.", + "type": "String" + } + ], + "access": "public", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/lib/deprecate.ts", + "line": 185, + "description": "Display a deprecation warning with the provided message and a stack trace\n(Chrome and Firefox only).\n\nEmber itself leverages [Semantic Versioning](https://semver.org) to aid\nprojects in keeping up with changes to the framework. Before any\nfunctionality or API is removed, it first flows linearly through a\ndeprecation staging process. The staging process currently contains two\nstages: available and enabled.\n\nDeprecations are initially released into the 'available' stage.\nDeprecations will stay in this stage until the replacement API has been\nmarked as a recommended practice via the RFC process and the addon\necosystem has generally adopted the change.\n\nOnce a deprecation meets the above criteria, it will move into the\n'enabled' stage where it will remain until the functionality or API is\neventually removed.\n\nFor application and addon developers, \"available\" deprecations are not\nurgent and \"enabled\" deprecations require action.\n\n* In a production build, this method is defined as an empty function (NOP).\nUses of this method in Ember itself are stripped from the ember.prod.js build.\n\n```javascript\nimport { deprecate } from '@ember/debug';\n\ndeprecate(\n 'Use of `assign` has been deprecated. Please use `Object.assign` or the spread operator instead.',\n false,\n {\n id: 'ember-polyfills.deprecate-assign',\n until: '5.0.0',\n url: 'https://deprecations.emberjs.com/v4.x/#toc_ember-polyfills-deprecate-assign',\n for: 'ember-source',\n since: {\n available: '4.0.0',\n enabled: '4.0.0',\n },\n }\n);\n```", + "itemtype": "method", + "name": "deprecate", + "params": [ + { + "name": "message", + "description": "A description of the deprecation.", + "type": "String" + }, + { + "name": "test", + "description": "A boolean. If falsy, the deprecation will be displayed.", + "type": "Boolean" + }, + { + "name": "options", + "description": "", + "type": "Object", + "props": [ + { + "name": "id", + "description": "A unique id for this deprecation. The id can be\n used by Ember debugging tools to change the behavior (raise, log or silence)\n for that specific deprecation. The id should be namespaced by dots, e.g.\n \"view.helper.select\".", + "type": "String" + }, + { + "name": "until", + "description": "The version of Ember when this deprecation\n warning will be removed.", + "type": "String" + }, + { + "name": "for", + "description": "A namespace for the deprecation, usually the package name", + "type": "String" + }, + { + "name": "since", + "description": "Describes when the deprecation became available and enabled.", + "type": "Object" + }, + { + "name": "url", + "description": "An optional url to the transition guide on the\n emberjs.com website.", + "type": "String", + "optional": true + } + ] + } + ], + "static": 1, + "access": "public", + "tagname": "", + "since": "1.0.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/index.ts", + "line": 224, + "description": "Alias an old, deprecated method with its new counterpart.\n\nDisplay a deprecation warning with the provided message and a stack trace\n(Chrome and Firefox only) when the assigned method is called.\n\nCalls to this function are removed from production builds, so they can be\nfreely added for documentation and debugging purposes without worries of\nincuring any performance penalty.\n\n```javascript\nimport { deprecateFunc } from '@ember/debug';\n\nEmber.oldMethod = deprecateFunc('Please use the new, updated method', options, Ember.newMethod);\n```", + "itemtype": "method", + "name": "deprecateFunc", + "static": 1, + "params": [ + { + "name": "message", + "description": "A description of the deprecation.", + "type": "String" + }, + { + "name": "options", + "description": "The options object for `deprecate`.", + "type": "Object", + "optional": true + }, + { + "name": "func", + "description": "The new function called to replace its deprecated counterpart.", + "type": "Function" + } + ], + "return": { + "description": "A new function that wraps the original function with a deprecation warning", + "type": "Function" + }, + "access": "private", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/lib/inspect.ts", + "line": 15, + "description": "Convenience method to inspect an object. This method will attempt to\nconvert the object into a useful string description.\n\nIt is a pretty simple implementation. If you want something more robust,\nuse something like JSDump: https://github.com/NV/jsDump", + "itemtype": "method", + "name": "inspect", + "static": 1, + "params": [ + { + "name": "obj", + "description": "The object you want to inspect.", + "type": "Object" + } + ], + "return": { + "description": "A description of the object", + "type": "String" + }, + "since": "1.4.0", + "access": "private", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/lib/deprecate.ts", + "line": 39, + "description": "Allows for runtime registration of handler functions that override the default deprecation behavior.\nDeprecations are invoked by calls to [@ember/debug/deprecate](/ember/release/classes/@ember%2Fdebug/methods/deprecate?anchor=deprecate).\nThe following example demonstrates its usage by registering a handler that throws an error if the\nmessage contains the word \"should\", otherwise defers to the default handler.\n\n```javascript\nimport { registerDeprecationHandler } from '@ember/debug';\n\nregisterDeprecationHandler((message, options, next) => {\n if (message.indexOf('should') !== -1) {\n throw new Error(`Deprecation message with should: ${message}`);\n } else {\n // defer to whatever handler was registered before this one\n next(message, options);\n }\n});\n```\n\nThe handler function takes the following arguments:\n\n
    \n
  • message - The message received from the deprecation call.
  • \n
  • options - An object passed in with the deprecation call containing additional information including:
  • \n
      \n
    • id - An id of the deprecation in the form of package-name.specific-deprecation.
    • \n
    • until - The Ember version number the feature and deprecation will be removed in.
    • \n
    \n
  • next - A function that calls into the previously registered handler.
  • \n
", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "registerDeprecationHandler", + "params": [ + { + "name": "handler", + "description": "A function to handle deprecation calls.", + "type": "Function" + } + ], + "since": "2.1.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/lib/warn.ts", + "line": 29, + "description": "Allows for runtime registration of handler functions that override the default warning behavior.\nWarnings are invoked by calls made to [@ember/debug/warn](/ember/release/classes/@ember%2Fdebug/methods/warn?anchor=warn).\nThe following example demonstrates its usage by registering a handler that does nothing overriding Ember's\ndefault warning behavior.\n\n```javascript\nimport { registerWarnHandler } from '@ember/debug';\n\n// next is not called, so no warnings get the default behavior\nregisterWarnHandler(() => {});\n```\n\nThe handler function takes the following arguments:\n\n
    \n
  • message - The message received from the warn call.
  • \n
  • options - An object passed in with the warn call containing additional information including:
  • \n
      \n
    • id - An id of the warning in the form of package-name.specific-warning.
    • \n
    \n
  • next - A function that calls into the previously registered handler.
  • \n
", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "registerWarnHandler", + "params": [ + { + "name": "handler", + "description": "A function to handle warnings.", + "type": "Function" + } + ], + "since": "2.1.0", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/index.ts", + "line": 269, + "description": "Run a function meant for debugging.\n\nCalls to this function are removed from production builds, so they can be\nfreely added for documentation and debugging purposes without worries of\nincuring any performance penalty.\n\n```javascript\nimport Component from '@ember/component';\nimport { runInDebug } from '@ember/debug';\n\nrunInDebug(() => {\n Component.reopen({\n didInsertElement() {\n console.log(\"I'm happy\");\n }\n });\n});\n```", + "itemtype": "method", + "name": "runInDebug", + "static": 1, + "params": [ + { + "name": "func", + "description": "The function to be executed.", + "type": "Function" + } + ], + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/debug" + }, + { + "file": "packages/@ember/debug/lib/warn.ts", + "line": 76, + "description": "Display a warning with the provided message.\n\n* In a production build, this method is defined as an empty function (NOP).\nUses of this method in Ember itself are stripped from the ember.prod.js build.\n\n```javascript\nimport { warn } from '@ember/debug';\nimport tomsterCount from './tomster-counter'; // a module in my project\n\n// Log a warning if we have more than 3 tomsters\nwarn('Too many tomsters!', tomsterCount <= 3, {\n id: 'ember-debug.too-many-tomsters'\n});\n```", + "itemtype": "method", + "name": "warn", + "static": 1, + "params": [ + { + "name": "message", + "description": "A warning to display.", + "type": "String" + }, + { + "name": "test", + "description": "An optional boolean. If falsy, the warning\n will be displayed.", + "type": "Boolean" + }, + { + "name": "options", + "description": "An object that can be used to pass a unique\n `id` for this warning. The `id` can be used by Ember debugging tools\n to change the behavior (raise, log, or silence) for that specific warning.\n The `id` should be namespaced by dots, e.g. \"ember-debug.feature-flag-with-features-stripped\"", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "since": "1.0.0", + "class": "@ember/debug", + "module": "@ember/debug" + } + ] + }, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/debug/container-debug-adapter.json b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/debug/container-debug-adapter.json new file mode 100644 index 000000000..21460ccec --- /dev/null +++ b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/debug/container-debug-adapter.json @@ -0,0 +1,35 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/debug/container-debug-adapter", + "type": "module", + "attributes": { + "name": "@ember/debug/container-debug-adapter", + "submodules": {}, + "elements": {}, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/debug/container-debug-adapter.ts", + "line": 13, + "parent": null, + "publicclasses": [ + "ContainerDebugAdapter" + ], + "privateclasses": [], + "staticfunctions": {}, + "allstaticfunctions": {}, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/debug/data-adapter.json b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/debug/data-adapter.json new file mode 100644 index 000000000..0ca409a79 --- /dev/null +++ b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/debug/data-adapter.json @@ -0,0 +1,35 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/debug/data-adapter", + "type": "module", + "attributes": { + "name": "@ember/debug/data-adapter", + "submodules": {}, + "elements": {}, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/debug/data-adapter.ts", + "line": 178, + "parent": null, + "publicclasses": [ + "DataAdapter" + ], + "privateclasses": [], + "staticfunctions": {}, + "allstaticfunctions": {}, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/destroyable.json b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/destroyable.json new file mode 100644 index 000000000..e279b2def --- /dev/null +++ b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/destroyable.json @@ -0,0 +1,374 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/destroyable", + "type": "module", + "attributes": { + "name": "@ember/destroyable", + "submodules": {}, + "elements": {}, + "fors": { + "@ember/destroyable": 1 + }, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/destroyable/index.ts", + "line": 15, + "description": "

Ember manages the lifecycles and lifetimes of many built in constructs, such\nas components, and does so in a hierarchical way - when a parent component is\ndestroyed, all of its children are destroyed as well.

\n

This destroyables API exposes the basic building blocks for destruction:

\n
    \n
  • registering a function to be ran when an object is destroyed
  • \n
  • checking if an object is in a destroying state
  • \n
  • associate an object as a child of another so that the child object will be destroyed\nwhen the associated parent object is destroyed.
  • \n
\n", + "access": "public", + "tagname": "", + "parent": null, + "publicclasses": [], + "privateclasses": [], + "staticfunctions": { + "@ember/destroyable": [ + { + "file": "packages/@ember/destroyable/index.ts", + "line": 138, + "description": "This function asserts that all objects which have associated destructors or associated children\nhave been destroyed at the time it is called. It is meant to be a low level hook that testing\nframeworks can use to hook into and validate that all destroyables have in fact been destroyed.\n\nThis function requires that `enableDestroyableTracking` was called previously, and is only\navailable in non-production builds.", + "itemtype": "method", + "name": "assertDestroyablesDestroyed", + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 31, + "description": "This function is used to associate a destroyable object with a parent. When the parent\nis destroyed, all registered children will also be destroyed.\n\n```js\nclass CustomSelect extends Component {\n constructor(...args) {\n super(...args);\n\n // obj is now a child of the component. When the component is destroyed,\n // obj will also be destroyed, and have all of its destructors triggered.\n this.obj = associateDestroyableChild(this, {});\n }\n}\n```\n\nReturns the associated child for convenience.", + "itemtype": "method", + "name": "associateDestroyableChild", + "params": [ + { + "name": "parent", + "description": "the destroyable to entangle the child destroyables lifetime with", + "type": "Object|Function" + }, + { + "name": "child", + "description": "the destroyable to be entangled with the parents lifetime", + "type": "Object|Function" + } + ], + "return": { + "description": "the child argument", + "type": "Object|Function" + }, + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 103, + "description": "Initiates the destruction of a destroyable object. It runs all associated destructors, and then\ndestroys all children recursively.\n\n```js\nlet obj = {};\n\nregisterDestructor(obj, () => console.log('destroyed!'));\n\ndestroy(obj); // this will schedule the destructor to be called\n\n// ...some time later, during scheduled destruction\n\n// destroyed!\n```\n\nDestruction via `destroy()` follows these steps:\n\n1, Mark the destroyable such that `isDestroying(destroyable)` returns `true`\n2, Call `destroy()` on each of the destroyable's associated children\n3, Schedule calling the destroyable's destructors\n4, Schedule setting destroyable such that `isDestroyed(destroyable)` returns `true`\n\nThis results in the entire tree of destroyables being first marked as destroying,\nthen having all of their destructors called, and finally all being marked as isDestroyed.\nThere won't be any in between states where some items are marked as `isDestroying` while\ndestroying, while others are not.", + "itemtype": "method", + "name": "destroy", + "params": [ + { + "name": "destroyable", + "description": "the object to destroy", + "type": "Object|Function" + } + ], + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 152, + "description": "This function instructs the destroyable system to keep track of all destroyables (their\nchildren, destructors, etc). This enables a future usage of `assertDestroyablesDestroyed`\nto be used to ensure that all destroyable tasks (registered destructors and associated children)\nhave completed when `assertDestroyablesDestroyed` is called.", + "itemtype": "method", + "name": "enableDestroyableTracking", + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 80, + "description": "Receives a destroyable, and returns true if the destroyable has finished destroying. Otherwise\nreturns false.\n\n```js\nlet obj = {};\n\nisDestroyed(obj); // false\ndestroy(obj);\n\n// ...sometime later, after scheduled destruction\n\nisDestroyed(obj); // true\n```", + "itemtype": "method", + "name": "isDestroyed", + "params": [ + { + "name": "destroyable", + "description": "the object to check", + "type": "Object|Function" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 58, + "description": "Receives a destroyable, and returns true if the destroyable has begun destroying. Otherwise returns\nfalse.\n\n ```js\n let obj = {};\n isDestroying(obj); // false\n destroy(obj);\n isDestroying(obj); // true\n // ...sometime later, after scheduled destruction\n isDestroyed(obj); // true\n isDestroying(obj); // true\n ```", + "itemtype": "method", + "name": "isDestroying", + "params": [ + { + "name": "destroyable", + "description": "the object to check", + "type": "Object|Function" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 164, + "description": "Receives a destroyable object and a destructor function, and associates the\nfunction with it. When the destroyable is destroyed with destroy, or when its\nparent is destroyed, the destructor function will be called.\n\n```js\nimport Component from '@glimmer/component';\nimport { registerDestructor } from '@ember/destroyable';\n\nclass Modal extends Component {\n @service resize;\n\n constructor(...args) {\n super(...args);\n\n this.resize.register(this, this.layout);\n\n registerDestructor(this, () => this.resize.unregister(this));\n }\n}\n```\n\nMultiple destructors can be associated with a given destroyable, and they can be\nassociated over time, allowing libraries to dynamically add destructors as needed.\n`registerDestructor` also returns the associated destructor function, for convenience.\n\nThe destructor function is passed a single argument, which is the destroyable itself.\nThis allows the function to be reused multiple times for many destroyables, rather\nthan creating a closure function per destroyable.\n\n```js\nimport Component from '@glimmer/component';\nimport { registerDestructor } from '@ember/destroyable';\n\nfunction unregisterResize(instance) {\n instance.resize.unregister(instance);\n}\n\nclass Modal extends Component {\n @service resize;\n\n constructor(...args) {\n super(...args);\n\n this.resize.register(this, this.layout);\n\n registerDestructor(this, unregisterResize);\n }\n}\n```", + "itemtype": "method", + "name": "registerDestructor", + "params": [ + { + "name": "destroyable", + "description": "the destroyable to register the destructor function with", + "type": "Object|Function" + }, + { + "name": "destructor", + "description": "the destructor to run when the destroyable object is destroyed", + "type": "Function" + } + ], + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 229, + "description": "Receives a destroyable and a destructor function, and de-associates the destructor\nfrom the destroyable.\n\n```js\nimport Component from '@glimmer/component';\nimport { registerDestructor, unregisterDestructor } from '@ember/destroyable';\n\nclass Modal extends Component {\n @service modals;\n\n constructor(...args) {\n super(...args);\n\n this.modals.add(this);\n\n this.modalDestructor = registerDestructor(this, () => this.modals.remove(this));\n }\n\n @action pinModal() {\n unregisterDestructor(this, this.modalDestructor);\n }\n}\n```", + "itemtype": "method", + "name": "unregisterDestructor", + "params": [ + { + "name": "destroyable", + "description": "the destroyable to unregister the destructor function from", + "type": "Object|Function" + }, + { + "name": "destructor", + "description": "the destructor to remove from the destroyable", + "type": "Function" + } + ], + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + } + ] + }, + "allstaticfunctions": { + "@ember/destroyable": [ + { + "file": "packages/@ember/destroyable/index.ts", + "line": 138, + "description": "This function asserts that all objects which have associated destructors or associated children\nhave been destroyed at the time it is called. It is meant to be a low level hook that testing\nframeworks can use to hook into and validate that all destroyables have in fact been destroyed.\n\nThis function requires that `enableDestroyableTracking` was called previously, and is only\navailable in non-production builds.", + "itemtype": "method", + "name": "assertDestroyablesDestroyed", + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 31, + "description": "This function is used to associate a destroyable object with a parent. When the parent\nis destroyed, all registered children will also be destroyed.\n\n```js\nclass CustomSelect extends Component {\n constructor(...args) {\n super(...args);\n\n // obj is now a child of the component. When the component is destroyed,\n // obj will also be destroyed, and have all of its destructors triggered.\n this.obj = associateDestroyableChild(this, {});\n }\n}\n```\n\nReturns the associated child for convenience.", + "itemtype": "method", + "name": "associateDestroyableChild", + "params": [ + { + "name": "parent", + "description": "the destroyable to entangle the child destroyables lifetime with", + "type": "Object|Function" + }, + { + "name": "child", + "description": "the destroyable to be entangled with the parents lifetime", + "type": "Object|Function" + } + ], + "return": { + "description": "the child argument", + "type": "Object|Function" + }, + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 103, + "description": "Initiates the destruction of a destroyable object. It runs all associated destructors, and then\ndestroys all children recursively.\n\n```js\nlet obj = {};\n\nregisterDestructor(obj, () => console.log('destroyed!'));\n\ndestroy(obj); // this will schedule the destructor to be called\n\n// ...some time later, during scheduled destruction\n\n// destroyed!\n```\n\nDestruction via `destroy()` follows these steps:\n\n1, Mark the destroyable such that `isDestroying(destroyable)` returns `true`\n2, Call `destroy()` on each of the destroyable's associated children\n3, Schedule calling the destroyable's destructors\n4, Schedule setting destroyable such that `isDestroyed(destroyable)` returns `true`\n\nThis results in the entire tree of destroyables being first marked as destroying,\nthen having all of their destructors called, and finally all being marked as isDestroyed.\nThere won't be any in between states where some items are marked as `isDestroying` while\ndestroying, while others are not.", + "itemtype": "method", + "name": "destroy", + "params": [ + { + "name": "destroyable", + "description": "the object to destroy", + "type": "Object|Function" + } + ], + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 152, + "description": "This function instructs the destroyable system to keep track of all destroyables (their\nchildren, destructors, etc). This enables a future usage of `assertDestroyablesDestroyed`\nto be used to ensure that all destroyable tasks (registered destructors and associated children)\nhave completed when `assertDestroyablesDestroyed` is called.", + "itemtype": "method", + "name": "enableDestroyableTracking", + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 80, + "description": "Receives a destroyable, and returns true if the destroyable has finished destroying. Otherwise\nreturns false.\n\n```js\nlet obj = {};\n\nisDestroyed(obj); // false\ndestroy(obj);\n\n// ...sometime later, after scheduled destruction\n\nisDestroyed(obj); // true\n```", + "itemtype": "method", + "name": "isDestroyed", + "params": [ + { + "name": "destroyable", + "description": "the object to check", + "type": "Object|Function" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 58, + "description": "Receives a destroyable, and returns true if the destroyable has begun destroying. Otherwise returns\nfalse.\n\n ```js\n let obj = {};\n isDestroying(obj); // false\n destroy(obj);\n isDestroying(obj); // true\n // ...sometime later, after scheduled destruction\n isDestroyed(obj); // true\n isDestroying(obj); // true\n ```", + "itemtype": "method", + "name": "isDestroying", + "params": [ + { + "name": "destroyable", + "description": "the object to check", + "type": "Object|Function" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 164, + "description": "Receives a destroyable object and a destructor function, and associates the\nfunction with it. When the destroyable is destroyed with destroy, or when its\nparent is destroyed, the destructor function will be called.\n\n```js\nimport Component from '@glimmer/component';\nimport { registerDestructor } from '@ember/destroyable';\n\nclass Modal extends Component {\n @service resize;\n\n constructor(...args) {\n super(...args);\n\n this.resize.register(this, this.layout);\n\n registerDestructor(this, () => this.resize.unregister(this));\n }\n}\n```\n\nMultiple destructors can be associated with a given destroyable, and they can be\nassociated over time, allowing libraries to dynamically add destructors as needed.\n`registerDestructor` also returns the associated destructor function, for convenience.\n\nThe destructor function is passed a single argument, which is the destroyable itself.\nThis allows the function to be reused multiple times for many destroyables, rather\nthan creating a closure function per destroyable.\n\n```js\nimport Component from '@glimmer/component';\nimport { registerDestructor } from '@ember/destroyable';\n\nfunction unregisterResize(instance) {\n instance.resize.unregister(instance);\n}\n\nclass Modal extends Component {\n @service resize;\n\n constructor(...args) {\n super(...args);\n\n this.resize.register(this, this.layout);\n\n registerDestructor(this, unregisterResize);\n }\n}\n```", + "itemtype": "method", + "name": "registerDestructor", + "params": [ + { + "name": "destroyable", + "description": "the destroyable to register the destructor function with", + "type": "Object|Function" + }, + { + "name": "destructor", + "description": "the destructor to run when the destroyable object is destroyed", + "type": "Function" + } + ], + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + }, + { + "file": "packages/@ember/destroyable/index.ts", + "line": 229, + "description": "Receives a destroyable and a destructor function, and de-associates the destructor\nfrom the destroyable.\n\n```js\nimport Component from '@glimmer/component';\nimport { registerDestructor, unregisterDestructor } from '@ember/destroyable';\n\nclass Modal extends Component {\n @service modals;\n\n constructor(...args) {\n super(...args);\n\n this.modals.add(this);\n\n this.modalDestructor = registerDestructor(this, () => this.modals.remove(this));\n }\n\n @action pinModal() {\n unregisterDestructor(this, this.modalDestructor);\n }\n}\n```", + "itemtype": "method", + "name": "unregisterDestructor", + "params": [ + { + "name": "destroyable", + "description": "the destroyable to unregister the destructor function from", + "type": "Object|Function" + }, + { + "name": "destructor", + "description": "the destructor to remove from the destroyable", + "type": "Function" + } + ], + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/destroyable", + "module": "@ember/destroyable" + } + ] + }, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/engine.json b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/engine.json new file mode 100644 index 000000000..afb03a4e7 --- /dev/null +++ b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/engine.json @@ -0,0 +1,89 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/engine", + "type": "module", + "attributes": { + "name": "@ember/engine", + "submodules": {}, + "elements": {}, + "fors": { + "@ember/engine": 1 + }, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/engine/instance.ts", + "line": 36, + "parent": null, + "publicclasses": [ + "Engine", + "EngineInstance" + ], + "privateclasses": [], + "staticfunctions": {}, + "allstaticfunctions": { + "Engine": [ + { + "file": "packages/@ember/engine/index.ts", + "line": 285, + "description": "This creates a registry with the default Ember naming conventions.\n\nIt also configures the registry:\n\n* registered views are created every time they are looked up (they are\n not singletons)\n* registered templates are not factories; the registered value is\n returned directly.\n* the router receives the application as its `namespace` property\n* all controllers receive the router as their `target` and `controllers`\n properties\n* all controllers receive the application as their `namespace` property\n* the application view receives the application controller as its\n `controller` property\n* the application view receives the application template as its\n `defaultTemplate` property", + "itemtype": "method", + "name": "buildRegistry", + "static": 1, + "params": [ + { + "name": "namespace", + "description": "the application for which to\n build the registry", + "type": "Application" + } + ], + "return": { + "description": "the built registry", + "type": "Ember.Registry" + }, + "access": "private", + "tagname": "", + "class": "Engine", + "module": "@ember/engine" + } + ], + "@ember/engine": [ + { + "file": "packages/@ember/engine/lib/engine-parent.ts", + "line": 8, + "description": "`getEngineParent` retrieves an engine instance's parent instance.", + "itemtype": "method", + "name": "getEngineParent", + "params": [ + { + "name": "engine", + "description": "An engine instance.", + "type": "EngineInstance" + } + ], + "return": { + "description": "The parent engine instance.", + "type": "EngineInstance" + }, + "static": 1, + "access": "private", + "tagname": "", + "class": "@ember/engine", + "module": "@ember/engine" + } + ] + }, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/enumerable.json b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/enumerable.json new file mode 100644 index 000000000..f0423eee9 --- /dev/null +++ b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/enumerable.json @@ -0,0 +1,37 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/enumerable", + "type": "module", + "attributes": { + "name": "@ember/enumerable", + "submodules": {}, + "elements": {}, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/enumerable/index.ts", + "line": 8, + "access": "private", + "tagname": "", + "parent": null, + "publicclasses": [], + "privateclasses": [ + "Enumerable" + ], + "staticfunctions": {}, + "allstaticfunctions": {}, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/helper.json b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/helper.json new file mode 100644 index 000000000..1d1066e59 --- /dev/null +++ b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/helper.json @@ -0,0 +1,215 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/helper", + "type": "module", + "attributes": { + "name": "@ember/helper", + "submodules": {}, + "elements": {}, + "fors": { + "@ember/helper": 1 + }, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/helper/index.ts", + "line": 1, + "parent": null, + "publicclasses": [], + "privateclasses": [], + "staticfunctions": { + "@ember/helper": [ + { + "file": "packages/@ember/helper/index.ts", + "line": 17, + "description": "`capabilities` returns a capabilities configuration which can be used to modify\nthe behavior of the manager. Manager capabilities _must_ be provided using the\n`capabilities` function, as the underlying implementation can change over time.\n\nThe first argument to capabilities is a version string, which is the version of\nEmber that the capabilities were defined in. Ember can add new versions at any\ntime, and these may have entirely different behaviors, but it will not remove\nold versions until the next major version.\n\n```js\ncapabilities('3.23');\n```\n\nThe second argument is an object of capabilities and boolean values indicating\nwhether they are enabled or disabled.\n\n```js\ncapabilities('3.23', {\n hasValue: true,\n hasDestructor: true,\n});\n```\n\nIf no value is specified, then the default value will be used.\n\n### `3.23` capabilities\n\n#### `hasDestroyable`\n\n- Default value: false\n\nDetermines if the helper has a destroyable to include in the destructor\nhierarchy. If enabled, the `getDestroyable` hook will be called, and its result\nwill be associated with the destroyable parent block.\n\n#### `hasValue`\n\n- Default value: false\n\nDetermines if the helper has a value which can be used externally. The helper's\n`getValue` hook will be run whenever the value of the helper is accessed if this\ncapability is enabled.", + "itemtype": "method", + "name": "capabilities", + "static": 1, + "params": [ + { + "name": "managerApiVersion", + "description": "The version of capabilities that are being used", + "type": "String" + }, + { + "name": "options", + "description": "The capabilities values" + } + ], + "return": { + "description": "The capabilities object instance", + "type": "Capabilities" + }, + "access": "public", + "tagname": "", + "class": "@ember/helper", + "module": "@ember/helper" + }, + { + "file": "packages/@ember/helper/index.ts", + "line": 265, + "description": "The `invokeHelper` function can be used to create a helper instance in\nJavaScript.\n\nTo access a helper's value you have to use `getValue` from\n`@glimmer/tracking/primitives/cache`.\n\n```js\n// app/components/data-loader.js\nimport Component from '@glimmer/component';\nimport { getValue } from '@glimmer/tracking/primitives/cache';\nimport Helper from '@ember/component/helper';\nimport { invokeHelper } from '@ember/helper';\n\nclass PlusOne extends Helper {\n compute([number]) {\n return number + 1;\n }\n}\n\nexport default class PlusOneComponent extends Component {\n plusOne = invokeHelper(this, PlusOne, () => {\n return {\n positional: [this.args.number],\n };\n });\n\n get value() {\n return getValue(this.plusOne);\n }\n}\n```\n```js\n{{this.value}}\n```\n\nIt receives three arguments:\n\n* `context`: The parent context of the helper. When the parent is torn down and\n removed, the helper will be as well.\n* `definition`: The definition of the helper.\n* `computeArgs`: An optional function that produces the arguments to the helper.\n The function receives the parent context as an argument, and must return an\n object with a `positional` property that is an array and/or a `named`\n property that is an object.\n\nAnd it returns a Cache instance that contains the most recent value of the\nhelper. You can access the helper using `getValue()` like any other cache. The\ncache is also destroyable, and using the `destroy()` function on it will cause\nthe helper to be torn down.\n\nNote that using `getValue()` on helpers that have scheduled effects will not\ntrigger the effect early. Effects will continue to run at their scheduled time.", + "itemtype": "method", + "name": "invokeHelper", + "static": 1, + "params": [ + { + "name": "context", + "description": "The parent context of the helper", + "type": "Object" + }, + { + "name": "definition", + "description": "The helper definition", + "type": "Object" + }, + { + "name": "computeArgs", + "description": "An optional function that produces args", + "type": "Function" + } + ], + "return": { + "description": "" + }, + "access": "public", + "tagname": "", + "class": "@ember/helper", + "module": "@ember/helper" + }, + { + "file": "packages/@ember/helper/index.ts", + "line": 71, + "description": "Sets the helper manager for an object or function.\n\n```js\nsetHelperManager((owner) => new ClassHelperManager(owner), Helper)\n```\n\nWhen a value is used as a helper in a template, the helper manager is looked up\non the object by walking up its prototype chain and finding the first helper\nmanager. This manager then receives the value and can create and manage an\ninstance of a helper from it. This provides a layer of indirection that allows\nusers to design high-level helper APIs, without Ember needing to worry about the\ndetails. High-level APIs can be experimented with and iterated on while the\ncore of Ember helpers remains stable, and new APIs can be introduced gradually\nover time to existing code bases.\n\n`setHelperManager` receives two arguments:\n\n1. A factory function, which receives the `owner` and returns an instance of a\n helper manager.\n2. A helper definition, which is the object or function to associate the factory function with.\n\nThe first time the object is looked up, the factory function will be called to\ncreate the helper manager. It will be cached, and in subsequent lookups the\ncached helper manager will be used instead.\n\nOnly one helper manager is guaranteed to exist per `owner` and per usage of\n`setHelperManager`, so many helpers will end up using the same instance of the\nhelper manager. As such, you should only store state that is related to the\nmanager itself. If you want to store state specific to a particular helper\ndefinition, you should assign a unique helper manager to that helper. In\ngeneral, most managers should either be stateless, or only have the `owner` they\nwere created with as state.\n\nHelper managers must fulfill the following interface (This example uses\n[TypeScript interfaces](https://www.typescriptlang.org/docs/handbook/interfaces.html)\nfor precision, you do not need to write helper managers using TypeScript):\n\n```ts\ninterface HelperManager {\n capabilities: HelperCapabilities;\n\n createHelper(definition: HelperDefinition, args: TemplateArgs): HelperStateBucket;\n\n getValue?(bucket: HelperStateBucket): unknown;\n\n runEffect?(bucket: HelperStateBucket): void;\n\n getDestroyable?(bucket: HelperStateBucket): object;\n}\n```\n\nThe capabilities property _must_ be provided using the `capabilities()` function\nimported from the same module as `setHelperManager`:\n\n```js\nimport { capabilities } from '@ember/helper';\n\nclass MyHelperManager {\n capabilities = capabilities('3.21.0', { hasValue: true });\n\n // ...snip...\n}\n```\n\nBelow is a description of each of the methods on the interface and their\nfunctions.\n\n#### `createHelper`\n\n`createHelper` is a required hook on the HelperManager interface. The hook is\npassed the definition of the helper that is currently being created, and is\nexpected to return a _state bucket_. This state bucket is what represents the\ncurrent state of the helper, and will be passed to the other lifecycle hooks at\nappropriate times. It is not necessarily related to the definition of the\nhelper itself - for instance, you could return an object _containing_ an\ninstance of the helper:\n\n```js\nclass MyManager {\n createHelper(Definition, args) {\n return {\n instance: new Definition(args);\n };\n }\n}\n```\n\nThis allows the manager to store metadata that it doesn't want to expose to the\nuser.\n\nThis hook is _not_ autotracked - changes to tracked values used within this hook\nwill _not_ result in a call to any of the other lifecycle hooks. This is because\nit is unclear what should happen if it invalidates, and rather than make a\ndecision at this point, the initial API is aiming to allow as much expressivity\nas possible. This could change in the future with changes to capabilities and\ntheir behaviors.\n\nIf users do want to autotrack some values used during construction, they can\neither create the instance of the helper in `runEffect` or `getValue`, or they\ncan use the `cache` API to autotrack the `createHelper` hook themselves. This\nprovides maximum flexibility and expressiveness to manager authors.\n\nThis hook has the following timing semantics:\n\n**Always**\n- called as discovered during DOM construction\n- called in definition order in the template\n\n#### `getValue`\n\n`getValue` is an optional hook that should return the value of the helper. This\nis the value that is returned from the helper and passed into the template.\n\nThis hook is called when the value is requested from the helper (e.g. when the\ntemplate is rendering and the helper value is needed). The hook is autotracked,\nand will rerun whenever any tracked values used inside of it are updated.\nOtherwise it does not rerun.\n\n> Note: This means that arguments which are not _consumed_ within the hook will\n> not trigger updates.\n\nThis hook is only called for helpers with the `hasValue` capability enabled.\nThis hook has the following timing semantics:\n\n**Always**\n- called the first time the helper value is requested\n- called after autotracked state has changed\n\n**Never**\n- called if the `hasValue` capability is disabled\n\n#### `runEffect`\n\n`runEffect` is an optional hook that should run the effect that the helper is\napplying, setting it up or updating it.\n\nThis hook is scheduled to be called some time after render and prior to paint.\nThere is not a guaranteed, 1-to-1 relationship between a render pass and this\nhook firing. For instance, multiple render passes could occur, and the hook may\nonly trigger once. It may also never trigger if it was dirtied in one render\npass and then destroyed in the next.\n\nThe hook is autotracked, and will rerun whenever any tracked values used inside\nof it are updated. Otherwise it does not rerun.\n\nThe hook is also run during a time period where state mutations are _disabled_\nin Ember. Any tracked state mutation will throw an error during this time,\nincluding changes to tracked properties, changes made using `Ember.set`, updates\nto computed properties, etc. This is meant to prevent infinite rerenders and\nother antipatterns.\n\nThis hook is only called for helpers with the `hasScheduledEffect` capability\nenabled. This hook is also not called in SSR currently, though this could be\nadded as a capability in the future. It has the following timing semantics:\n\n**Always**\n- called after the helper was first created, if the helper has not been\n destroyed since creation\n- called after autotracked state has changed, if the helper has not been\n destroyed during render\n\n**Never**\n- called if the `hasScheduledEffect` capability is disabled\n- called in SSR\n\n#### `getDestroyable`\n\n`getDestroyable` is an optional hook that users can use to register a\ndestroyable object for the helper. This destroyable will be registered to the\ncontaining block or template parent, and will be destroyed when it is destroyed.\nSee the [Destroyables RFC](https://github.com/emberjs/rfcs/blob/master/text/0580-destroyables.md)\nfor more details.\n\n`getDestroyable` is only called if the `hasDestroyable` capability is enabled.\n\nThis hook has the following timing semantics:\n\n**Always**\n- called immediately after the `createHelper` hook is called\n\n**Never**\n- called if the `hasDestroyable` capability is disabled", + "itemtype": "method", + "name": "setHelperManager", + "static": 1, + "params": [ + { + "name": "factory", + "description": "A factory function which receives an optional owner, and returns a helper manager", + "type": "Function" + }, + { + "name": "definition", + "description": "The definition to associate the manager factory with", + "type": "Object" + } + ], + "return": { + "description": "The definition passed into setHelperManager", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/helper", + "module": "@ember/helper" + } + ] + }, + "allstaticfunctions": { + "@ember/helper": [ + { + "file": "packages/@ember/helper/index.ts", + "line": 17, + "description": "`capabilities` returns a capabilities configuration which can be used to modify\nthe behavior of the manager. Manager capabilities _must_ be provided using the\n`capabilities` function, as the underlying implementation can change over time.\n\nThe first argument to capabilities is a version string, which is the version of\nEmber that the capabilities were defined in. Ember can add new versions at any\ntime, and these may have entirely different behaviors, but it will not remove\nold versions until the next major version.\n\n```js\ncapabilities('3.23');\n```\n\nThe second argument is an object of capabilities and boolean values indicating\nwhether they are enabled or disabled.\n\n```js\ncapabilities('3.23', {\n hasValue: true,\n hasDestructor: true,\n});\n```\n\nIf no value is specified, then the default value will be used.\n\n### `3.23` capabilities\n\n#### `hasDestroyable`\n\n- Default value: false\n\nDetermines if the helper has a destroyable to include in the destructor\nhierarchy. If enabled, the `getDestroyable` hook will be called, and its result\nwill be associated with the destroyable parent block.\n\n#### `hasValue`\n\n- Default value: false\n\nDetermines if the helper has a value which can be used externally. The helper's\n`getValue` hook will be run whenever the value of the helper is accessed if this\ncapability is enabled.", + "itemtype": "method", + "name": "capabilities", + "static": 1, + "params": [ + { + "name": "managerApiVersion", + "description": "The version of capabilities that are being used", + "type": "String" + }, + { + "name": "options", + "description": "The capabilities values" + } + ], + "return": { + "description": "The capabilities object instance", + "type": "Capabilities" + }, + "access": "public", + "tagname": "", + "class": "@ember/helper", + "module": "@ember/helper" + }, + { + "file": "packages/@ember/helper/index.ts", + "line": 265, + "description": "The `invokeHelper` function can be used to create a helper instance in\nJavaScript.\n\nTo access a helper's value you have to use `getValue` from\n`@glimmer/tracking/primitives/cache`.\n\n```js\n// app/components/data-loader.js\nimport Component from '@glimmer/component';\nimport { getValue } from '@glimmer/tracking/primitives/cache';\nimport Helper from '@ember/component/helper';\nimport { invokeHelper } from '@ember/helper';\n\nclass PlusOne extends Helper {\n compute([number]) {\n return number + 1;\n }\n}\n\nexport default class PlusOneComponent extends Component {\n plusOne = invokeHelper(this, PlusOne, () => {\n return {\n positional: [this.args.number],\n };\n });\n\n get value() {\n return getValue(this.plusOne);\n }\n}\n```\n```js\n{{this.value}}\n```\n\nIt receives three arguments:\n\n* `context`: The parent context of the helper. When the parent is torn down and\n removed, the helper will be as well.\n* `definition`: The definition of the helper.\n* `computeArgs`: An optional function that produces the arguments to the helper.\n The function receives the parent context as an argument, and must return an\n object with a `positional` property that is an array and/or a `named`\n property that is an object.\n\nAnd it returns a Cache instance that contains the most recent value of the\nhelper. You can access the helper using `getValue()` like any other cache. The\ncache is also destroyable, and using the `destroy()` function on it will cause\nthe helper to be torn down.\n\nNote that using `getValue()` on helpers that have scheduled effects will not\ntrigger the effect early. Effects will continue to run at their scheduled time.", + "itemtype": "method", + "name": "invokeHelper", + "static": 1, + "params": [ + { + "name": "context", + "description": "The parent context of the helper", + "type": "Object" + }, + { + "name": "definition", + "description": "The helper definition", + "type": "Object" + }, + { + "name": "computeArgs", + "description": "An optional function that produces args", + "type": "Function" + } + ], + "return": { + "description": "" + }, + "access": "public", + "tagname": "", + "class": "@ember/helper", + "module": "@ember/helper" + }, + { + "file": "packages/@ember/helper/index.ts", + "line": 71, + "description": "Sets the helper manager for an object or function.\n\n```js\nsetHelperManager((owner) => new ClassHelperManager(owner), Helper)\n```\n\nWhen a value is used as a helper in a template, the helper manager is looked up\non the object by walking up its prototype chain and finding the first helper\nmanager. This manager then receives the value and can create and manage an\ninstance of a helper from it. This provides a layer of indirection that allows\nusers to design high-level helper APIs, without Ember needing to worry about the\ndetails. High-level APIs can be experimented with and iterated on while the\ncore of Ember helpers remains stable, and new APIs can be introduced gradually\nover time to existing code bases.\n\n`setHelperManager` receives two arguments:\n\n1. A factory function, which receives the `owner` and returns an instance of a\n helper manager.\n2. A helper definition, which is the object or function to associate the factory function with.\n\nThe first time the object is looked up, the factory function will be called to\ncreate the helper manager. It will be cached, and in subsequent lookups the\ncached helper manager will be used instead.\n\nOnly one helper manager is guaranteed to exist per `owner` and per usage of\n`setHelperManager`, so many helpers will end up using the same instance of the\nhelper manager. As such, you should only store state that is related to the\nmanager itself. If you want to store state specific to a particular helper\ndefinition, you should assign a unique helper manager to that helper. In\ngeneral, most managers should either be stateless, or only have the `owner` they\nwere created with as state.\n\nHelper managers must fulfill the following interface (This example uses\n[TypeScript interfaces](https://www.typescriptlang.org/docs/handbook/interfaces.html)\nfor precision, you do not need to write helper managers using TypeScript):\n\n```ts\ninterface HelperManager {\n capabilities: HelperCapabilities;\n\n createHelper(definition: HelperDefinition, args: TemplateArgs): HelperStateBucket;\n\n getValue?(bucket: HelperStateBucket): unknown;\n\n runEffect?(bucket: HelperStateBucket): void;\n\n getDestroyable?(bucket: HelperStateBucket): object;\n}\n```\n\nThe capabilities property _must_ be provided using the `capabilities()` function\nimported from the same module as `setHelperManager`:\n\n```js\nimport { capabilities } from '@ember/helper';\n\nclass MyHelperManager {\n capabilities = capabilities('3.21.0', { hasValue: true });\n\n // ...snip...\n}\n```\n\nBelow is a description of each of the methods on the interface and their\nfunctions.\n\n#### `createHelper`\n\n`createHelper` is a required hook on the HelperManager interface. The hook is\npassed the definition of the helper that is currently being created, and is\nexpected to return a _state bucket_. This state bucket is what represents the\ncurrent state of the helper, and will be passed to the other lifecycle hooks at\nappropriate times. It is not necessarily related to the definition of the\nhelper itself - for instance, you could return an object _containing_ an\ninstance of the helper:\n\n```js\nclass MyManager {\n createHelper(Definition, args) {\n return {\n instance: new Definition(args);\n };\n }\n}\n```\n\nThis allows the manager to store metadata that it doesn't want to expose to the\nuser.\n\nThis hook is _not_ autotracked - changes to tracked values used within this hook\nwill _not_ result in a call to any of the other lifecycle hooks. This is because\nit is unclear what should happen if it invalidates, and rather than make a\ndecision at this point, the initial API is aiming to allow as much expressivity\nas possible. This could change in the future with changes to capabilities and\ntheir behaviors.\n\nIf users do want to autotrack some values used during construction, they can\neither create the instance of the helper in `runEffect` or `getValue`, or they\ncan use the `cache` API to autotrack the `createHelper` hook themselves. This\nprovides maximum flexibility and expressiveness to manager authors.\n\nThis hook has the following timing semantics:\n\n**Always**\n- called as discovered during DOM construction\n- called in definition order in the template\n\n#### `getValue`\n\n`getValue` is an optional hook that should return the value of the helper. This\nis the value that is returned from the helper and passed into the template.\n\nThis hook is called when the value is requested from the helper (e.g. when the\ntemplate is rendering and the helper value is needed). The hook is autotracked,\nand will rerun whenever any tracked values used inside of it are updated.\nOtherwise it does not rerun.\n\n> Note: This means that arguments which are not _consumed_ within the hook will\n> not trigger updates.\n\nThis hook is only called for helpers with the `hasValue` capability enabled.\nThis hook has the following timing semantics:\n\n**Always**\n- called the first time the helper value is requested\n- called after autotracked state has changed\n\n**Never**\n- called if the `hasValue` capability is disabled\n\n#### `runEffect`\n\n`runEffect` is an optional hook that should run the effect that the helper is\napplying, setting it up or updating it.\n\nThis hook is scheduled to be called some time after render and prior to paint.\nThere is not a guaranteed, 1-to-1 relationship between a render pass and this\nhook firing. For instance, multiple render passes could occur, and the hook may\nonly trigger once. It may also never trigger if it was dirtied in one render\npass and then destroyed in the next.\n\nThe hook is autotracked, and will rerun whenever any tracked values used inside\nof it are updated. Otherwise it does not rerun.\n\nThe hook is also run during a time period where state mutations are _disabled_\nin Ember. Any tracked state mutation will throw an error during this time,\nincluding changes to tracked properties, changes made using `Ember.set`, updates\nto computed properties, etc. This is meant to prevent infinite rerenders and\nother antipatterns.\n\nThis hook is only called for helpers with the `hasScheduledEffect` capability\nenabled. This hook is also not called in SSR currently, though this could be\nadded as a capability in the future. It has the following timing semantics:\n\n**Always**\n- called after the helper was first created, if the helper has not been\n destroyed since creation\n- called after autotracked state has changed, if the helper has not been\n destroyed during render\n\n**Never**\n- called if the `hasScheduledEffect` capability is disabled\n- called in SSR\n\n#### `getDestroyable`\n\n`getDestroyable` is an optional hook that users can use to register a\ndestroyable object for the helper. This destroyable will be registered to the\ncontaining block or template parent, and will be destroyed when it is destroyed.\nSee the [Destroyables RFC](https://github.com/emberjs/rfcs/blob/master/text/0580-destroyables.md)\nfor more details.\n\n`getDestroyable` is only called if the `hasDestroyable` capability is enabled.\n\nThis hook has the following timing semantics:\n\n**Always**\n- called immediately after the `createHelper` hook is called\n\n**Never**\n- called if the `hasDestroyable` capability is disabled", + "itemtype": "method", + "name": "setHelperManager", + "static": 1, + "params": [ + { + "name": "factory", + "description": "A factory function which receives an optional owner, and returns a helper manager", + "type": "Function" + }, + { + "name": "definition", + "description": "The definition to associate the manager factory with", + "type": "Object" + } + ], + "return": { + "description": "The definition passed into setHelperManager", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/helper", + "module": "@ember/helper" + } + ] + }, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/instrumentation.json b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/instrumentation.json new file mode 100644 index 000000000..c53f502d8 --- /dev/null +++ b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/instrumentation.json @@ -0,0 +1,137 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/instrumentation", + "type": "module", + "attributes": { + "name": "@ember/instrumentation", + "submodules": {}, + "elements": {}, + "fors": { + "@ember/instrumentation": 1 + }, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/instrumentation/index.ts", + "line": 39, + "access": "private", + "tagname": "", + "parent": null, + "publicclasses": [], + "privateclasses": [], + "staticfunctions": {}, + "allstaticfunctions": { + "@ember/instrumentation": [ + { + "file": "packages/@ember/instrumentation/index.ts", + "line": 120, + "description": "Notifies event's subscribers, calls `before` and `after` hooks.", + "itemtype": "method", + "name": "instrument", + "static": 1, + "params": [ + { + "name": "name", + "description": "Namespaced event name.", + "type": "String", + "optional": true + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "callback", + "description": "Function that you're instrumenting.", + "type": "Function" + }, + { + "name": "binding", + "description": "Context that instrument function is called with.", + "type": "Object" + } + ], + "access": "private", + "tagname": "", + "class": "@ember/instrumentation", + "module": "@ember/instrumentation" + }, + { + "file": "packages/@ember/instrumentation/index.ts", + "line": 336, + "description": "Resets `Instrumentation` by flushing list of subscribers.", + "itemtype": "method", + "name": "reset", + "static": 1, + "access": "private", + "tagname": "", + "class": "@ember/instrumentation", + "module": "@ember/instrumentation" + }, + { + "file": "packages/@ember/instrumentation/index.ts", + "line": 273, + "description": "Subscribes to a particular event or instrumented block of code.", + "itemtype": "method", + "name": "subscribe", + "static": 1, + "params": [ + { + "name": "pattern", + "description": "Namespaced event name.", + "type": "String", + "optional": true + }, + { + "name": "object", + "description": "Before and After hooks.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "", + "type": "Subscriber" + }, + "access": "private", + "tagname": "", + "class": "@ember/instrumentation", + "module": "@ember/instrumentation" + }, + { + "file": "packages/@ember/instrumentation/index.ts", + "line": 313, + "description": "Unsubscribes from a particular event or instrumented block of code.", + "itemtype": "method", + "name": "unsubscribe", + "static": 1, + "params": [ + { + "name": "subscriber", + "description": "", + "type": "Object", + "optional": true + } + ], + "access": "private", + "tagname": "", + "class": "@ember/instrumentation", + "module": "@ember/instrumentation" + } + ] + }, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/object.json b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/object.json new file mode 100644 index 000000000..cbb433948 --- /dev/null +++ b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/object.json @@ -0,0 +1,2906 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/object", + "type": "module", + "attributes": { + "name": "@ember/object", + "submodules": {}, + "elements": {}, + "fors": { + "@ember/object": 1, + "@ember/debug": 1, + "@ember/object/events": 1, + "@ember/object/evented": 1, + "@ember/object/computed": 1, + "@ember/object/observers": 1, + "Ember": 1, + "@ember/object/internals": 1, + "@ember/object/compat": 1 + }, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/object/index.ts", + "line": 30, + "parent": null, + "publicclasses": [ + "ComputedProperty", + "EmberObject" + ], + "privateclasses": [ + "Descriptor" + ], + "staticfunctions": { + "@ember/object": [ + { + "file": "packages/@ember/object/index.ts", + "line": 51, + "description": "Decorator that turns the target function into an Action which can be accessed\ndirectly by reference.\n\n```js\nimport Component from '@ember/component';\nimport { action, set } from '@ember/object';\n\nexport default class Tooltip extends Component {\n @action\n toggleShowing() {\n set(this, 'isShowing', !this.isShowing);\n }\n}\n```\n```hbs\n\n\n\n{{#if isShowing}}\n
\n I'm a tooltip!\n
\n{{/if}}\n```\n\nDecorated actions also interop with the string style template actions:\n\n```hbs\n\n\n\n{{#if isShowing}}\n
\n I'm a tooltip!\n
\n{{/if}}\n```\n\nIt also binds the function directly to the instance, so it can be used in any\ncontext and will correctly refer to the class it came from:\n\n```hbs\n\n\n Show tooltip\n\n\n{{#if isShowing}}\n
\n I'm a tooltip!\n
\n{{/if}}\n```\n\nThis can also be used in JavaScript code directly:\n\n```js\nimport Component from '@ember/component';\nimport { action, set } from '@ember/object';\n\nexport default class Tooltip extends Component {\n constructor() {\n super(...arguments);\n\n // this.toggleShowing is still bound correctly when added to\n // the event listener\n document.addEventListener('click', this.toggleShowing);\n }\n\n @action\n toggleShowing() {\n set(this, 'isShowing', !this.isShowing);\n }\n}\n```\n\nThis is considered best practice, since it means that methods will be bound\ncorrectly no matter where they are used. By contrast, the `{{action}}` helper\nand modifier can also be used to bind context, but it will be required for\nevery usage of the method:\n\n```hbs\n\n\n Show tooltip\n\n\n{{#if isShowing}}\n
\n I'm a tooltip!\n
\n{{/if}}\n```\n\nThey also do not have equivalents in JavaScript directly, so they cannot be\nused for other situations where binding would be useful.", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "action", + "static": 1, + "params": [ + { + "name": "callback", + "description": "The function to turn into an action,\n when used in classic classes", + "type": "Function|undefined" + } + ], + "return": { + "description": "property decorator instance", + "type": "PropertyDecorator" + }, + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/computed.ts", + "line": 731, + "description": "This helper returns a new property descriptor that wraps the passed\ncomputed property function. You can use this helper to define properties with\nnative decorator syntax, mixins, or via `defineProperty()`.\n\nExample:\n\n```js\nimport { computed, set } from '@ember/object';\n\nclass Person {\n constructor() {\n this.firstName = 'Betty';\n this.lastName = 'Jones';\n },\n\n @computed('firstName', 'lastName')\n get fullName() {\n return `${this.firstName} ${this.lastName}`;\n }\n}\n\nlet client = new Person();\n\nclient.fullName; // 'Betty Jones'\n\nset(client, 'lastName', 'Fuller');\nclient.fullName; // 'Betty Fuller'\n```\n\nClassic Class Example:\n\n```js\nimport EmberObject, { computed } from '@ember/object';\n\nlet Person = EmberObject.extend({\n init() {\n this._super(...arguments);\n\n this.firstName = 'Betty';\n this.lastName = 'Jones';\n },\n\n fullName: computed('firstName', 'lastName', function() {\n return `${this.get('firstName')} ${this.get('lastName')}`;\n })\n});\n\nlet client = Person.create();\n\nclient.get('fullName'); // 'Betty Jones'\n\nclient.set('lastName', 'Fuller');\nclient.get('fullName'); // 'Betty Fuller'\n```\n\nYou can also provide a setter, either directly on the class using native class\nsyntax, or by passing a hash with `get` and `set` functions.\n\nExample:\n\n```js\nimport { computed, set } from '@ember/object';\n\nclass Person {\n constructor() {\n this.firstName = 'Betty';\n this.lastName = 'Jones';\n },\n\n @computed('firstName', 'lastName')\n get fullName() {\n return `${this.firstName} ${this.lastName}`;\n }\n\n set fullName(value) {\n let [firstName, lastName] = value.split(/\\s+/);\n\n set(this, 'firstName', firstName);\n set(this, 'lastName', lastName);\n\n return value;\n }\n}\n\nlet client = new Person();\n\nclient.fullName; // 'Betty Jones'\n\nset(client, 'lastName', 'Fuller');\nclient.fullName; // 'Betty Fuller'\n```\n\nClassic Class Example:\n\n```js\nimport EmberObject, { computed } from '@ember/object';\n\nlet Person = EmberObject.extend({\n init() {\n this._super(...arguments);\n\n this.firstName = 'Betty';\n this.lastName = 'Jones';\n },\n\n fullName: computed('firstName', 'lastName', {\n get(key) {\n return `${this.get('firstName')} ${this.get('lastName')}`;\n },\n set(key, value) {\n let [firstName, lastName] = value.split(/\\s+/);\n this.setProperties({ firstName, lastName });\n return value;\n }\n })\n});\n\nlet client = Person.create();\nclient.get('firstName'); // 'Betty'\n\nclient.set('fullName', 'Carroll Fuller');\nclient.get('firstName'); // 'Carroll'\n```\n\nWhen passed as an argument, the `set` function should accept two parameters,\n`key` and `value`. The value returned from `set` will be the new value of the\nproperty.\n\n_Note: This is the preferred way to define computed properties when writing third-party\nlibraries that depend on or use Ember, since there is no guarantee that the user\nwill have [prototype Extensions](https://guides.emberjs.com/release/configuring-ember/disabling-prototype-extensions/) enabled._", + "itemtype": "method", + "name": "computed", + "static": 1, + "params": [ + { + "name": "dependentKeys*", + "description": "Optional dependent keys that trigger this computed property.", + "type": "String", + "optional": true + }, + { + "name": "func", + "description": "The computed property function.", + "type": "Function" + } + ], + "return": { + "description": "property decorator instance", + "type": "ComputedDecorator" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/properties.ts", + "line": 13, + "description": "NOTE: This is a low-level method used by other parts of the API. You almost\nnever want to call this method directly. Instead you should use\n`mixin()` to define new properties.\n\nDefines a property on an object. This method works much like the ES5\n`Object.defineProperty()` method except that it can also accept computed\nproperties and other special descriptors.\n\nNormally this method takes only three parameters. However if you pass an\ninstance of `Descriptor` as the third param then you can pass an\noptional value as the fourth parameter. This is often more efficient than\ncreating new descriptor hashes for each property.\n\n## Examples\n\n```javascript\nimport { defineProperty, computed } from '@ember/object';\n\n// ES5 compatible mode\ndefineProperty(contact, 'firstName', {\n writable: true,\n configurable: false,\n enumerable: true,\n value: 'Charles'\n});\n\n// define a simple property\ndefineProperty(contact, 'lastName', undefined, 'Jolley');\n\n// define a computed property\ndefineProperty(contact, 'fullName', computed('firstName', 'lastName', function() {\n return this.firstName+' '+this.lastName;\n}));\n```", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "defineProperty", + "static": 1, + "params": [ + { + "name": "obj", + "description": "the object to define this property on. This may be a prototype.", + "type": "Object" + }, + { + "name": "keyName", + "description": "the name of the property", + "type": "String" + }, + { + "name": "desc", + "description": "an instance of `Descriptor` (typically a\n computed property) or an ES5 descriptor.\n You must provide this or `data` but not both.", + "type": "Descriptor", + "optional": true + }, + { + "name": "data", + "description": "something other than a descriptor, that will\n become the explicit value of this property.", + "type": "*", + "optional": true + } + ], + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_get.ts", + "line": 51, + "description": "Gets the value of a property on an object. If the property is computed,\nthe function will be invoked. If the property is not defined but the\nobject implements the `unknownProperty` method then that will be invoked.\n\n```javascript\nimport { get } from '@ember/object';\nget(obj, \"name\");\n```\n\nIf you plan to run on IE8 and older browsers then you should use this\nmethod anytime you want to retrieve a property on an object that you don't\nknow for sure is private. (Properties beginning with an underscore '_'\nare considered private.)\n\nOn all newer browsers, you only need to use this method to retrieve\nproperties if the property might not be defined on the object and you want\nto respect the `unknownProperty` handler. Otherwise you can ignore this\nmethod.\n\nNote that if the object itself is `undefined`, this method will throw\nan error.", + "itemtype": "method", + "name": "get", + "static": 1, + "params": [ + { + "name": "obj", + "description": "The object to retrieve from.", + "type": "Object" + }, + { + "name": "keyName", + "description": "The property key to retrieve", + "type": "String" + } + ], + "return": { + "description": "the property value or `null`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/get_properties.ts", + "line": 6, + "description": "To get multiple properties at once, call `getProperties`\nwith an object followed by a list of strings or an array:\n\n```javascript\nimport { getProperties } from '@ember/object';\n\ngetProperties(record, 'firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }\n```\n\nis equivalent to:\n\n```javascript\nimport { getProperties } from '@ember/object';\n\ngetProperties(record, ['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }\n```", + "itemtype": "method", + "name": "getProperties", + "static": 1, + "params": [ + { + "name": "obj", + "description": "", + "type": "Object" + }, + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/index.ts", + "line": 289, + "description": "Specify a method that observes property changes.\n\n```javascript\nimport EmberObject from '@ember/object';\nimport { observer } from '@ember/object';\n\nexport default EmberObject.extend({\n valueObserver: observer('value', function() {\n // Executes whenever the \"value\" property changes\n })\n});\n```\n\nAlso available as `Function.prototype.observes` if prototype extensions are\nenabled.", + "itemtype": "method", + "name": "observer", + "params": [ + { + "name": "propertyNames", + "description": "", + "type": "String", + "multiple": true + }, + { + "name": "func", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "func" + }, + "access": "public", + "tagname": "", + "static": 1, + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_set.ts", + "line": 17, + "description": "Sets the value of a property on an object, respecting computed properties\nand notifying observers and other listeners of the change.\nIf the specified property is not defined on the object and the object\nimplements the `setUnknownProperty` method, then instead of setting the\nvalue of the property on the object, its `setUnknownProperty` handler\nwill be invoked with the two parameters `keyName` and `value`.\n\n```javascript\nimport { set } from '@ember/object';\nset(obj, \"name\", value);\n```", + "itemtype": "method", + "name": "set", + "static": 1, + "params": [ + { + "name": "obj", + "description": "The object to modify.", + "type": "Object" + }, + { + "name": "keyName", + "description": "The property key to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set", + "type": "Object" + } + ], + "return": { + "description": "the passed value.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/set_properties.ts", + "line": 6, + "description": "Set a list of properties on an object. These properties are set inside\na single `beginPropertyChanges` and `endPropertyChanges` batch, so\nobservers will be buffered.\n\n```javascript\nimport EmberObject from '@ember/object';\nlet anObject = EmberObject.create();\n\nanObject.setProperties({\n firstName: 'Stanley',\n lastName: 'Stuart',\n age: 21\n});\n```", + "itemtype": "method", + "name": "setProperties", + "static": 1, + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "properties", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "properties" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_set.ts", + "line": 121, + "description": "Error-tolerant form of `set`. Will not blow up if any part of the\nchain is `undefined`, `null`, or destroyed.\n\nThis is primarily used when syncing bindings, which may try to update after\nan object has been destroyed.\n\n```javascript\nimport { trySet } from '@ember/object';\n\nlet obj = { name: \"Zoey\" };\ntrySet(obj, \"contacts.twitter\", \"@emberjs\");\n```", + "itemtype": "method", + "name": "trySet", + "static": 1, + "params": [ + { + "name": "root", + "description": "The object to modify.", + "type": "Object" + }, + { + "name": "path", + "description": "The property path to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + } + ], + "@ember/object/events": [ + { + "file": "packages/@ember/-internals/metal/lib/events.ts", + "line": 28, + "description": "Add an event listener", + "itemtype": "method", + "name": "addListener", + "static": 1, + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "eventName", + "description": "", + "type": "String" + }, + { + "name": "target", + "description": "A target object or a function", + "type": "Object|Function" + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + }, + { + "name": "once", + "description": "A flag whether a function should only be called once", + "type": "Boolean" + } + ], + "access": "public", + "tagname": "", + "class": "@ember/object/events", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/events.ts", + "line": 162, + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "hasListeners", + "static": 1, + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "eventName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "if `obj` has listeners for event `eventName`", + "type": "Boolean" + }, + "class": "@ember/object/events", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/events.ts", + "line": 62, + "description": "Remove an event listener\n\nArguments should match those passed to `addListener`.", + "itemtype": "method", + "name": "removeListener", + "static": 1, + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "eventName", + "description": "", + "type": "String" + }, + { + "name": "target", + "description": "A target object or a function", + "type": "Object|Function" + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "access": "public", + "tagname": "", + "class": "@ember/object/events", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/events.ts", + "line": 105, + "description": "Send an event. The execution of suspended listeners\nis skipped, and once listeners are removed. A listener without\na target is executed on the passed object. If an array of actions\nis not passed, the actions stored on the passed object are invoked.", + "itemtype": "method", + "name": "sendEvent", + "static": 1, + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "eventName", + "description": "", + "type": "String" + }, + { + "name": "params", + "description": "Optional parameters for each listener.", + "type": "Array" + } + ], + "return": { + "description": "if the event was delivered to one or more actions", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/events", + "module": "@ember/object" + } + ], + "@ember/object/observers": [ + { + "file": "packages/@ember/-internals/metal/lib/observer.ts", + "line": 27, + "itemtype": "method", + "name": "addObserver", + "static": 1, + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "path", + "description": "", + "type": "String" + }, + { + "name": "target", + "description": "", + "type": "Object|Function" + }, + { + "name": "method", + "description": "", + "type": "Function|String", + "optional": true + } + ], + "access": "public", + "tagname": "", + "class": "@ember/object/observers", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/observer.ts", + "line": 55, + "itemtype": "method", + "name": "removeObserver", + "static": 1, + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "path", + "description": "", + "type": "String" + }, + { + "name": "target", + "description": "", + "type": "Object|Function" + }, + { + "name": "method", + "description": "", + "type": "Function|String", + "optional": true + } + ], + "access": "public", + "tagname": "", + "class": "@ember/object/observers", + "module": "@ember/object" + } + ], + "@ember/object/computed": [ + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 649, + "description": "Creates a new property that is an alias for another property on an object.\nCalls to `get` or `set` this property behave as though they were called on the\noriginal property.\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { alias } from '@ember/object/computed';\n\nclass Person {\n name = 'Alex Matchneer';\n\n @alias('name') nomen;\n}\n\nlet alex = new Person();\n\nalex.nomen; // 'Alex Matchneer'\nalex.name; // 'Alex Matchneer'\n\nset(alex, 'nomen', '@machty');\nalex.name; // '@machty'\n```", + "itemtype": "method", + "name": "alias", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which creates an alias to the\noriginal value for property.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 560, + "description": "A computed property that performs a logical `and` on the original values for\nthe provided dependent properties.\n\nYou may pass in more than two properties and even use property brace\nexpansion. The computed property will return the first falsy value or last\ntruthy value just like JavaScript's `&&` operator.\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { and } from '@ember/object/computed';\n\nclass Hamster {\n @and('hasTent', 'hasBackpack') readyForCamp;\n @and('hasWalkingStick', 'hasBackpack') readyForHike;\n}\n\nlet tomster = new Hamster();\n\ntomster.readyForCamp; // false\n\nset(tomster, 'hasTent', true);\ntomster.readyForCamp; // false\n\nset(tomster, 'hasBackpack', true);\ntomster.readyForCamp; // true\n\nset(tomster, 'hasBackpack', 'Yes');\ntomster.readyForCamp; // 'Yes'\n\nset(tomster, 'hasWalkingStick', null);\ntomster.readyForHike; // null\n```", + "itemtype": "method", + "name": "and", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computed property which performs a logical `and` on\nthe values of all the original values for properties.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 240, + "description": "A computed property that converts the provided dependent property into a\nboolean value.\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { bool } from '@ember/object/computed';\n\n\nclass Hamster {\n @bool('numBananas') hasBananas\n}\n\nlet hamster = new Hamster();\n\nhamster.hasBananas; // false\n\nset(hamster, 'numBananas', 0);\nhamster.hasBananas; // false\n\nset(hamster, 'numBananas', 1);\nhamster.hasBananas; // true\n\nset(hamster, 'numBananas', null);\nhamster.hasBananas; // false\n```", + "itemtype": "method", + "name": "bool", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which converts to boolean the\noriginal value for property", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 980, + "description": "A computed property that returns the array of values for the provided\ndependent properties.\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { collect } from '@ember/object/computed';\n\nclass Hamster {\n @collect('hat', 'shirt') clothes;\n}\n\nlet hamster = new Hamster();\n\nhamster.clothes; // [null, null]\n\nset(hamster, 'hat', 'Camp Hat');\nset(hamster, 'shirt', 'Camp Shirt');\nhamster.clothes; // ['Camp Hat', 'Camp Shirt']\n```", + "itemtype": "method", + "name": "collect", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computed property which maps values of all passed\nin properties to an array.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 796, + "description": "Creates a new property that is an alias for another property on an object.\nCalls to `get` or `set` this property behave as though they were called on the\noriginal property, but also print a deprecation warning.\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { deprecatingAlias } from '@ember/object/computed';\n\nclass Hamster {\n @deprecatingAlias('cavendishCount', {\n id: 'hamster.deprecate-banana',\n until: '3.0.0'\n })\n bananaCount;\n}\n\nlet hamster = new Hamster();\n\nset(hamster, 'bananaCount', 5); // Prints a deprecation warning.\nhamster.cavendishCount; // 5\n```", + "itemtype": "method", + "name": "deprecatingAlias", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "Options for `deprecate`.", + "type": "Object" + } + ], + "return": { + "description": "computed property which creates an alias with a\ndeprecation to the original value for property.", + "type": "ComputedProperty" + }, + "since": "1.7.0", + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 60, + "description": "A computed property macro that returns true if the value of the dependent\nproperty is null, an empty string, empty array, or empty function.\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { empty } from '@ember/object/computed';\n\nclass ToDoList {\n constructor(todos) {\n set(this, 'todos', todos);\n }\n\n @empty('todos') isDone;\n}\n\nlet todoList = new ToDoList(\n ['Unit Test', 'Documentation', 'Release']\n);\n\ntodoList.isDone; // false\nset(todoList, 'todos', []);\ntodoList.isDone; // true\n```", + "since": "1.6.0", + "itemtype": "method", + "name": "empty", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which returns true if the value\nof the dependent property is null, an empty string, empty array, or empty\nfunction and false if the underlying value is not empty.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 335, + "description": "A computed property that returns true if the provided dependent property is\nequal to the given value.\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { equal } from '@ember/object/computed';\n\nclass Hamster {\n @equal('percentCarrotsEaten', 100) satisfied;\n}\n\nlet hamster = new Hamster();\n\nhamster.satisfied; // false\n\nset(hamster, 'percentCarrotsEaten', 100);\nhamster.satisfied; // true\n\nset(hamster, 'percentCarrotsEaten', 50);\nhamster.satisfied; // false\n```", + "itemtype": "method", + "name": "equal", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "String|Number|Object" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is equal to the given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/expand_properties.ts", + "line": 9, + "description": "Expands `pattern`, invoking `callback` for each expansion.\n\nThe only pattern supported is brace-expansion, anything else will be passed\nonce to `callback` directly.\n\nExample\n\n```js\nimport { expandProperties } from '@ember/object/computed';\n\nfunction echo(arg){ console.log(arg); }\n\nexpandProperties('foo.bar', echo); //=> 'foo.bar'\nexpandProperties('{foo,bar}', echo); //=> 'foo', 'bar'\nexpandProperties('foo.{bar,baz}', echo); //=> 'foo.bar', 'foo.baz'\nexpandProperties('{foo,bar}.baz', echo); //=> 'foo.baz', 'bar.baz'\nexpandProperties('foo.{bar,baz}.[]', echo) //=> 'foo.bar.[]', 'foo.baz.[]'\nexpandProperties('{foo,bar}.{spam,eggs}', echo) //=> 'foo.spam', 'foo.eggs', 'bar.spam', 'bar.eggs'\nexpandProperties('{foo}.bar.{baz}') //=> 'foo.bar.baz'\n```", + "itemtype": "method", + "name": "expandProperties", + "static": 1, + "access": "public", + "tagname": "", + "params": [ + { + "name": "pattern", + "description": "The property pattern to expand.", + "type": "String" + }, + { + "name": "callback", + "description": "The callback to invoke. It is invoked once per\nexpansion, and is passed the expansion.", + "type": "Function" + } + ], + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 431, + "description": "Filters the array by the callback, like the `Array.prototype.filter` method.\n\nThe callback method you provide should have the following signature:\n- `item` is the current item in the iteration.\n- `index` is the integer index of the current item in the iteration.\n- `array` is the dependant array itself.\n\n```javascript\nfunction filterCallback(item, index, array);\n```\n\nIn the callback, return a truthy value that coerces to true to keep the\nelement, or a falsy to reject it.\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { filter } from '@ember/object/computed';\n\nclass Hamster {\n constructor(chores) {\n set(this, 'chores', chores);\n }\n\n @filter('chores', function(chore, index, array) {\n return !chore.done;\n })\n remainingChores;\n}\n\nlet hamster = Hamster.create([\n { name: 'cook', done: true },\n { name: 'clean', done: true },\n { name: 'write more unit tests', done: false }\n]);\n\nhamster.remainingChores; // [{name: 'write more unit tests', done: false}]\n```\n\nYou can also use `@each.property` in your dependent key, the callback will\nstill use the underlying array:\n\n```javascript\nimport { set } from '@ember/object';\nimport { filter } from '@ember/object/computed';\n\nclass Hamster {\n constructor(chores) {\n set(this, 'chores', chores);\n }\n\n @filter('chores.@each.done', function(chore, index, array) {\n return !chore.done;\n })\n remainingChores;\n}\n\nlet hamster = new Hamster([\n { name: 'cook', done: true },\n { name: 'clean', done: true },\n { name: 'write more unit tests', done: false }\n]);\nhamster.remainingChores; // [{name: 'write more unit tests', done: false}]\n\nset(hamster.chores[2], 'done', true);\nhamster.remainingChores; // []\n```\n\nFinally, you can optionally pass an array of additional dependent keys as the\nsecond parameter to the macro, if your filter function relies on any external\nvalues:\n\n```javascript\nimport { filter } from '@ember/object/computed';\n\nclass Hamster {\n constructor(chores) {\n set(this, 'chores', chores);\n }\n\n doneKey = 'finished';\n\n @filter('chores', ['doneKey'], function(chore, index, array) {\n return !chore[this.doneKey];\n })\n remainingChores;\n}\n\nlet hamster = new Hamster([\n { name: 'cook', finished: true },\n { name: 'clean', finished: true },\n { name: 'write more unit tests', finished: false }\n]);\n\nhamster.remainingChores; // [{name: 'write more unit tests', finished: false}]\n```", + "itemtype": "method", + "name": "filter", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "additionalDependentKeys", + "description": "optional array of additional dependent keys", + "type": "Array", + "optional": true + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "the filtered array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 601, + "description": "Filters the array by the property and value.\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { filterBy } from '@ember/object/computed';\n\nclass Hamster {\n constructor(chores) {\n set(this, 'chores', chores);\n }\n\n @filterBy('chores', 'done', false) remainingChores;\n}\n\nlet hamster = new Hamster([\n { name: 'cook', done: true },\n { name: 'clean', done: true },\n { name: 'write more unit tests', done: false }\n]);\n\nhamster.remainingChores; // [{ name: 'write more unit tests', done: false }]\n```", + "itemtype": "method", + "name": "filterBy", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "propertyKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "*" + } + ], + "return": { + "description": "the filtered array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 380, + "description": "A computed property that returns true if the provided dependent property is\ngreater than the provided value.\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { gt } from '@ember/object/computed';\n\nclass Hamster {\n @gt('numBananas', 10) hasTooManyBananas;\n}\n\nlet hamster = new Hamster();\n\nhamster.hasTooManyBananas; // false\n\nset(hamster, 'numBananas', 3);\nhamster.hasTooManyBananas; // false\n\nset(hamster, 'numBananas', 11);\nhamster.hasTooManyBananas; // true\n```", + "itemtype": "method", + "name": "gt", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "Number" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is greater than given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 425, + "description": "A computed property that returns true if the provided dependent property is\ngreater than or equal to the provided value.\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { gte } from '@ember/object/computed';\n\nclass Hamster {\n @gte('numBananas', 10) hasTooManyBananas;\n}\n\nlet hamster = new Hamster();\n\nhamster.hasTooManyBananas; // false\n\nset(hamster, 'numBananas', 3);\nhamster.hasTooManyBananas; // false\n\nset(hamster, 'numBananas', 10);\nhamster.hasTooManyBananas; // true\n```", + "itemtype": "method", + "name": "gte", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "Number" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is greater or equal then given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 829, + "description": "A computed property which returns a new array with all the elements\ntwo or more dependent arrays have in common.\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { intersect } from '@ember/object/computed';\n\nclass FriendGroups {\n constructor(adaFriends, charlesFriends) {\n set(this, 'adaFriends', adaFriends);\n set(this, 'charlesFriends', charlesFriends);\n }\n\n @intersect('adaFriends', 'charlesFriends') friendsInCommon;\n}\n\nlet groups = new FriendGroups(\n ['Charles Babbage', 'John Hobhouse', 'William King', 'Mary Somerville'],\n ['William King', 'Mary Somerville', 'Ada Lovelace', 'George Peacock']\n);\n\ngroups.friendsInCommon; // ['William King', 'Mary Somerville']\n```", + "itemtype": "method", + "name": "intersect", + "static": 1, + "params": [ + { + "name": "propertyKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computes a new array with all the duplicated\nelements from the dependent arrays", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 470, + "description": "A computed property that returns true if the provided dependent property is\nless than the provided value.\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { lt } from '@ember/object/computed';\n\nclass Hamster {\n @lt('numBananas', 3) needsMoreBananas;\n}\n\nlet hamster = new Hamster();\n\nhamster.needsMoreBananas; // true\n\nset(hamster, 'numBananas', 3);\nhamster.needsMoreBananas; // false\n\nset(hamster, 'numBananas', 2);\nhamster.needsMoreBananas; // true\n```", + "itemtype": "method", + "name": "lt", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "Number" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is less then given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 515, + "description": "A computed property that returns true if the provided dependent property is\nless than or equal to the provided value.\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { lte } from '@ember/object/computed';\n\nclass Hamster {\n @lte('numBananas', 3) needsMoreBananas;\n}\n\nlet hamster = new Hamster();\n\nhamster.needsMoreBananas; // true\n\nset(hamster, 'numBananas', 5);\nhamster.needsMoreBananas; // false\n\nset(hamster, 'numBananas', 3);\nhamster.needsMoreBananas; // true\n```", + "itemtype": "method", + "name": "lte", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "Number" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is less or equal than given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 240, + "description": "Returns an array mapped via the callback\n\nThe callback method you provide should have the following signature:\n- `item` is the current item in the iteration.\n- `index` is the integer index of the current item in the iteration.\n\n```javascript\nfunction mapCallback(item, index);\n```\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { map } from '@ember/object/computed';\n\nclass Hamster {\n constructor(chores) {\n set(this, 'chores', chores);\n }\n\n @map('chores', function(chore, index) {\n return `${chore.toUpperCase()}!`;\n })\n excitingChores;\n});\n\nlet hamster = new Hamster(['clean', 'write more unit tests']);\n\nhamster.excitingChores; // ['CLEAN!', 'WRITE MORE UNIT TESTS!']\n```\n\nYou can optionally pass an array of additional dependent keys as the second\nparameter to the macro, if your map function relies on any external values:\n\n```javascript\nimport { set } from '@ember/object';\nimport { map } from '@ember/object/computed';\n\nclass Hamster {\n shouldUpperCase = false;\n\n constructor(chores) {\n set(this, 'chores', chores);\n }\n\n @map('chores', ['shouldUpperCase'], function(chore, index) {\n if (this.shouldUpperCase) {\n return `${chore.toUpperCase()}!`;\n } else {\n return `${chore}!`;\n }\n })\n excitingChores;\n}\n\nlet hamster = new Hamster(['clean', 'write more unit tests']);\n\nhamster.excitingChores; // ['clean!', 'write more unit tests!']\n\nset(hamster, 'shouldUpperCase', true);\nhamster.excitingChores; // ['CLEAN!', 'WRITE MORE UNIT TESTS!']\n```", + "itemtype": "method", + "name": "map", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "additionalDependentKeys", + "description": "optional array of additional\ndependent keys", + "type": "Array", + "optional": true + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "an array mapped via the callback", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 364, + "description": "Returns an array mapped to the specified key.\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { mapBy } from '@ember/object/computed';\n\nclass Person {\n children = [];\n\n @mapBy('children', 'age') childAges;\n}\n\nlet lordByron = new Person();\n\nlordByron.childAges; // []\n\nset(lordByron, 'children', [\n {\n name: 'Augusta Ada Byron',\n age: 7\n }\n]);\nlordByron.childAges; // [7]\n\nset(lordByron, 'children', [\n ...lordByron.children,\n {\n name: 'Allegra Byron',\n age: 5\n }, {\n name: 'Elizabeth Medora Leigh',\n age: 8\n }\n]);\nlordByron.childAges; // [7, 5, 8]\n```", + "itemtype": "method", + "name": "mapBy", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "propertyKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "an array mapped to the specified key", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 288, + "description": "A computed property which matches the original value for the dependent\nproperty against a given RegExp, returning `true` if the value matches the\nRegExp and `false` if it does not.\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { match } from '@ember/object/computed';\n\nclass User {\n @match('email', /^.+@.+\\..+$/) hasValidEmail;\n}\n\nlet user = new User();\n\nuser.hasValidEmail; // false\n\nset(user, 'email', '');\nuser.hasValidEmail; // false\n\nset(user, 'email', 'ember_hamster@example.com');\nuser.hasValidEmail; // true\n```", + "itemtype": "method", + "name": "match", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "regexp", + "description": "", + "type": "RegExp" + } + ], + "return": { + "description": "computed property which match the original value\nfor property against a given RegExp", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 113, + "description": "A computed property that calculates the maximum value in the dependent array.\nThis will return `-Infinity` when the dependent array is empty.\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { mapBy, max } from '@ember/object/computed';\n\nclass Person {\n children = [];\n\n @mapBy('children', 'age') childAges;\n @max('childAges') maxChildAge;\n}\n\nlet lordByron = new Person();\n\nlordByron.maxChildAge; // -Infinity\n\nset(lordByron, 'children', [\n {\n name: 'Augusta Ada Byron',\n age: 7\n }\n]);\nlordByron.maxChildAge; // 7\n\nset(lordByron, 'children', [\n ...lordByron.children,\n {\n name: 'Allegra Byron',\n age: 5\n }, {\n name: 'Elizabeth Medora Leigh',\n age: 8\n }\n]);\nlordByron.maxChildAge; // 8\n```\n\nIf the types of the arguments are not numbers, they will be converted to\nnumbers and the type of the return value will always be `Number`. For example,\nthe max of a list of Date objects will be the highest timestamp as a `Number`.\nThis behavior is consistent with `Math.max`.", + "itemtype": "method", + "name": "max", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes the largest value in the dependentKey's\narray", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 177, + "description": "A computed property that calculates the minimum value in the dependent array.\nThis will return `Infinity` when the dependent array is empty.\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { mapBy, min } from '@ember/object/computed';\n\nclass Person {\n children = [];\n\n @mapBy('children', 'age') childAges;\n @min('childAges') minChildAge;\n}\n\nlet lordByron = Person.create({ children: [] });\n\nlordByron.minChildAge; // Infinity\n\nset(lordByron, 'children', [\n {\n name: 'Augusta Ada Byron',\n age: 7\n }\n]);\nlordByron.minChildAge; // 7\n\nset(lordByron, 'children', [\n ...lordByron.children,\n {\n name: 'Allegra Byron',\n age: 5\n }, {\n name: 'Elizabeth Medora Leigh',\n age: 8\n }\n]);\nlordByron.minChildAge; // 5\n```\n\nIf the types of the arguments are not numbers, they will be converted to\nnumbers and the type of the return value will always be `Number`. For example,\nthe min of a list of Date objects will be the lowest timestamp as a `Number`.\nThis behavior is consistent with `Math.min`.", + "itemtype": "method", + "name": "min", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes the smallest value in the dependentKey's array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 155, + "description": "A computed property that returns true if the value of the dependent property\nis null or undefined. This avoids errors from JSLint complaining about use of\n==, which can be technically confusing.\n\n```javascript\nimport { set } from '@ember/object';\nimport { none } from '@ember/object/computed';\n\nclass Hamster {\n @none('food') isHungry;\n}\n\nlet hamster = new Hamster();\n\nhamster.isHungry; // true\n\nset(hamster, 'food', 'Banana');\nhamster.isHungry; // false\n\nset(hamster, 'food', null);\nhamster.isHungry; // true\n```", + "itemtype": "method", + "name": "none", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which returns true if original\nvalue for property is null or undefined.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 198, + "description": "A computed property that returns the inverse boolean value of the original\nvalue for the dependent property.\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { not } from '@ember/object/computed';\n\nclass User {\n loggedIn = false;\n\n @not('loggedIn') isAnonymous;\n}\n\nlet user = new User();\n\nuser.isAnonymous; // true\nset(user, 'loggedIn', true);\nuser.isAnonymous; // false\n```", + "itemtype": "method", + "name": "not", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which returns inverse of the\noriginal value for property", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 109, + "description": "A computed property that returns true if the value of the dependent property\nis NOT null, an empty string, empty array, or empty function.\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { notEmpty } from '@ember/object/computed';\n\nclass Hamster {\n constructor(backpack) {\n set(this, 'backpack', backpack);\n }\n\n @notEmpty('backpack') hasStuff\n}\n\nlet hamster = new Hamster(\n ['Food', 'Sleeping Bag', 'Tent']\n);\n\nhamster.hasStuff; // true\nset(hamster, 'backpack', []);\nhamster.hasStuff; // false\n```", + "itemtype": "method", + "name": "notEmpty", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which returns true if original\nvalue for property is not empty.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 684, + "description": "Where the `alias` computed macro aliases `get` and `set`, and allows for\nbidirectional data flow, the `oneWay` computed macro only provides an aliased\n`get`. The `set` will not mutate the upstream property, rather causes the\ncurrent property to become the value set. This causes the downstream property\nto permanently diverge from the upstream property.\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { oneWay }from '@ember/object/computed';\n\nclass User {\n constructor(firstName, lastName) {\n set(this, 'firstName', firstName);\n set(this, 'lastName', lastName);\n }\n\n @oneWay('firstName') nickName;\n}\n\nlet teddy = new User('Teddy', 'Zeenny');\n\nteddy.nickName; // 'Teddy'\n\nset(teddy, 'nickName', 'TeddyBear');\nteddy.firstName; // 'Teddy'\nteddy.nickName; // 'TeddyBear'\n```", + "itemtype": "method", + "name": "oneWay", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which creates a one way computed\nproperty to the original value for property.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 606, + "description": "A computed property which performs a logical `or` on the original values for\nthe provided dependent properties.\n\nYou may pass in more than two properties and even use property brace\nexpansion. The computed property will return the first truthy value or last\nfalsy value just like JavaScript's `||` operator.\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { or } from '@ember/object/computed';\n\nclass Hamster {\n @or('hasJacket', 'hasUmbrella') readyForRain;\n @or('hasSunscreen', 'hasUmbrella') readyForBeach;\n}\n\nlet tomster = new Hamster();\n\ntomster.readyForRain; // undefined\n\nset(tomster, 'hasUmbrella', true);\ntomster.readyForRain; // true\n\nset(tomster, 'hasJacket', 'Yes');\ntomster.readyForRain; // 'Yes'\n\nset(tomster, 'hasSunscreen', 'Check');\ntomster.readyForBeach; // 'Check'\n```", + "itemtype": "method", + "name": "or", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computed property which performs a logical `or` on\nthe values of all the original values for properties.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 745, + "description": "Where `oneWay` computed macro provides oneWay bindings, the `readOnly`\ncomputed macro provides a readOnly one way binding. Very often when using\nthe `oneWay` macro one does not also want changes to propagate back up, as\nthey will replace the value.\n\nThis prevents the reverse flow, and also throws an exception when it occurs.\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { readOnly } from '@ember/object/computed';\n\nclass User {\n constructor(firstName, lastName) {\n set(this, 'firstName', firstName);\n set(this, 'lastName', lastName);\n }\n\n @readOnly('firstName') nickName;\n});\n\nlet teddy = new User('Teddy', 'Zeenny');\n\nteddy.nickName; // 'Teddy'\n\nset(teddy, 'nickName', 'TeddyBear'); // throws Exception\n// throw new EmberError('Cannot Set: nickName on: ' );`\n\nteddy.firstName; // 'Teddy'\n```", + "itemtype": "method", + "name": "readOnly", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which creates a one way computed\nproperty to the original value for property.", + "type": "ComputedProperty" + }, + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 732, + "description": "This is a more semantically meaningful alias of the `oneWay` computed macro,\nwhose name is somewhat ambiguous as to which direction the data flows.", + "itemtype": "method", + "name": "reads", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which creates a one way computed\n property to the original value for property.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 910, + "description": "A computed property which returns a new array with all the properties from the\nfirst dependent array that are not in the second dependent array.\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { setDiff } from '@ember/object/computed';\n\nclass Hamster {\n constructor(likes, fruits) {\n set(this, 'likes', likes);\n set(this, 'fruits', fruits);\n }\n\n @setDiff('likes', 'fruits') wants;\n}\n\nlet hamster = new Hamster(\n [\n 'banana',\n 'grape',\n 'kale'\n ],\n [\n 'grape',\n 'kale',\n ]\n);\n\nhamster.wants; // ['banana']\n```", + "itemtype": "method", + "name": "setDiff", + "static": 1, + "params": [ + { + "name": "setAProperty", + "description": "", + "type": "String" + }, + { + "name": "setBProperty", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes a new array with all the items from the\nfirst dependent array that are not in the second dependent array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 1039, + "description": "A computed property which returns a new array with all the properties from the\nfirst dependent array sorted based on a property or sort function. The sort\nmacro can be used in two different ways:\n\n1. By providing a sort callback function\n2. By providing an array of keys to sort the array\n\nIn the first form, the callback method you provide should have the following\nsignature:\n\n```javascript\nfunction sortCallback(itemA, itemB);\n```\n\n- `itemA` the first item to compare.\n- `itemB` the second item to compare.\n\nThis function should return negative number (e.g. `-1`) when `itemA` should\ncome before `itemB`. It should return positive number (e.g. `1`) when `itemA`\nshould come after `itemB`. If the `itemA` and `itemB` are equal this function\nshould return `0`.\n\nTherefore, if this function is comparing some numeric values, simple `itemA -\nitemB` or `itemA.get( 'foo' ) - itemB.get( 'foo' )` can be used instead of\nseries of `if`.\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { sort } from '@ember/object/computed';\n\nclass ToDoList {\n constructor(todos) {\n set(this, 'todos', todos);\n }\n\n // using a custom sort function\n @sort('todos', function(a, b){\n if (a.priority > b.priority) {\n return 1;\n } else if (a.priority < b.priority) {\n return -1;\n }\n\n return 0;\n })\n priorityTodos;\n}\n\nlet todoList = new ToDoList([\n { name: 'Unit Test', priority: 2 },\n { name: 'Documentation', priority: 3 },\n { name: 'Release', priority: 1 }\n]);\n\ntodoList.priorityTodos; // [{ name:'Release', priority:1 }, { name:'Unit Test', priority:2 }, { name:'Documentation', priority:3 }]\n```\n\nYou can also optionally pass an array of additional dependent keys as the\nsecond parameter, if your sort function is dependent on additional values that\ncould changes:\n\n```js\nimport EmberObject, { set } from '@ember/object';\nimport { sort } from '@ember/object/computed';\n\nclass ToDoList {\n sortKey = 'priority';\n\n constructor(todos) {\n set(this, 'todos', todos);\n }\n\n // using a custom sort function\n @sort('todos', ['sortKey'], function(a, b){\n if (a[this.sortKey] > b[this.sortKey]) {\n return 1;\n } else if (a[this.sortKey] < b[this.sortKey]) {\n return -1;\n }\n\n return 0;\n })\n sortedTodos;\n});\n\nlet todoList = new ToDoList([\n { name: 'Unit Test', priority: 2 },\n { name: 'Documentation', priority: 3 },\n { name: 'Release', priority: 1 }\n]);\n\ntodoList.priorityTodos; // [{ name:'Release', priority:1 }, { name:'Unit Test', priority:2 }, { name:'Documentation', priority:3 }]\n```\n\nIn the second form, you should provide the key of the array of sort values as\nthe second parameter:\n\n```javascript\nimport { set } from '@ember/object';\nimport { sort } from '@ember/object/computed';\n\nclass ToDoList {\n constructor(todos) {\n set(this, 'todos', todos);\n }\n\n // using standard ascending sort\n todosSorting = ['name'];\n @sort('todos', 'todosSorting') sortedTodos;\n\n // using descending sort\n todosSortingDesc = ['name:desc'];\n @sort('todos', 'todosSortingDesc') sortedTodosDesc;\n}\n\nlet todoList = new ToDoList([\n { name: 'Unit Test', priority: 2 },\n { name: 'Documentation', priority: 3 },\n { name: 'Release', priority: 1 }\n]);\n\ntodoList.sortedTodos; // [{ name:'Documentation', priority:3 }, { name:'Release', priority:1 }, { name:'Unit Test', priority:2 }]\ntodoList.sortedTodosDesc; // [{ name:'Unit Test', priority:2 }, { name:'Release', priority:1 }, { name:'Documentation', priority:3 }]\n```", + "itemtype": "method", + "name": "sort", + "static": 1, + "params": [ + { + "name": "itemsKey", + "description": "", + "type": "String" + }, + { + "name": "sortDefinitionOrDependentKeys", + "description": "The key of the sort definition (an array of sort properties),\nthe sort function, or an array of additional dependent keys", + "type": "String|Function|Array" + }, + { + "name": "sortDefinition", + "description": "the sort function (when used with additional dependent keys)", + "type": "Function?" + } + ], + "return": { + "description": "computes a new sorted array based on the sort\nproperty array or callback function", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 76, + "description": "A computed property that returns the sum of the values in the dependent array.\n\nExample:\n\n```javascript\nimport { sum } from '@ember/object/computed';\n\nclass Invoice {\n lineItems = [1.00, 2.50, 9.99];\n\n @sum('lineItems') total;\n}\n\nlet invoice = new Invoice();\n\ninvoice.total; // 13.49\n```", + "itemtype": "method", + "name": "sum", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes the sum of all values in the\ndependentKey's array", + "type": "ComputedProperty" + }, + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 782, + "description": "A computed property which returns a new array with all the unique elements\nfrom one or more dependent arrays.\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { union } from '@ember/object/computed';\n\nclass Hamster {\n constructor(fruits, vegetables) {\n set(this, 'fruits', fruits);\n set(this, 'vegetables', vegetables);\n }\n\n @union('fruits', 'vegetables') uniqueFruits;\n});\n\nlet hamster = new, Hamster(\n [\n 'banana',\n 'grape',\n 'kale',\n 'banana',\n 'tomato'\n ],\n [\n 'tomato',\n 'carrot',\n 'lettuce'\n ]\n);\n\nhamster.uniqueFruits; // ['banana', 'grape', 'kale', 'tomato', 'carrot', 'lettuce']\n```", + "itemtype": "method", + "name": "union", + "static": 1, + "params": [ + { + "name": "propertyKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computes a new array with all the unique elements\nfrom one or more dependent arrays.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 657, + "description": "A computed property which returns a new array with all the unique elements\nfrom one or more dependent arrays.\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { uniq } from '@ember/object/computed';\n\nclass Hamster {\n constructor(fruits) {\n set(this, 'fruits', fruits);\n }\n\n @uniq('fruits') uniqueFruits;\n}\n\nlet hamster = new Hamster([\n 'banana',\n 'grape',\n 'kale',\n 'banana'\n]);\n\nhamster.uniqueFruits; // ['banana', 'grape', 'kale']\n```", + "itemtype": "method", + "name": "uniq", + "static": 1, + "params": [ + { + "name": "propertyKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computes a new array with all the\nunique elements from the dependent array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 728, + "description": "A computed property which returns a new array with all the unique elements\nfrom an array, with uniqueness determined by specific key.\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { uniqBy } from '@ember/object/computed';\n\nclass Hamster {\n constructor(fruits) {\n set(this, 'fruits', fruits);\n }\n\n @uniqBy('fruits', 'id') uniqueFruits;\n}\n\nlet hamster = new Hamster([\n { id: 1, 'banana' },\n { id: 2, 'grape' },\n { id: 3, 'peach' },\n { id: 1, 'banana' }\n]);\n\nhamster.uniqueFruits; // [ { id: 1, 'banana' }, { id: 2, 'grape' }, { id: 3, 'peach' }]\n```", + "itemtype": "method", + "name": "uniqBy", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "propertyKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes a new array with all the\nunique elements from the dependent array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + } + ], + "@ember/object/compat": [ + { + "file": "packages/@ember/object/compat.ts", + "line": 40, + "description": "`@dependentKeyCompat` is decorator that can be used on _native getters_ that\nuse tracked properties. It exposes the getter to Ember's classic computed\nproperty and observer systems, so they can watch it for changes. It can be\nused in both native and classic classes.\n\nNative Example:\n\n```js\nimport { tracked } from '@glimmer/tracking';\nimport { dependentKeyCompat } from '@ember/object/compat';\nimport { computed, set } from '@ember/object';\n\nclass Person {\n @tracked firstName;\n @tracked lastName;\n\n @dependentKeyCompat\n get fullName() {\n return `${this.firstName} ${this.lastName}`;\n }\n}\n\nclass Profile {\n constructor(person) {\n set(this, 'person', person);\n }\n\n @computed('person.fullName')\n get helloMessage() {\n return `Hello, ${this.person.fullName}!`;\n }\n}\n```\n\nClassic Example:\n\n```js\nimport { tracked } from '@glimmer/tracking';\nimport { dependentKeyCompat } from '@ember/object/compat';\nimport EmberObject, { computed, observer, set } from '@ember/object';\n\nconst Person = EmberObject.extend({\n firstName: tracked(),\n lastName: tracked(),\n\n fullName: dependentKeyCompat(function() {\n return `${this.firstName} ${this.lastName}`;\n }),\n});\n\nconst Profile = EmberObject.extend({\n person: null,\n\n helloMessage: computed('person.fullName', function() {\n return `Hello, ${this.person.fullName}!`;\n }),\n\n onNameUpdated: observer('person.fullName', function() {\n console.log('person name updated!');\n }),\n});\n```\n\n`dependentKeyCompat()` can receive a getter function or an object containing\n`get`/`set` methods when used in classic classes, like computed properties.\n\nIn general, only properties which you _expect_ to be watched by older,\nuntracked clases should be marked as dependency compatible. The decorator is\nmeant as an interop layer for parts of Ember's older classic APIs, and should\nnot be applied to every possible getter/setter in classes. The number of\ndependency compatible getters should be _minimized_ wherever possible. New\napplication code should not need to use `@dependentKeyCompat`, since it is\nonly for interoperation with older code.", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "dependentKeyCompat", + "static": 1, + "params": [ + { + "name": "desc", + "description": "A property descriptor containing\n the getter and setter (when used in\n classic classes)", + "type": "PropertyDescriptor|undefined" + } + ], + "return": { + "description": "property decorator instance", + "type": "PropertyDecorator" + }, + "class": "@ember/object/compat", + "module": "@ember/object" + } + ], + "@ember/object/internals": [ + { + "file": "packages/@ember/-internals/utils/lib/guid.ts", + "line": 83, + "description": "Returns a unique id for the object. If the object does not yet have a guid,\none will be assigned to it. You can call this on any object,\n`EmberObject`-based or not.\n\nYou can also use this method on DOM Element objects.", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "guidFor", + "params": [ + { + "name": "obj", + "description": "any object, string, number, Element, or primitive", + "type": "Object" + } + ], + "return": { + "description": "the unique guid for this instance.", + "type": "String" + }, + "class": "@ember/object/internals", + "module": "@ember/object" + } + ], + "@ember/object/evented": [ + { + "file": "packages/@ember/-internals/metal/lib/events.ts", + "line": 180, + "description": "Define a property as a function that should be executed when\na specified event or events are triggered.\n\n``` javascript\nimport EmberObject from '@ember/object';\nimport { on } from '@ember/object/evented';\nimport { sendEvent } from '@ember/object/events';\n\nlet Job = EmberObject.extend({\n logCompleted: on('completed', function() {\n console.log('Job completed!');\n })\n});\n\nlet job = Job.create();\n\nsendEvent(job, 'completed'); // Logs 'Job completed!'\n ```", + "itemtype": "method", + "name": "on", + "static": 1, + "params": [ + { + "name": "eventNames", + "description": "", + "type": "String", + "multiple": true + }, + { + "name": "func", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "the listener function, passed as last argument to on(...)", + "type": "Function" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/evented", + "module": "@ember/object" + } + ] + }, + "allstaticfunctions": { + "@ember/object": [ + { + "file": "packages/@ember/object/index.ts", + "line": 51, + "description": "Decorator that turns the target function into an Action which can be accessed\ndirectly by reference.\n\n```js\nimport Component from '@ember/component';\nimport { action, set } from '@ember/object';\n\nexport default class Tooltip extends Component {\n @action\n toggleShowing() {\n set(this, 'isShowing', !this.isShowing);\n }\n}\n```\n```hbs\n\n\n\n{{#if isShowing}}\n
\n I'm a tooltip!\n
\n{{/if}}\n```\n\nDecorated actions also interop with the string style template actions:\n\n```hbs\n\n\n\n{{#if isShowing}}\n
\n I'm a tooltip!\n
\n{{/if}}\n```\n\nIt also binds the function directly to the instance, so it can be used in any\ncontext and will correctly refer to the class it came from:\n\n```hbs\n\n\n Show tooltip\n\n\n{{#if isShowing}}\n
\n I'm a tooltip!\n
\n{{/if}}\n```\n\nThis can also be used in JavaScript code directly:\n\n```js\nimport Component from '@ember/component';\nimport { action, set } from '@ember/object';\n\nexport default class Tooltip extends Component {\n constructor() {\n super(...arguments);\n\n // this.toggleShowing is still bound correctly when added to\n // the event listener\n document.addEventListener('click', this.toggleShowing);\n }\n\n @action\n toggleShowing() {\n set(this, 'isShowing', !this.isShowing);\n }\n}\n```\n\nThis is considered best practice, since it means that methods will be bound\ncorrectly no matter where they are used. By contrast, the `{{action}}` helper\nand modifier can also be used to bind context, but it will be required for\nevery usage of the method:\n\n```hbs\n\n\n Show tooltip\n\n\n{{#if isShowing}}\n
\n I'm a tooltip!\n
\n{{/if}}\n```\n\nThey also do not have equivalents in JavaScript directly, so they cannot be\nused for other situations where binding would be useful.", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "action", + "static": 1, + "params": [ + { + "name": "callback", + "description": "The function to turn into an action,\n when used in classic classes", + "type": "Function|undefined" + } + ], + "return": { + "description": "property decorator instance", + "type": "PropertyDecorator" + }, + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/computed.ts", + "line": 731, + "description": "This helper returns a new property descriptor that wraps the passed\ncomputed property function. You can use this helper to define properties with\nnative decorator syntax, mixins, or via `defineProperty()`.\n\nExample:\n\n```js\nimport { computed, set } from '@ember/object';\n\nclass Person {\n constructor() {\n this.firstName = 'Betty';\n this.lastName = 'Jones';\n },\n\n @computed('firstName', 'lastName')\n get fullName() {\n return `${this.firstName} ${this.lastName}`;\n }\n}\n\nlet client = new Person();\n\nclient.fullName; // 'Betty Jones'\n\nset(client, 'lastName', 'Fuller');\nclient.fullName; // 'Betty Fuller'\n```\n\nClassic Class Example:\n\n```js\nimport EmberObject, { computed } from '@ember/object';\n\nlet Person = EmberObject.extend({\n init() {\n this._super(...arguments);\n\n this.firstName = 'Betty';\n this.lastName = 'Jones';\n },\n\n fullName: computed('firstName', 'lastName', function() {\n return `${this.get('firstName')} ${this.get('lastName')}`;\n })\n});\n\nlet client = Person.create();\n\nclient.get('fullName'); // 'Betty Jones'\n\nclient.set('lastName', 'Fuller');\nclient.get('fullName'); // 'Betty Fuller'\n```\n\nYou can also provide a setter, either directly on the class using native class\nsyntax, or by passing a hash with `get` and `set` functions.\n\nExample:\n\n```js\nimport { computed, set } from '@ember/object';\n\nclass Person {\n constructor() {\n this.firstName = 'Betty';\n this.lastName = 'Jones';\n },\n\n @computed('firstName', 'lastName')\n get fullName() {\n return `${this.firstName} ${this.lastName}`;\n }\n\n set fullName(value) {\n let [firstName, lastName] = value.split(/\\s+/);\n\n set(this, 'firstName', firstName);\n set(this, 'lastName', lastName);\n\n return value;\n }\n}\n\nlet client = new Person();\n\nclient.fullName; // 'Betty Jones'\n\nset(client, 'lastName', 'Fuller');\nclient.fullName; // 'Betty Fuller'\n```\n\nClassic Class Example:\n\n```js\nimport EmberObject, { computed } from '@ember/object';\n\nlet Person = EmberObject.extend({\n init() {\n this._super(...arguments);\n\n this.firstName = 'Betty';\n this.lastName = 'Jones';\n },\n\n fullName: computed('firstName', 'lastName', {\n get(key) {\n return `${this.get('firstName')} ${this.get('lastName')}`;\n },\n set(key, value) {\n let [firstName, lastName] = value.split(/\\s+/);\n this.setProperties({ firstName, lastName });\n return value;\n }\n })\n});\n\nlet client = Person.create();\nclient.get('firstName'); // 'Betty'\n\nclient.set('fullName', 'Carroll Fuller');\nclient.get('firstName'); // 'Carroll'\n```\n\nWhen passed as an argument, the `set` function should accept two parameters,\n`key` and `value`. The value returned from `set` will be the new value of the\nproperty.\n\n_Note: This is the preferred way to define computed properties when writing third-party\nlibraries that depend on or use Ember, since there is no guarantee that the user\nwill have [prototype Extensions](https://guides.emberjs.com/release/configuring-ember/disabling-prototype-extensions/) enabled._", + "itemtype": "method", + "name": "computed", + "static": 1, + "params": [ + { + "name": "dependentKeys*", + "description": "Optional dependent keys that trigger this computed property.", + "type": "String", + "optional": true + }, + { + "name": "func", + "description": "The computed property function.", + "type": "Function" + } + ], + "return": { + "description": "property decorator instance", + "type": "ComputedDecorator" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/properties.ts", + "line": 13, + "description": "NOTE: This is a low-level method used by other parts of the API. You almost\nnever want to call this method directly. Instead you should use\n`mixin()` to define new properties.\n\nDefines a property on an object. This method works much like the ES5\n`Object.defineProperty()` method except that it can also accept computed\nproperties and other special descriptors.\n\nNormally this method takes only three parameters. However if you pass an\ninstance of `Descriptor` as the third param then you can pass an\noptional value as the fourth parameter. This is often more efficient than\ncreating new descriptor hashes for each property.\n\n## Examples\n\n```javascript\nimport { defineProperty, computed } from '@ember/object';\n\n// ES5 compatible mode\ndefineProperty(contact, 'firstName', {\n writable: true,\n configurable: false,\n enumerable: true,\n value: 'Charles'\n});\n\n// define a simple property\ndefineProperty(contact, 'lastName', undefined, 'Jolley');\n\n// define a computed property\ndefineProperty(contact, 'fullName', computed('firstName', 'lastName', function() {\n return this.firstName+' '+this.lastName;\n}));\n```", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "defineProperty", + "static": 1, + "params": [ + { + "name": "obj", + "description": "the object to define this property on. This may be a prototype.", + "type": "Object" + }, + { + "name": "keyName", + "description": "the name of the property", + "type": "String" + }, + { + "name": "desc", + "description": "an instance of `Descriptor` (typically a\n computed property) or an ES5 descriptor.\n You must provide this or `data` but not both.", + "type": "Descriptor", + "optional": true + }, + { + "name": "data", + "description": "something other than a descriptor, that will\n become the explicit value of this property.", + "type": "*", + "optional": true + } + ], + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_get.ts", + "line": 51, + "description": "Gets the value of a property on an object. If the property is computed,\nthe function will be invoked. If the property is not defined but the\nobject implements the `unknownProperty` method then that will be invoked.\n\n```javascript\nimport { get } from '@ember/object';\nget(obj, \"name\");\n```\n\nIf you plan to run on IE8 and older browsers then you should use this\nmethod anytime you want to retrieve a property on an object that you don't\nknow for sure is private. (Properties beginning with an underscore '_'\nare considered private.)\n\nOn all newer browsers, you only need to use this method to retrieve\nproperties if the property might not be defined on the object and you want\nto respect the `unknownProperty` handler. Otherwise you can ignore this\nmethod.\n\nNote that if the object itself is `undefined`, this method will throw\nan error.", + "itemtype": "method", + "name": "get", + "static": 1, + "params": [ + { + "name": "obj", + "description": "The object to retrieve from.", + "type": "Object" + }, + { + "name": "keyName", + "description": "The property key to retrieve", + "type": "String" + } + ], + "return": { + "description": "the property value or `null`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/get_properties.ts", + "line": 6, + "description": "To get multiple properties at once, call `getProperties`\nwith an object followed by a list of strings or an array:\n\n```javascript\nimport { getProperties } from '@ember/object';\n\ngetProperties(record, 'firstName', 'lastName', 'zipCode');\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }\n```\n\nis equivalent to:\n\n```javascript\nimport { getProperties } from '@ember/object';\n\ngetProperties(record, ['firstName', 'lastName', 'zipCode']);\n// { firstName: 'John', lastName: 'Doe', zipCode: '10011' }\n```", + "itemtype": "method", + "name": "getProperties", + "static": 1, + "params": [ + { + "name": "obj", + "description": "", + "type": "Object" + }, + { + "name": "list", + "description": "of keys to get", + "type": "String...|Array" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/index.ts", + "line": 289, + "description": "Specify a method that observes property changes.\n\n```javascript\nimport EmberObject from '@ember/object';\nimport { observer } from '@ember/object';\n\nexport default EmberObject.extend({\n valueObserver: observer('value', function() {\n // Executes whenever the \"value\" property changes\n })\n});\n```\n\nAlso available as `Function.prototype.observes` if prototype extensions are\nenabled.", + "itemtype": "method", + "name": "observer", + "params": [ + { + "name": "propertyNames", + "description": "", + "type": "String", + "multiple": true + }, + { + "name": "func", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "func" + }, + "access": "public", + "tagname": "", + "static": 1, + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_set.ts", + "line": 17, + "description": "Sets the value of a property on an object, respecting computed properties\nand notifying observers and other listeners of the change.\nIf the specified property is not defined on the object and the object\nimplements the `setUnknownProperty` method, then instead of setting the\nvalue of the property on the object, its `setUnknownProperty` handler\nwill be invoked with the two parameters `keyName` and `value`.\n\n```javascript\nimport { set } from '@ember/object';\nset(obj, \"name\", value);\n```", + "itemtype": "method", + "name": "set", + "static": 1, + "params": [ + { + "name": "obj", + "description": "The object to modify.", + "type": "Object" + }, + { + "name": "keyName", + "description": "The property key to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set", + "type": "Object" + } + ], + "return": { + "description": "the passed value.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/set_properties.ts", + "line": 6, + "description": "Set a list of properties on an object. These properties are set inside\na single `beginPropertyChanges` and `endPropertyChanges` batch, so\nobservers will be buffered.\n\n```javascript\nimport EmberObject from '@ember/object';\nlet anObject = EmberObject.create();\n\nanObject.setProperties({\n firstName: 'Stanley',\n lastName: 'Stuart',\n age: 21\n});\n```", + "itemtype": "method", + "name": "setProperties", + "static": 1, + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "properties", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "properties" + }, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/property_set.ts", + "line": 121, + "description": "Error-tolerant form of `set`. Will not blow up if any part of the\nchain is `undefined`, `null`, or destroyed.\n\nThis is primarily used when syncing bindings, which may try to update after\nan object has been destroyed.\n\n```javascript\nimport { trySet } from '@ember/object';\n\nlet obj = { name: \"Zoey\" };\ntrySet(obj, \"contacts.twitter\", \"@emberjs\");\n```", + "itemtype": "method", + "name": "trySet", + "static": 1, + "params": [ + { + "name": "root", + "description": "The object to modify.", + "type": "Object" + }, + { + "name": "path", + "description": "The property path to set", + "type": "String" + }, + { + "name": "value", + "description": "The value to set", + "type": "Object" + } + ], + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object" + } + ], + "@ember/object/events": [ + { + "file": "packages/@ember/-internals/metal/lib/events.ts", + "line": 28, + "description": "Add an event listener", + "itemtype": "method", + "name": "addListener", + "static": 1, + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "eventName", + "description": "", + "type": "String" + }, + { + "name": "target", + "description": "A target object or a function", + "type": "Object|Function" + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + }, + { + "name": "once", + "description": "A flag whether a function should only be called once", + "type": "Boolean" + } + ], + "access": "public", + "tagname": "", + "class": "@ember/object/events", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/events.ts", + "line": 162, + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "hasListeners", + "static": 1, + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "eventName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "if `obj` has listeners for event `eventName`", + "type": "Boolean" + }, + "class": "@ember/object/events", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/events.ts", + "line": 62, + "description": "Remove an event listener\n\nArguments should match those passed to `addListener`.", + "itemtype": "method", + "name": "removeListener", + "static": 1, + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "eventName", + "description": "", + "type": "String" + }, + { + "name": "target", + "description": "A target object or a function", + "type": "Object|Function" + }, + { + "name": "method", + "description": "A function or the name of a function to be called on `target`", + "type": "Function|String" + } + ], + "access": "public", + "tagname": "", + "class": "@ember/object/events", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/events.ts", + "line": 105, + "description": "Send an event. The execution of suspended listeners\nis skipped, and once listeners are removed. A listener without\na target is executed on the passed object. If an array of actions\nis not passed, the actions stored on the passed object are invoked.", + "itemtype": "method", + "name": "sendEvent", + "static": 1, + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "eventName", + "description": "", + "type": "String" + }, + { + "name": "params", + "description": "Optional parameters for each listener.", + "type": "Array" + } + ], + "return": { + "description": "if the event was delivered to one or more actions", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/events", + "module": "@ember/object" + } + ], + "@ember/object/observers": [ + { + "file": "packages/@ember/-internals/metal/lib/observer.ts", + "line": 27, + "itemtype": "method", + "name": "addObserver", + "static": 1, + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "path", + "description": "", + "type": "String" + }, + { + "name": "target", + "description": "", + "type": "Object|Function" + }, + { + "name": "method", + "description": "", + "type": "Function|String", + "optional": true + } + ], + "access": "public", + "tagname": "", + "class": "@ember/object/observers", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/observer.ts", + "line": 55, + "itemtype": "method", + "name": "removeObserver", + "static": 1, + "params": [ + { + "name": "obj", + "description": "" + }, + { + "name": "path", + "description": "", + "type": "String" + }, + { + "name": "target", + "description": "", + "type": "Object|Function" + }, + { + "name": "method", + "description": "", + "type": "Function|String", + "optional": true + } + ], + "access": "public", + "tagname": "", + "class": "@ember/object/observers", + "module": "@ember/object" + } + ], + "@ember/object/computed": [ + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 649, + "description": "Creates a new property that is an alias for another property on an object.\nCalls to `get` or `set` this property behave as though they were called on the\noriginal property.\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { alias } from '@ember/object/computed';\n\nclass Person {\n name = 'Alex Matchneer';\n\n @alias('name') nomen;\n}\n\nlet alex = new Person();\n\nalex.nomen; // 'Alex Matchneer'\nalex.name; // 'Alex Matchneer'\n\nset(alex, 'nomen', '@machty');\nalex.name; // '@machty'\n```", + "itemtype": "method", + "name": "alias", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which creates an alias to the\noriginal value for property.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 560, + "description": "A computed property that performs a logical `and` on the original values for\nthe provided dependent properties.\n\nYou may pass in more than two properties and even use property brace\nexpansion. The computed property will return the first falsy value or last\ntruthy value just like JavaScript's `&&` operator.\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { and } from '@ember/object/computed';\n\nclass Hamster {\n @and('hasTent', 'hasBackpack') readyForCamp;\n @and('hasWalkingStick', 'hasBackpack') readyForHike;\n}\n\nlet tomster = new Hamster();\n\ntomster.readyForCamp; // false\n\nset(tomster, 'hasTent', true);\ntomster.readyForCamp; // false\n\nset(tomster, 'hasBackpack', true);\ntomster.readyForCamp; // true\n\nset(tomster, 'hasBackpack', 'Yes');\ntomster.readyForCamp; // 'Yes'\n\nset(tomster, 'hasWalkingStick', null);\ntomster.readyForHike; // null\n```", + "itemtype": "method", + "name": "and", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computed property which performs a logical `and` on\nthe values of all the original values for properties.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 240, + "description": "A computed property that converts the provided dependent property into a\nboolean value.\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { bool } from '@ember/object/computed';\n\n\nclass Hamster {\n @bool('numBananas') hasBananas\n}\n\nlet hamster = new Hamster();\n\nhamster.hasBananas; // false\n\nset(hamster, 'numBananas', 0);\nhamster.hasBananas; // false\n\nset(hamster, 'numBananas', 1);\nhamster.hasBananas; // true\n\nset(hamster, 'numBananas', null);\nhamster.hasBananas; // false\n```", + "itemtype": "method", + "name": "bool", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which converts to boolean the\noriginal value for property", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 980, + "description": "A computed property that returns the array of values for the provided\ndependent properties.\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { collect } from '@ember/object/computed';\n\nclass Hamster {\n @collect('hat', 'shirt') clothes;\n}\n\nlet hamster = new Hamster();\n\nhamster.clothes; // [null, null]\n\nset(hamster, 'hat', 'Camp Hat');\nset(hamster, 'shirt', 'Camp Shirt');\nhamster.clothes; // ['Camp Hat', 'Camp Shirt']\n```", + "itemtype": "method", + "name": "collect", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computed property which maps values of all passed\nin properties to an array.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 796, + "description": "Creates a new property that is an alias for another property on an object.\nCalls to `get` or `set` this property behave as though they were called on the\noriginal property, but also print a deprecation warning.\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { deprecatingAlias } from '@ember/object/computed';\n\nclass Hamster {\n @deprecatingAlias('cavendishCount', {\n id: 'hamster.deprecate-banana',\n until: '3.0.0'\n })\n bananaCount;\n}\n\nlet hamster = new Hamster();\n\nset(hamster, 'bananaCount', 5); // Prints a deprecation warning.\nhamster.cavendishCount; // 5\n```", + "itemtype": "method", + "name": "deprecatingAlias", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "Options for `deprecate`.", + "type": "Object" + } + ], + "return": { + "description": "computed property which creates an alias with a\ndeprecation to the original value for property.", + "type": "ComputedProperty" + }, + "since": "1.7.0", + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 60, + "description": "A computed property macro that returns true if the value of the dependent\nproperty is null, an empty string, empty array, or empty function.\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { empty } from '@ember/object/computed';\n\nclass ToDoList {\n constructor(todos) {\n set(this, 'todos', todos);\n }\n\n @empty('todos') isDone;\n}\n\nlet todoList = new ToDoList(\n ['Unit Test', 'Documentation', 'Release']\n);\n\ntodoList.isDone; // false\nset(todoList, 'todos', []);\ntodoList.isDone; // true\n```", + "since": "1.6.0", + "itemtype": "method", + "name": "empty", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which returns true if the value\nof the dependent property is null, an empty string, empty array, or empty\nfunction and false if the underlying value is not empty.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 335, + "description": "A computed property that returns true if the provided dependent property is\nequal to the given value.\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { equal } from '@ember/object/computed';\n\nclass Hamster {\n @equal('percentCarrotsEaten', 100) satisfied;\n}\n\nlet hamster = new Hamster();\n\nhamster.satisfied; // false\n\nset(hamster, 'percentCarrotsEaten', 100);\nhamster.satisfied; // true\n\nset(hamster, 'percentCarrotsEaten', 50);\nhamster.satisfied; // false\n```", + "itemtype": "method", + "name": "equal", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "String|Number|Object" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is equal to the given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/metal/lib/expand_properties.ts", + "line": 9, + "description": "Expands `pattern`, invoking `callback` for each expansion.\n\nThe only pattern supported is brace-expansion, anything else will be passed\nonce to `callback` directly.\n\nExample\n\n```js\nimport { expandProperties } from '@ember/object/computed';\n\nfunction echo(arg){ console.log(arg); }\n\nexpandProperties('foo.bar', echo); //=> 'foo.bar'\nexpandProperties('{foo,bar}', echo); //=> 'foo', 'bar'\nexpandProperties('foo.{bar,baz}', echo); //=> 'foo.bar', 'foo.baz'\nexpandProperties('{foo,bar}.baz', echo); //=> 'foo.baz', 'bar.baz'\nexpandProperties('foo.{bar,baz}.[]', echo) //=> 'foo.bar.[]', 'foo.baz.[]'\nexpandProperties('{foo,bar}.{spam,eggs}', echo) //=> 'foo.spam', 'foo.eggs', 'bar.spam', 'bar.eggs'\nexpandProperties('{foo}.bar.{baz}') //=> 'foo.bar.baz'\n```", + "itemtype": "method", + "name": "expandProperties", + "static": 1, + "access": "public", + "tagname": "", + "params": [ + { + "name": "pattern", + "description": "The property pattern to expand.", + "type": "String" + }, + { + "name": "callback", + "description": "The callback to invoke. It is invoked once per\nexpansion, and is passed the expansion.", + "type": "Function" + } + ], + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 431, + "description": "Filters the array by the callback, like the `Array.prototype.filter` method.\n\nThe callback method you provide should have the following signature:\n- `item` is the current item in the iteration.\n- `index` is the integer index of the current item in the iteration.\n- `array` is the dependant array itself.\n\n```javascript\nfunction filterCallback(item, index, array);\n```\n\nIn the callback, return a truthy value that coerces to true to keep the\nelement, or a falsy to reject it.\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { filter } from '@ember/object/computed';\n\nclass Hamster {\n constructor(chores) {\n set(this, 'chores', chores);\n }\n\n @filter('chores', function(chore, index, array) {\n return !chore.done;\n })\n remainingChores;\n}\n\nlet hamster = Hamster.create([\n { name: 'cook', done: true },\n { name: 'clean', done: true },\n { name: 'write more unit tests', done: false }\n]);\n\nhamster.remainingChores; // [{name: 'write more unit tests', done: false}]\n```\n\nYou can also use `@each.property` in your dependent key, the callback will\nstill use the underlying array:\n\n```javascript\nimport { set } from '@ember/object';\nimport { filter } from '@ember/object/computed';\n\nclass Hamster {\n constructor(chores) {\n set(this, 'chores', chores);\n }\n\n @filter('chores.@each.done', function(chore, index, array) {\n return !chore.done;\n })\n remainingChores;\n}\n\nlet hamster = new Hamster([\n { name: 'cook', done: true },\n { name: 'clean', done: true },\n { name: 'write more unit tests', done: false }\n]);\nhamster.remainingChores; // [{name: 'write more unit tests', done: false}]\n\nset(hamster.chores[2], 'done', true);\nhamster.remainingChores; // []\n```\n\nFinally, you can optionally pass an array of additional dependent keys as the\nsecond parameter to the macro, if your filter function relies on any external\nvalues:\n\n```javascript\nimport { filter } from '@ember/object/computed';\n\nclass Hamster {\n constructor(chores) {\n set(this, 'chores', chores);\n }\n\n doneKey = 'finished';\n\n @filter('chores', ['doneKey'], function(chore, index, array) {\n return !chore[this.doneKey];\n })\n remainingChores;\n}\n\nlet hamster = new Hamster([\n { name: 'cook', finished: true },\n { name: 'clean', finished: true },\n { name: 'write more unit tests', finished: false }\n]);\n\nhamster.remainingChores; // [{name: 'write more unit tests', finished: false}]\n```", + "itemtype": "method", + "name": "filter", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "additionalDependentKeys", + "description": "optional array of additional dependent keys", + "type": "Array", + "optional": true + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "the filtered array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 601, + "description": "Filters the array by the property and value.\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { filterBy } from '@ember/object/computed';\n\nclass Hamster {\n constructor(chores) {\n set(this, 'chores', chores);\n }\n\n @filterBy('chores', 'done', false) remainingChores;\n}\n\nlet hamster = new Hamster([\n { name: 'cook', done: true },\n { name: 'clean', done: true },\n { name: 'write more unit tests', done: false }\n]);\n\nhamster.remainingChores; // [{ name: 'write more unit tests', done: false }]\n```", + "itemtype": "method", + "name": "filterBy", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "propertyKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "*" + } + ], + "return": { + "description": "the filtered array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 380, + "description": "A computed property that returns true if the provided dependent property is\ngreater than the provided value.\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { gt } from '@ember/object/computed';\n\nclass Hamster {\n @gt('numBananas', 10) hasTooManyBananas;\n}\n\nlet hamster = new Hamster();\n\nhamster.hasTooManyBananas; // false\n\nset(hamster, 'numBananas', 3);\nhamster.hasTooManyBananas; // false\n\nset(hamster, 'numBananas', 11);\nhamster.hasTooManyBananas; // true\n```", + "itemtype": "method", + "name": "gt", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "Number" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is greater than given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 425, + "description": "A computed property that returns true if the provided dependent property is\ngreater than or equal to the provided value.\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { gte } from '@ember/object/computed';\n\nclass Hamster {\n @gte('numBananas', 10) hasTooManyBananas;\n}\n\nlet hamster = new Hamster();\n\nhamster.hasTooManyBananas; // false\n\nset(hamster, 'numBananas', 3);\nhamster.hasTooManyBananas; // false\n\nset(hamster, 'numBananas', 10);\nhamster.hasTooManyBananas; // true\n```", + "itemtype": "method", + "name": "gte", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "Number" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is greater or equal then given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 829, + "description": "A computed property which returns a new array with all the elements\ntwo or more dependent arrays have in common.\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { intersect } from '@ember/object/computed';\n\nclass FriendGroups {\n constructor(adaFriends, charlesFriends) {\n set(this, 'adaFriends', adaFriends);\n set(this, 'charlesFriends', charlesFriends);\n }\n\n @intersect('adaFriends', 'charlesFriends') friendsInCommon;\n}\n\nlet groups = new FriendGroups(\n ['Charles Babbage', 'John Hobhouse', 'William King', 'Mary Somerville'],\n ['William King', 'Mary Somerville', 'Ada Lovelace', 'George Peacock']\n);\n\ngroups.friendsInCommon; // ['William King', 'Mary Somerville']\n```", + "itemtype": "method", + "name": "intersect", + "static": 1, + "params": [ + { + "name": "propertyKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computes a new array with all the duplicated\nelements from the dependent arrays", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 470, + "description": "A computed property that returns true if the provided dependent property is\nless than the provided value.\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { lt } from '@ember/object/computed';\n\nclass Hamster {\n @lt('numBananas', 3) needsMoreBananas;\n}\n\nlet hamster = new Hamster();\n\nhamster.needsMoreBananas; // true\n\nset(hamster, 'numBananas', 3);\nhamster.needsMoreBananas; // false\n\nset(hamster, 'numBananas', 2);\nhamster.needsMoreBananas; // true\n```", + "itemtype": "method", + "name": "lt", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "Number" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is less then given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 515, + "description": "A computed property that returns true if the provided dependent property is\nless than or equal to the provided value.\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { lte } from '@ember/object/computed';\n\nclass Hamster {\n @lte('numBananas', 3) needsMoreBananas;\n}\n\nlet hamster = new Hamster();\n\nhamster.needsMoreBananas; // true\n\nset(hamster, 'numBananas', 5);\nhamster.needsMoreBananas; // false\n\nset(hamster, 'numBananas', 3);\nhamster.needsMoreBananas; // true\n```", + "itemtype": "method", + "name": "lte", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "value", + "description": "", + "type": "Number" + } + ], + "return": { + "description": "computed property which returns true if the\noriginal value for property is less or equal than given value.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 240, + "description": "Returns an array mapped via the callback\n\nThe callback method you provide should have the following signature:\n- `item` is the current item in the iteration.\n- `index` is the integer index of the current item in the iteration.\n\n```javascript\nfunction mapCallback(item, index);\n```\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { map } from '@ember/object/computed';\n\nclass Hamster {\n constructor(chores) {\n set(this, 'chores', chores);\n }\n\n @map('chores', function(chore, index) {\n return `${chore.toUpperCase()}!`;\n })\n excitingChores;\n});\n\nlet hamster = new Hamster(['clean', 'write more unit tests']);\n\nhamster.excitingChores; // ['CLEAN!', 'WRITE MORE UNIT TESTS!']\n```\n\nYou can optionally pass an array of additional dependent keys as the second\nparameter to the macro, if your map function relies on any external values:\n\n```javascript\nimport { set } from '@ember/object';\nimport { map } from '@ember/object/computed';\n\nclass Hamster {\n shouldUpperCase = false;\n\n constructor(chores) {\n set(this, 'chores', chores);\n }\n\n @map('chores', ['shouldUpperCase'], function(chore, index) {\n if (this.shouldUpperCase) {\n return `${chore.toUpperCase()}!`;\n } else {\n return `${chore}!`;\n }\n })\n excitingChores;\n}\n\nlet hamster = new Hamster(['clean', 'write more unit tests']);\n\nhamster.excitingChores; // ['clean!', 'write more unit tests!']\n\nset(hamster, 'shouldUpperCase', true);\nhamster.excitingChores; // ['CLEAN!', 'WRITE MORE UNIT TESTS!']\n```", + "itemtype": "method", + "name": "map", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "additionalDependentKeys", + "description": "optional array of additional\ndependent keys", + "type": "Array", + "optional": true + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "an array mapped via the callback", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 364, + "description": "Returns an array mapped to the specified key.\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { mapBy } from '@ember/object/computed';\n\nclass Person {\n children = [];\n\n @mapBy('children', 'age') childAges;\n}\n\nlet lordByron = new Person();\n\nlordByron.childAges; // []\n\nset(lordByron, 'children', [\n {\n name: 'Augusta Ada Byron',\n age: 7\n }\n]);\nlordByron.childAges; // [7]\n\nset(lordByron, 'children', [\n ...lordByron.children,\n {\n name: 'Allegra Byron',\n age: 5\n }, {\n name: 'Elizabeth Medora Leigh',\n age: 8\n }\n]);\nlordByron.childAges; // [7, 5, 8]\n```", + "itemtype": "method", + "name": "mapBy", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "propertyKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "an array mapped to the specified key", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 288, + "description": "A computed property which matches the original value for the dependent\nproperty against a given RegExp, returning `true` if the value matches the\nRegExp and `false` if it does not.\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { match } from '@ember/object/computed';\n\nclass User {\n @match('email', /^.+@.+\\..+$/) hasValidEmail;\n}\n\nlet user = new User();\n\nuser.hasValidEmail; // false\n\nset(user, 'email', '');\nuser.hasValidEmail; // false\n\nset(user, 'email', 'ember_hamster@example.com');\nuser.hasValidEmail; // true\n```", + "itemtype": "method", + "name": "match", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "regexp", + "description": "", + "type": "RegExp" + } + ], + "return": { + "description": "computed property which match the original value\nfor property against a given RegExp", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 113, + "description": "A computed property that calculates the maximum value in the dependent array.\nThis will return `-Infinity` when the dependent array is empty.\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { mapBy, max } from '@ember/object/computed';\n\nclass Person {\n children = [];\n\n @mapBy('children', 'age') childAges;\n @max('childAges') maxChildAge;\n}\n\nlet lordByron = new Person();\n\nlordByron.maxChildAge; // -Infinity\n\nset(lordByron, 'children', [\n {\n name: 'Augusta Ada Byron',\n age: 7\n }\n]);\nlordByron.maxChildAge; // 7\n\nset(lordByron, 'children', [\n ...lordByron.children,\n {\n name: 'Allegra Byron',\n age: 5\n }, {\n name: 'Elizabeth Medora Leigh',\n age: 8\n }\n]);\nlordByron.maxChildAge; // 8\n```\n\nIf the types of the arguments are not numbers, they will be converted to\nnumbers and the type of the return value will always be `Number`. For example,\nthe max of a list of Date objects will be the highest timestamp as a `Number`.\nThis behavior is consistent with `Math.max`.", + "itemtype": "method", + "name": "max", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes the largest value in the dependentKey's\narray", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 177, + "description": "A computed property that calculates the minimum value in the dependent array.\nThis will return `Infinity` when the dependent array is empty.\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { mapBy, min } from '@ember/object/computed';\n\nclass Person {\n children = [];\n\n @mapBy('children', 'age') childAges;\n @min('childAges') minChildAge;\n}\n\nlet lordByron = Person.create({ children: [] });\n\nlordByron.minChildAge; // Infinity\n\nset(lordByron, 'children', [\n {\n name: 'Augusta Ada Byron',\n age: 7\n }\n]);\nlordByron.minChildAge; // 7\n\nset(lordByron, 'children', [\n ...lordByron.children,\n {\n name: 'Allegra Byron',\n age: 5\n }, {\n name: 'Elizabeth Medora Leigh',\n age: 8\n }\n]);\nlordByron.minChildAge; // 5\n```\n\nIf the types of the arguments are not numbers, they will be converted to\nnumbers and the type of the return value will always be `Number`. For example,\nthe min of a list of Date objects will be the lowest timestamp as a `Number`.\nThis behavior is consistent with `Math.min`.", + "itemtype": "method", + "name": "min", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes the smallest value in the dependentKey's array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 155, + "description": "A computed property that returns true if the value of the dependent property\nis null or undefined. This avoids errors from JSLint complaining about use of\n==, which can be technically confusing.\n\n```javascript\nimport { set } from '@ember/object';\nimport { none } from '@ember/object/computed';\n\nclass Hamster {\n @none('food') isHungry;\n}\n\nlet hamster = new Hamster();\n\nhamster.isHungry; // true\n\nset(hamster, 'food', 'Banana');\nhamster.isHungry; // false\n\nset(hamster, 'food', null);\nhamster.isHungry; // true\n```", + "itemtype": "method", + "name": "none", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which returns true if original\nvalue for property is null or undefined.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 198, + "description": "A computed property that returns the inverse boolean value of the original\nvalue for the dependent property.\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { not } from '@ember/object/computed';\n\nclass User {\n loggedIn = false;\n\n @not('loggedIn') isAnonymous;\n}\n\nlet user = new User();\n\nuser.isAnonymous; // true\nset(user, 'loggedIn', true);\nuser.isAnonymous; // false\n```", + "itemtype": "method", + "name": "not", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which returns inverse of the\noriginal value for property", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 109, + "description": "A computed property that returns true if the value of the dependent property\nis NOT null, an empty string, empty array, or empty function.\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { notEmpty } from '@ember/object/computed';\n\nclass Hamster {\n constructor(backpack) {\n set(this, 'backpack', backpack);\n }\n\n @notEmpty('backpack') hasStuff\n}\n\nlet hamster = new Hamster(\n ['Food', 'Sleeping Bag', 'Tent']\n);\n\nhamster.hasStuff; // true\nset(hamster, 'backpack', []);\nhamster.hasStuff; // false\n```", + "itemtype": "method", + "name": "notEmpty", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which returns true if original\nvalue for property is not empty.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 684, + "description": "Where the `alias` computed macro aliases `get` and `set`, and allows for\nbidirectional data flow, the `oneWay` computed macro only provides an aliased\n`get`. The `set` will not mutate the upstream property, rather causes the\ncurrent property to become the value set. This causes the downstream property\nto permanently diverge from the upstream property.\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { oneWay }from '@ember/object/computed';\n\nclass User {\n constructor(firstName, lastName) {\n set(this, 'firstName', firstName);\n set(this, 'lastName', lastName);\n }\n\n @oneWay('firstName') nickName;\n}\n\nlet teddy = new User('Teddy', 'Zeenny');\n\nteddy.nickName; // 'Teddy'\n\nset(teddy, 'nickName', 'TeddyBear');\nteddy.firstName; // 'Teddy'\nteddy.nickName; // 'TeddyBear'\n```", + "itemtype": "method", + "name": "oneWay", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which creates a one way computed\nproperty to the original value for property.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 606, + "description": "A computed property which performs a logical `or` on the original values for\nthe provided dependent properties.\n\nYou may pass in more than two properties and even use property brace\nexpansion. The computed property will return the first truthy value or last\nfalsy value just like JavaScript's `||` operator.\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { or } from '@ember/object/computed';\n\nclass Hamster {\n @or('hasJacket', 'hasUmbrella') readyForRain;\n @or('hasSunscreen', 'hasUmbrella') readyForBeach;\n}\n\nlet tomster = new Hamster();\n\ntomster.readyForRain; // undefined\n\nset(tomster, 'hasUmbrella', true);\ntomster.readyForRain; // true\n\nset(tomster, 'hasJacket', 'Yes');\ntomster.readyForRain; // 'Yes'\n\nset(tomster, 'hasSunscreen', 'Check');\ntomster.readyForBeach; // 'Check'\n```", + "itemtype": "method", + "name": "or", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computed property which performs a logical `or` on\nthe values of all the original values for properties.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 745, + "description": "Where `oneWay` computed macro provides oneWay bindings, the `readOnly`\ncomputed macro provides a readOnly one way binding. Very often when using\nthe `oneWay` macro one does not also want changes to propagate back up, as\nthey will replace the value.\n\nThis prevents the reverse flow, and also throws an exception when it occurs.\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { readOnly } from '@ember/object/computed';\n\nclass User {\n constructor(firstName, lastName) {\n set(this, 'firstName', firstName);\n set(this, 'lastName', lastName);\n }\n\n @readOnly('firstName') nickName;\n});\n\nlet teddy = new User('Teddy', 'Zeenny');\n\nteddy.nickName; // 'Teddy'\n\nset(teddy, 'nickName', 'TeddyBear'); // throws Exception\n// throw new EmberError('Cannot Set: nickName on: ' );`\n\nteddy.firstName; // 'Teddy'\n```", + "itemtype": "method", + "name": "readOnly", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which creates a one way computed\nproperty to the original value for property.", + "type": "ComputedProperty" + }, + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/computed_macros.ts", + "line": 732, + "description": "This is a more semantically meaningful alias of the `oneWay` computed macro,\nwhose name is somewhat ambiguous as to which direction the data flows.", + "itemtype": "method", + "name": "reads", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computed property which creates a one way computed\n property to the original value for property.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 910, + "description": "A computed property which returns a new array with all the properties from the\nfirst dependent array that are not in the second dependent array.\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { setDiff } from '@ember/object/computed';\n\nclass Hamster {\n constructor(likes, fruits) {\n set(this, 'likes', likes);\n set(this, 'fruits', fruits);\n }\n\n @setDiff('likes', 'fruits') wants;\n}\n\nlet hamster = new Hamster(\n [\n 'banana',\n 'grape',\n 'kale'\n ],\n [\n 'grape',\n 'kale',\n ]\n);\n\nhamster.wants; // ['banana']\n```", + "itemtype": "method", + "name": "setDiff", + "static": 1, + "params": [ + { + "name": "setAProperty", + "description": "", + "type": "String" + }, + { + "name": "setBProperty", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes a new array with all the items from the\nfirst dependent array that are not in the second dependent array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 1039, + "description": "A computed property which returns a new array with all the properties from the\nfirst dependent array sorted based on a property or sort function. The sort\nmacro can be used in two different ways:\n\n1. By providing a sort callback function\n2. By providing an array of keys to sort the array\n\nIn the first form, the callback method you provide should have the following\nsignature:\n\n```javascript\nfunction sortCallback(itemA, itemB);\n```\n\n- `itemA` the first item to compare.\n- `itemB` the second item to compare.\n\nThis function should return negative number (e.g. `-1`) when `itemA` should\ncome before `itemB`. It should return positive number (e.g. `1`) when `itemA`\nshould come after `itemB`. If the `itemA` and `itemB` are equal this function\nshould return `0`.\n\nTherefore, if this function is comparing some numeric values, simple `itemA -\nitemB` or `itemA.get( 'foo' ) - itemB.get( 'foo' )` can be used instead of\nseries of `if`.\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { sort } from '@ember/object/computed';\n\nclass ToDoList {\n constructor(todos) {\n set(this, 'todos', todos);\n }\n\n // using a custom sort function\n @sort('todos', function(a, b){\n if (a.priority > b.priority) {\n return 1;\n } else if (a.priority < b.priority) {\n return -1;\n }\n\n return 0;\n })\n priorityTodos;\n}\n\nlet todoList = new ToDoList([\n { name: 'Unit Test', priority: 2 },\n { name: 'Documentation', priority: 3 },\n { name: 'Release', priority: 1 }\n]);\n\ntodoList.priorityTodos; // [{ name:'Release', priority:1 }, { name:'Unit Test', priority:2 }, { name:'Documentation', priority:3 }]\n```\n\nYou can also optionally pass an array of additional dependent keys as the\nsecond parameter, if your sort function is dependent on additional values that\ncould changes:\n\n```js\nimport EmberObject, { set } from '@ember/object';\nimport { sort } from '@ember/object/computed';\n\nclass ToDoList {\n sortKey = 'priority';\n\n constructor(todos) {\n set(this, 'todos', todos);\n }\n\n // using a custom sort function\n @sort('todos', ['sortKey'], function(a, b){\n if (a[this.sortKey] > b[this.sortKey]) {\n return 1;\n } else if (a[this.sortKey] < b[this.sortKey]) {\n return -1;\n }\n\n return 0;\n })\n sortedTodos;\n});\n\nlet todoList = new ToDoList([\n { name: 'Unit Test', priority: 2 },\n { name: 'Documentation', priority: 3 },\n { name: 'Release', priority: 1 }\n]);\n\ntodoList.priorityTodos; // [{ name:'Release', priority:1 }, { name:'Unit Test', priority:2 }, { name:'Documentation', priority:3 }]\n```\n\nIn the second form, you should provide the key of the array of sort values as\nthe second parameter:\n\n```javascript\nimport { set } from '@ember/object';\nimport { sort } from '@ember/object/computed';\n\nclass ToDoList {\n constructor(todos) {\n set(this, 'todos', todos);\n }\n\n // using standard ascending sort\n todosSorting = ['name'];\n @sort('todos', 'todosSorting') sortedTodos;\n\n // using descending sort\n todosSortingDesc = ['name:desc'];\n @sort('todos', 'todosSortingDesc') sortedTodosDesc;\n}\n\nlet todoList = new ToDoList([\n { name: 'Unit Test', priority: 2 },\n { name: 'Documentation', priority: 3 },\n { name: 'Release', priority: 1 }\n]);\n\ntodoList.sortedTodos; // [{ name:'Documentation', priority:3 }, { name:'Release', priority:1 }, { name:'Unit Test', priority:2 }]\ntodoList.sortedTodosDesc; // [{ name:'Unit Test', priority:2 }, { name:'Release', priority:1 }, { name:'Documentation', priority:3 }]\n```", + "itemtype": "method", + "name": "sort", + "static": 1, + "params": [ + { + "name": "itemsKey", + "description": "", + "type": "String" + }, + { + "name": "sortDefinitionOrDependentKeys", + "description": "The key of the sort definition (an array of sort properties),\nthe sort function, or an array of additional dependent keys", + "type": "String|Function|Array" + }, + { + "name": "sortDefinition", + "description": "the sort function (when used with additional dependent keys)", + "type": "Function?" + } + ], + "return": { + "description": "computes a new sorted array based on the sort\nproperty array or callback function", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 76, + "description": "A computed property that returns the sum of the values in the dependent array.\n\nExample:\n\n```javascript\nimport { sum } from '@ember/object/computed';\n\nclass Invoice {\n lineItems = [1.00, 2.50, 9.99];\n\n @sum('lineItems') total;\n}\n\nlet invoice = new Invoice();\n\ninvoice.total; // 13.49\n```", + "itemtype": "method", + "name": "sum", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes the sum of all values in the\ndependentKey's array", + "type": "ComputedProperty" + }, + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 782, + "description": "A computed property which returns a new array with all the unique elements\nfrom one or more dependent arrays.\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { union } from '@ember/object/computed';\n\nclass Hamster {\n constructor(fruits, vegetables) {\n set(this, 'fruits', fruits);\n set(this, 'vegetables', vegetables);\n }\n\n @union('fruits', 'vegetables') uniqueFruits;\n});\n\nlet hamster = new, Hamster(\n [\n 'banana',\n 'grape',\n 'kale',\n 'banana',\n 'tomato'\n ],\n [\n 'tomato',\n 'carrot',\n 'lettuce'\n ]\n);\n\nhamster.uniqueFruits; // ['banana', 'grape', 'kale', 'tomato', 'carrot', 'lettuce']\n```", + "itemtype": "method", + "name": "union", + "static": 1, + "params": [ + { + "name": "propertyKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computes a new array with all the unique elements\nfrom one or more dependent arrays.", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 657, + "description": "A computed property which returns a new array with all the unique elements\nfrom one or more dependent arrays.\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { uniq } from '@ember/object/computed';\n\nclass Hamster {\n constructor(fruits) {\n set(this, 'fruits', fruits);\n }\n\n @uniq('fruits') uniqueFruits;\n}\n\nlet hamster = new Hamster([\n 'banana',\n 'grape',\n 'kale',\n 'banana'\n]);\n\nhamster.uniqueFruits; // ['banana', 'grape', 'kale']\n```", + "itemtype": "method", + "name": "uniq", + "static": 1, + "params": [ + { + "name": "propertyKey", + "description": "", + "type": "String", + "multiple": true + } + ], + "return": { + "description": "computes a new array with all the\nunique elements from the dependent array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + }, + { + "file": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "line": 728, + "description": "A computed property which returns a new array with all the unique elements\nfrom an array, with uniqueness determined by specific key.\n\nExample:\n\n```javascript\nimport { set } from '@ember/object';\nimport { uniqBy } from '@ember/object/computed';\n\nclass Hamster {\n constructor(fruits) {\n set(this, 'fruits', fruits);\n }\n\n @uniqBy('fruits', 'id') uniqueFruits;\n}\n\nlet hamster = new Hamster([\n { id: 1, 'banana' },\n { id: 2, 'grape' },\n { id: 3, 'peach' },\n { id: 1, 'banana' }\n]);\n\nhamster.uniqueFruits; // [ { id: 1, 'banana' }, { id: 2, 'grape' }, { id: 3, 'peach' }]\n```", + "itemtype": "method", + "name": "uniqBy", + "static": 1, + "params": [ + { + "name": "dependentKey", + "description": "", + "type": "String" + }, + { + "name": "propertyKey", + "description": "", + "type": "String" + } + ], + "return": { + "description": "computes a new array with all the\nunique elements from the dependent array", + "type": "ComputedProperty" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/computed", + "module": "@ember/object" + } + ], + "@ember/object/compat": [ + { + "file": "packages/@ember/object/compat.ts", + "line": 40, + "description": "`@dependentKeyCompat` is decorator that can be used on _native getters_ that\nuse tracked properties. It exposes the getter to Ember's classic computed\nproperty and observer systems, so they can watch it for changes. It can be\nused in both native and classic classes.\n\nNative Example:\n\n```js\nimport { tracked } from '@glimmer/tracking';\nimport { dependentKeyCompat } from '@ember/object/compat';\nimport { computed, set } from '@ember/object';\n\nclass Person {\n @tracked firstName;\n @tracked lastName;\n\n @dependentKeyCompat\n get fullName() {\n return `${this.firstName} ${this.lastName}`;\n }\n}\n\nclass Profile {\n constructor(person) {\n set(this, 'person', person);\n }\n\n @computed('person.fullName')\n get helloMessage() {\n return `Hello, ${this.person.fullName}!`;\n }\n}\n```\n\nClassic Example:\n\n```js\nimport { tracked } from '@glimmer/tracking';\nimport { dependentKeyCompat } from '@ember/object/compat';\nimport EmberObject, { computed, observer, set } from '@ember/object';\n\nconst Person = EmberObject.extend({\n firstName: tracked(),\n lastName: tracked(),\n\n fullName: dependentKeyCompat(function() {\n return `${this.firstName} ${this.lastName}`;\n }),\n});\n\nconst Profile = EmberObject.extend({\n person: null,\n\n helloMessage: computed('person.fullName', function() {\n return `Hello, ${this.person.fullName}!`;\n }),\n\n onNameUpdated: observer('person.fullName', function() {\n console.log('person name updated!');\n }),\n});\n```\n\n`dependentKeyCompat()` can receive a getter function or an object containing\n`get`/`set` methods when used in classic classes, like computed properties.\n\nIn general, only properties which you _expect_ to be watched by older,\nuntracked clases should be marked as dependency compatible. The decorator is\nmeant as an interop layer for parts of Ember's older classic APIs, and should\nnot be applied to every possible getter/setter in classes. The number of\ndependency compatible getters should be _minimized_ wherever possible. New\napplication code should not need to use `@dependentKeyCompat`, since it is\nonly for interoperation with older code.", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "dependentKeyCompat", + "static": 1, + "params": [ + { + "name": "desc", + "description": "A property descriptor containing\n the getter and setter (when used in\n classic classes)", + "type": "PropertyDescriptor|undefined" + } + ], + "return": { + "description": "property decorator instance", + "type": "PropertyDecorator" + }, + "class": "@ember/object/compat", + "module": "@ember/object" + } + ], + "@ember/object/internals": [ + { + "file": "packages/@ember/-internals/utils/lib/guid.ts", + "line": 55, + "description": "Generates a new guid, optionally saving the guid to the object that you\npass in. You will rarely need to use this method. Instead you should\ncall `guidFor(obj)`, which return an existing guid if available.", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "generateGuid", + "static": 1, + "params": [ + { + "name": "obj", + "description": "Object the guid will be used for. If passed in, the guid will\n be saved on the object and reused whenever you pass the same object\n again.\n\n If no object is passed, just generate a new guid.", + "type": "Object", + "optional": true + }, + { + "name": "prefix", + "description": "Prefix to place in front of the guid. Useful when you want to\n separate the guid into separate namespaces.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "the guid", + "type": "String" + }, + "class": "@ember/object/internals", + "module": "@ember/object" + }, + { + "file": "packages/@ember/-internals/utils/lib/guid.ts", + "line": 83, + "description": "Returns a unique id for the object. If the object does not yet have a guid,\none will be assigned to it. You can call this on any object,\n`EmberObject`-based or not.\n\nYou can also use this method on DOM Element objects.", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "guidFor", + "params": [ + { + "name": "obj", + "description": "any object, string, number, Element, or primitive", + "type": "Object" + } + ], + "return": { + "description": "the unique guid for this instance.", + "type": "String" + }, + "class": "@ember/object/internals", + "module": "@ember/object" + } + ], + "@ember/debug": [ + { + "file": "packages/@ember/-internals/metal/lib/computed.ts", + "line": 919, + "description": "Allows checking if a given property on an object is a computed property. For the most part,\nthis doesn't matter (you would normally just access the property directly and use its value),\nbut for some tooling specific scenarios (e.g. the ember-inspector) it is important to\ndifferentiate if a property is a computed property or a \"normal\" property.\n\nThis will work on either a class's prototype or an instance itself.", + "static": 1, + "itemtype": "method", + "name": "isComputed", + "access": "private", + "tagname": "", + "class": "@ember/debug", + "module": "@ember/object" + } + ], + "@ember/object/evented": [ + { + "file": "packages/@ember/-internals/metal/lib/events.ts", + "line": 180, + "description": "Define a property as a function that should be executed when\na specified event or events are triggered.\n\n``` javascript\nimport EmberObject from '@ember/object';\nimport { on } from '@ember/object/evented';\nimport { sendEvent } from '@ember/object/events';\n\nlet Job = EmberObject.extend({\n logCompleted: on('completed', function() {\n console.log('Job completed!');\n })\n});\n\nlet job = Job.create();\n\nsendEvent(job, 'completed'); // Logs 'Job completed!'\n ```", + "itemtype": "method", + "name": "on", + "static": 1, + "params": [ + { + "name": "eventNames", + "description": "", + "type": "String", + "multiple": true + }, + { + "name": "func", + "description": "", + "type": "Function" + } + ], + "return": { + "description": "the listener function, passed as last argument to on(...)", + "type": "Function" + }, + "access": "public", + "tagname": "", + "class": "@ember/object/evented", + "module": "@ember/object" + } + ] + }, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/object/core.json b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/object/core.json new file mode 100644 index 000000000..7dbaea2ec --- /dev/null +++ b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/object/core.json @@ -0,0 +1,230 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/object/core", + "type": "module", + "attributes": { + "name": "@ember/object/core", + "submodules": {}, + "elements": {}, + "fors": { + "@ember/object": 1 + }, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/object/core.ts", + "line": 175, + "parent": null, + "publicclasses": [ + "CoreObject" + ], + "privateclasses": [], + "staticfunctions": { + "@ember/object": [ + { + "file": "packages/@ember/object/core.ts", + "line": 725, + "description": "Creates an instance of a class. Accepts either no arguments, or an object\ncontaining values to initialize the newly instantiated object with.\n\n```javascript\nimport EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n helloWorld() {\n alert(`Hi, my name is ${this.get('name')}`);\n }\n});\n\nlet tom = Person.create({\n name: 'Tom Dale'\n});\n\ntom.helloWorld(); // alerts \"Hi, my name is Tom Dale\".\n```\n\n`create` will call the `init` function if defined during\n`AnyObject.extend`\n\nIf no arguments are passed to `create`, it will not set values to the new\ninstance during initialization:\n\n```javascript\nlet noName = Person.create();\nnoName.helloWorld(); // alerts undefined\n```\n\nNOTE: For performance reasons, you cannot declare methods or computed\nproperties during `create`. You should instead declare methods and computed\nproperties when using `extend`.", + "itemtype": "method", + "name": "create", + "static": 1, + "params": [ + { + "name": "arguments", + "description": "", + "optional": true, + "multiple": true + } + ], + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 621, + "description": "Creates a new subclass.\n\n```javascript\nimport EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n say(thing) {\n alert(thing);\n }\n});\n```\n\nThis defines a new subclass of EmberObject: `Person`. It contains one method: `say()`.\n\nYou can also create a subclass from any existing class by calling its `extend()` method.\nFor example, you might want to create a subclass of Ember's built-in `Component` class:\n\n```javascript\nimport Component from '@ember/component';\n\nconst PersonComponent = Component.extend({\n tagName: 'li',\n classNameBindings: ['isAdministrator']\n});\n```\n\nWhen defining a subclass, you can override methods but still access the\nimplementation of your parent class by calling the special `_super()` method:\n\n```javascript\nimport EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n say(thing) {\n let name = this.get('name');\n alert(`${name} says: ${thing}`);\n }\n});\n\nconst Soldier = Person.extend({\n say(thing) {\n this._super(`${thing}, sir!`);\n },\n march(numberOfHours) {\n alert(`${this.get('name')} marches for ${numberOfHours} hours.`);\n }\n});\n\nlet yehuda = Soldier.create({\n name: 'Yehuda Katz'\n});\n\nyehuda.say('Yes'); // alerts \"Yehuda Katz says: Yes, sir!\"\n```\n\nThe `create()` on line #17 creates an *instance* of the `Soldier` class.\nThe `extend()` on line #8 creates a *subclass* of `Person`. Any instance\nof the `Person` class will *not* have the `march()` method.\n\nYou can also pass `Mixin` classes to add additional properties to the subclass.\n\n```javascript\nimport EmberObject from '@ember/object';\nimport Mixin from '@ember/object/mixin';\n\nconst Person = EmberObject.extend({\n say(thing) {\n alert(`${this.get('name')} says: ${thing}`);\n }\n});\n\nconst SingingMixin = Mixin.create({\n sing(thing) {\n alert(`${this.get('name')} sings: la la la ${thing}`);\n }\n});\n\nconst BroadwayStar = Person.extend(SingingMixin, {\n dance() {\n alert(`${this.get('name')} dances: tap tap tap tap `);\n }\n});\n```\n\nThe `BroadwayStar` class contains three methods: `say()`, `sing()`, and `dance()`.", + "itemtype": "method", + "name": "extend", + "static": 1, + "params": [ + { + "name": "mixins", + "description": "One or more Mixin classes", + "type": "Mixin", + "optional": true, + "multiple": true + }, + { + "name": "arguments", + "description": "Object containing values to use within the new class", + "type": "Object", + "optional": true, + "multiple": true + } + ], + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 810, + "description": "Augments a constructor's prototype with additional\nproperties and functions:\n\n```javascript\nimport EmberObject from '@ember/object';\n\nconst MyObject = EmberObject.extend({\n name: 'an object'\n});\n\no = MyObject.create();\no.get('name'); // 'an object'\n\nMyObject.reopen({\n say(msg) {\n console.log(msg);\n }\n});\n\no2 = MyObject.create();\no2.say('hello'); // logs \"hello\"\n\no.say('goodbye'); // logs \"goodbye\"\n```\n\nTo add functions and properties to the constructor itself,\nsee `reopenClass`", + "itemtype": "method", + "name": "reopen", + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 864, + "description": "Augments a constructor's own properties and functions:\n\n```javascript\nimport EmberObject from '@ember/object';\n\nconst MyObject = EmberObject.extend({\n name: 'an object'\n});\n\nMyObject.reopenClass({\n canBuild: false\n});\n\nMyObject.canBuild; // false\no = MyObject.create();\n```\n\nIn other words, this creates static properties and functions for the class.\nThese are only available on the class and not on any instance of that class.\n\n```javascript\nimport EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n name: '',\n sayHello() {\n alert(`Hello. My name is ${this.get('name')}`);\n }\n});\n\nPerson.reopenClass({\n species: 'Homo sapiens',\n\n createPerson(name) {\n return Person.create({ name });\n }\n});\n\nlet tom = Person.create({\n name: 'Tom Dale'\n});\nlet yehuda = Person.createPerson('Yehuda Katz');\n\ntom.sayHello(); // \"Hello. My name is Tom Dale\"\nyehuda.sayHello(); // \"Hello. My name is Yehuda Katz\"\nalert(Person.species); // \"Homo sapiens\"\n```\n\nNote that `species` and `createPerson` are *not* valid on the `tom` and `yehuda`\nvariables. They are only valid on `Person`.\n\nTo add functions and properties to instances of\na constructor by extending the constructor's prototype\nsee `reopen`", + "itemtype": "method", + "name": "reopenClass", + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object/core" + } + ] + }, + "allstaticfunctions": { + "@ember/object": [ + { + "file": "packages/@ember/object/core.ts", + "line": 725, + "description": "Creates an instance of a class. Accepts either no arguments, or an object\ncontaining values to initialize the newly instantiated object with.\n\n```javascript\nimport EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n helloWorld() {\n alert(`Hi, my name is ${this.get('name')}`);\n }\n});\n\nlet tom = Person.create({\n name: 'Tom Dale'\n});\n\ntom.helloWorld(); // alerts \"Hi, my name is Tom Dale\".\n```\n\n`create` will call the `init` function if defined during\n`AnyObject.extend`\n\nIf no arguments are passed to `create`, it will not set values to the new\ninstance during initialization:\n\n```javascript\nlet noName = Person.create();\nnoName.helloWorld(); // alerts undefined\n```\n\nNOTE: For performance reasons, you cannot declare methods or computed\nproperties during `create`. You should instead declare methods and computed\nproperties when using `extend`.", + "itemtype": "method", + "name": "create", + "static": 1, + "params": [ + { + "name": "arguments", + "description": "", + "optional": true, + "multiple": true + } + ], + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 993, + "description": "Iterate over each computed property for the class, passing its name\nand any associated metadata (see `metaForProperty`) to the callback.", + "static": 1, + "itemtype": "method", + "name": "eachComputedProperty", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + }, + { + "name": "binding", + "description": "", + "type": "Object" + } + ], + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 621, + "description": "Creates a new subclass.\n\n```javascript\nimport EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n say(thing) {\n alert(thing);\n }\n});\n```\n\nThis defines a new subclass of EmberObject: `Person`. It contains one method: `say()`.\n\nYou can also create a subclass from any existing class by calling its `extend()` method.\nFor example, you might want to create a subclass of Ember's built-in `Component` class:\n\n```javascript\nimport Component from '@ember/component';\n\nconst PersonComponent = Component.extend({\n tagName: 'li',\n classNameBindings: ['isAdministrator']\n});\n```\n\nWhen defining a subclass, you can override methods but still access the\nimplementation of your parent class by calling the special `_super()` method:\n\n```javascript\nimport EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n say(thing) {\n let name = this.get('name');\n alert(`${name} says: ${thing}`);\n }\n});\n\nconst Soldier = Person.extend({\n say(thing) {\n this._super(`${thing}, sir!`);\n },\n march(numberOfHours) {\n alert(`${this.get('name')} marches for ${numberOfHours} hours.`);\n }\n});\n\nlet yehuda = Soldier.create({\n name: 'Yehuda Katz'\n});\n\nyehuda.say('Yes'); // alerts \"Yehuda Katz says: Yes, sir!\"\n```\n\nThe `create()` on line #17 creates an *instance* of the `Soldier` class.\nThe `extend()` on line #8 creates a *subclass* of `Person`. Any instance\nof the `Person` class will *not* have the `march()` method.\n\nYou can also pass `Mixin` classes to add additional properties to the subclass.\n\n```javascript\nimport EmberObject from '@ember/object';\nimport Mixin from '@ember/object/mixin';\n\nconst Person = EmberObject.extend({\n say(thing) {\n alert(`${this.get('name')} says: ${thing}`);\n }\n});\n\nconst SingingMixin = Mixin.create({\n sing(thing) {\n alert(`${this.get('name')} sings: la la la ${thing}`);\n }\n});\n\nconst BroadwayStar = Person.extend(SingingMixin, {\n dance() {\n alert(`${this.get('name')} dances: tap tap tap tap `);\n }\n});\n```\n\nThe `BroadwayStar` class contains three methods: `say()`, `sing()`, and `dance()`.", + "itemtype": "method", + "name": "extend", + "static": 1, + "params": [ + { + "name": "mixins", + "description": "One or more Mixin classes", + "type": "Mixin", + "optional": true, + "multiple": true + }, + { + "name": "arguments", + "description": "Object containing values to use within the new class", + "type": "Object", + "optional": true, + "multiple": true + } + ], + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 950, + "description": "In some cases, you may want to annotate computed properties with additional\nmetadata about how they function or what values they operate on. For\nexample, computed property functions may close over variables that are then\nno longer available for introspection.\n\nYou can pass a hash of these values to a computed property like this:\n\n```javascript\nimport { computed } from '@ember/object';\n\nperson: computed(function() {\n let personId = this.get('personId');\n return Person.create({ id: personId });\n}).meta({ type: Person })\n```\n\nOnce you've done this, you can retrieve the values saved to the computed\nproperty from your class like this:\n\n```javascript\nMyClass.metaForProperty('person');\n```\n\nThis will return the original hash that was passed to `meta()`.", + "static": 1, + "itemtype": "method", + "name": "metaForProperty", + "params": [ + { + "name": "key", + "description": "property name", + "type": "String" + } + ], + "access": "private", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 810, + "description": "Augments a constructor's prototype with additional\nproperties and functions:\n\n```javascript\nimport EmberObject from '@ember/object';\n\nconst MyObject = EmberObject.extend({\n name: 'an object'\n});\n\no = MyObject.create();\no.get('name'); // 'an object'\n\nMyObject.reopen({\n say(msg) {\n console.log(msg);\n }\n});\n\no2 = MyObject.create();\no2.say('hello'); // logs \"hello\"\n\no.say('goodbye'); // logs \"goodbye\"\n```\n\nTo add functions and properties to the constructor itself,\nsee `reopenClass`", + "itemtype": "method", + "name": "reopen", + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object/core" + }, + { + "file": "packages/@ember/object/core.ts", + "line": 864, + "description": "Augments a constructor's own properties and functions:\n\n```javascript\nimport EmberObject from '@ember/object';\n\nconst MyObject = EmberObject.extend({\n name: 'an object'\n});\n\nMyObject.reopenClass({\n canBuild: false\n});\n\nMyObject.canBuild; // false\no = MyObject.create();\n```\n\nIn other words, this creates static properties and functions for the class.\nThese are only available on the class and not on any instance of that class.\n\n```javascript\nimport EmberObject from '@ember/object';\n\nconst Person = EmberObject.extend({\n name: '',\n sayHello() {\n alert(`Hello. My name is ${this.get('name')}`);\n }\n});\n\nPerson.reopenClass({\n species: 'Homo sapiens',\n\n createPerson(name) {\n return Person.create({ name });\n }\n});\n\nlet tom = Person.create({\n name: 'Tom Dale'\n});\nlet yehuda = Person.createPerson('Yehuda Katz');\n\ntom.sayHello(); // \"Hello. My name is Tom Dale\"\nyehuda.sayHello(); // \"Hello. My name is Yehuda Katz\"\nalert(Person.species); // \"Homo sapiens\"\n```\n\nNote that `species` and `createPerson` are *not* valid on the `tom` and `yehuda`\nvariables. They are only valid on `Person`.\n\nTo add functions and properties to instances of\na constructor by extending the constructor's prototype\nsee `reopen`", + "itemtype": "method", + "name": "reopenClass", + "static": 1, + "access": "public", + "tagname": "", + "class": "@ember/object", + "module": "@ember/object/core" + } + ] + }, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/object/evented.json b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/object/evented.json new file mode 100644 index 000000000..6f7ad38a3 --- /dev/null +++ b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/object/evented.json @@ -0,0 +1,35 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/object/evented", + "type": "module", + "attributes": { + "name": "@ember/object/evented", + "submodules": {}, + "elements": {}, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/object/evented.ts", + "line": 10, + "parent": null, + "publicclasses": [ + "Evented" + ], + "privateclasses": [], + "staticfunctions": {}, + "allstaticfunctions": {}, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/object/mixin.json b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/object/mixin.json new file mode 100644 index 000000000..d3420bb01 --- /dev/null +++ b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/object/mixin.json @@ -0,0 +1,79 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/object/mixin", + "type": "module", + "attributes": { + "name": "@ember/object/mixin", + "submodules": {}, + "elements": {}, + "fors": { + "@ember/object/mixin": 1 + }, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/object/mixin.ts", + "line": 455, + "parent": null, + "publicclasses": [ + "Mixin" + ], + "privateclasses": [], + "staticfunctions": { + "@ember/object/mixin": [ + { + "file": "packages/@ember/object/mixin.ts", + "line": 581, + "itemtype": "method", + "name": "create", + "static": 1, + "params": [ + { + "name": "arguments", + "description": "", + "multiple": true + } + ], + "access": "public", + "tagname": "", + "class": "@ember/object/mixin", + "module": "@ember/object/mixin" + } + ] + }, + "allstaticfunctions": { + "@ember/object/mixin": [ + { + "file": "packages/@ember/object/mixin.ts", + "line": 581, + "itemtype": "method", + "name": "create", + "static": 1, + "params": [ + { + "name": "arguments", + "description": "", + "multiple": true + } + ], + "access": "public", + "tagname": "", + "class": "@ember/object/mixin", + "module": "@ember/object/mixin" + } + ] + }, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/object/observable.json b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/object/observable.json new file mode 100644 index 000000000..8c4509ae4 --- /dev/null +++ b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/object/observable.json @@ -0,0 +1,35 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/object/observable", + "type": "module", + "attributes": { + "name": "@ember/object/observable", + "submodules": {}, + "elements": {}, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/object/observable.ts", + "line": 22, + "parent": null, + "publicclasses": [ + "Observable" + ], + "privateclasses": [], + "staticfunctions": {}, + "allstaticfunctions": {}, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/object/promise-proxy-mixin.json b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/object/promise-proxy-mixin.json new file mode 100644 index 000000000..6417fd006 --- /dev/null +++ b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/object/promise-proxy-mixin.json @@ -0,0 +1,35 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/object/promise-proxy-mixin", + "type": "module", + "attributes": { + "name": "@ember/object/promise-proxy-mixin", + "submodules": {}, + "elements": {}, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/object/promise-proxy-mixin.ts", + "line": 46, + "parent": null, + "publicclasses": [ + "PromiseProxyMixin" + ], + "privateclasses": [], + "staticfunctions": {}, + "allstaticfunctions": {}, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/object/proxy.json b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/object/proxy.json new file mode 100644 index 000000000..bf56f6930 --- /dev/null +++ b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/object/proxy.json @@ -0,0 +1,35 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/object/proxy", + "type": "module", + "attributes": { + "name": "@ember/object/proxy", + "submodules": {}, + "elements": {}, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/object/proxy.ts", + "line": 8, + "parent": null, + "publicclasses": [ + "ObjectProxy" + ], + "privateclasses": [], + "staticfunctions": {}, + "allstaticfunctions": {}, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/owner.json b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/owner.json new file mode 100644 index 000000000..2c16f9852 --- /dev/null +++ b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/owner.json @@ -0,0 +1,179 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/owner", + "type": "module", + "attributes": { + "name": "@ember/owner", + "submodules": {}, + "elements": {}, + "fors": { + "@ember/owner": 1 + }, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/-internals/owner/index.ts", + "line": 599, + "description": "

Ember’s dependency injection system is built on the idea of an "owner": an\nobject responsible for managing items which can be registered and looked up\nwith the system.

\n

This module does not provide any concrete instances of owners. Instead, it\ndefines the core type, Owner, which specifies the public API contract for an\nowner. The primary concrete implementations of Owner are EngineInstance,\nfrom @ember/engine/instance, and its ApplicationInstance subclass, from\n@ember/application/instance.

\n

Along with Owner itself, this module provides a number of supporting types\nrelated to Ember's DI system:

\n
    \n
  • Factory, Ember's primary interface for something which can create class\ninstances registered with the DI system.

    \n
  • \n
  • FactoryManager, an interface for inspecting a Factory's class.

    \n
  • \n
  • Resolver, an interface defining the contract for the object responsible\nfor mapping string names to the corresponding classes. For example, when you\nwrite @service('session'), a resolver is responsible to map that back to\nthe Session service class in your codebase. Normally, this is handled for\nyou automatically with ember-resolver, which is the main implementor of\nthis interface.

    \n
  • \n
\n

For more details on each, see their per-item docs.

\n", + "access": "public", + "tagname": "", + "parent": null, + "publicclasses": [ + "FullName", + "Owner", + "RegisterOptions", + "Factory", + "FactoryManager", + "Resolver" + ], + "privateclasses": [ + "BasicRegistry", + "BasicContainer", + "InternalFactory", + "ContainerProxy", + "RegistryProxy" + ], + "staticfunctions": { + "@ember/owner": [ + { + "file": "packages/@ember/owner/index.ts", + "line": 41, + "description": "Framework objects in an Ember application (components, services, routes, etc.)\nare created via a factory and dependency injection system. Each of these\nobjects is the responsibility of an \"owner\", which handled its\ninstantiation and manages its lifetime.\n\n`getOwner` fetches the owner object responsible for an instance. This can\nbe used to lookup or resolve other class instances, or register new factories\ninto the owner.\n\nFor example, this component dynamically looks up a service based on the\n`audioType` passed as an argument:\n\n```app/components/play-audio.js\nimport Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { getOwner } from '@ember/application';\n\n// Usage:\n//\n// \n//\nexport default class extends Component {\n get audioService() {\n return getOwner(this)?.lookup(`service:${this.args.audioType}`);\n }\n\n @action\n onPlay() {\n this.audioService?.play(this.args.audioFile);\n }\n}\n```", + "itemtype": "method", + "name": "getOwner", + "static": 1, + "params": [ + { + "name": "object", + "description": "An object with an owner.", + "type": "Object" + } + ], + "return": { + "description": "An owner object.", + "type": "Object" + }, + "since": "2.3.0", + "access": "public", + "tagname": "", + "class": "@ember/owner", + "module": "@ember/owner" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 544, + "description": "`setOwner` forces a new owner on a given object instance. This is primarily\nuseful in some testing cases.", + "itemtype": "method", + "name": "setOwner", + "static": 1, + "params": [ + { + "name": "object", + "description": "An object instance.", + "type": "Object" + }, + { + "name": "object", + "description": "The new owner object of the object instance.", + "type": "Owner" + } + ], + "since": "2.3.0", + "access": "public", + "tagname": "", + "class": "@ember/owner", + "module": "@ember/owner" + } + ] + }, + "allstaticfunctions": { + "@ember/owner": [ + { + "file": "packages/@ember/owner/index.ts", + "line": 41, + "description": "Framework objects in an Ember application (components, services, routes, etc.)\nare created via a factory and dependency injection system. Each of these\nobjects is the responsibility of an \"owner\", which handled its\ninstantiation and manages its lifetime.\n\n`getOwner` fetches the owner object responsible for an instance. This can\nbe used to lookup or resolve other class instances, or register new factories\ninto the owner.\n\nFor example, this component dynamically looks up a service based on the\n`audioType` passed as an argument:\n\n```app/components/play-audio.js\nimport Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { getOwner } from '@ember/application';\n\n// Usage:\n//\n// \n//\nexport default class extends Component {\n get audioService() {\n return getOwner(this)?.lookup(`service:${this.args.audioType}`);\n }\n\n @action\n onPlay() {\n this.audioService?.play(this.args.audioFile);\n }\n}\n```", + "itemtype": "method", + "name": "getOwner", + "static": 1, + "params": [ + { + "name": "object", + "description": "An object with an owner.", + "type": "Object" + } + ], + "return": { + "description": "An owner object.", + "type": "Object" + }, + "since": "2.3.0", + "access": "public", + "tagname": "", + "class": "@ember/owner", + "module": "@ember/owner" + }, + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 544, + "description": "`setOwner` forces a new owner on a given object instance. This is primarily\nuseful in some testing cases.", + "itemtype": "method", + "name": "setOwner", + "static": 1, + "params": [ + { + "name": "object", + "description": "An object instance.", + "type": "Object" + }, + { + "name": "object", + "description": "The new owner object of the object instance.", + "type": "Owner" + } + ], + "since": "2.3.0", + "access": "public", + "tagname": "", + "class": "@ember/owner", + "module": "@ember/owner" + } + ], + "InternalFactory": [ + { + "file": "packages/@ember/-internals/owner/index.ts", + "line": 526, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "isFactory", + "params": [ + { + "name": "obj", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "static": 1, + "class": "InternalFactory", + "module": "@ember/owner" + } + ] + }, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/renderer.json b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/renderer.json new file mode 100644 index 000000000..a35fa18f4 --- /dev/null +++ b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/renderer.json @@ -0,0 +1,39 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/renderer", + "type": "module", + "attributes": { + "name": "@ember/renderer", + "submodules": {}, + "elements": {}, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/routing/lib/cache.ts", + "line": 1, + "access": "public", + "tagname": "", + "parent": null, + "publicclasses": [ + "Renderer" + ], + "privateclasses": [ + "BucketCache" + ], + "staticfunctions": {}, + "allstaticfunctions": {}, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/routing.json b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/routing.json new file mode 100644 index 000000000..7df9e5336 --- /dev/null +++ b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/routing.json @@ -0,0 +1,36 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/routing", + "type": "module", + "attributes": { + "name": "@ember/routing", + "submodules": {}, + "elements": {}, + "fors": { + "Ember.Templates.helpers": 1, + "@ember/routing": 1 + }, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/-internals/glimmer/lib/components/link-to.ts", + "line": 251, + "parent": null, + "publicclasses": [], + "privateclasses": [], + "staticfunctions": {}, + "allstaticfunctions": {}, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/routing/hash-location.json b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/routing/hash-location.json new file mode 100644 index 000000000..3043c3929 --- /dev/null +++ b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/routing/hash-location.json @@ -0,0 +1,35 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/routing/hash-location", + "type": "module", + "attributes": { + "name": "@ember/routing/hash-location", + "submodules": {}, + "elements": {}, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/routing/hash-location.ts", + "line": 10, + "parent": null, + "publicclasses": [ + "HashLocation" + ], + "privateclasses": [], + "staticfunctions": {}, + "allstaticfunctions": {}, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/routing/history-location.json b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/routing/history-location.json new file mode 100644 index 000000000..54f767919 --- /dev/null +++ b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/routing/history-location.json @@ -0,0 +1,35 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/routing/history-location", + "type": "module", + "attributes": { + "name": "@ember/routing/history-location", + "submodules": {}, + "elements": {}, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/routing/history-location.ts", + "line": 21, + "parent": null, + "publicclasses": [ + "HistoryLocation" + ], + "privateclasses": [], + "staticfunctions": {}, + "allstaticfunctions": {}, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/routing/location.json b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/routing/location.json new file mode 100644 index 000000000..d7a41c1f4 --- /dev/null +++ b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/routing/location.json @@ -0,0 +1,37 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/routing/location", + "type": "module", + "attributes": { + "name": "@ember/routing/location", + "submodules": {}, + "elements": {}, + "fors": { + "@ember/routing/location": 1 + }, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/routing/location.ts", + "line": 5, + "parent": null, + "publicclasses": [ + "Location" + ], + "privateclasses": [], + "staticfunctions": {}, + "allstaticfunctions": {}, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/routing/none-location.json b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/routing/none-location.json new file mode 100644 index 000000000..e487e20ae --- /dev/null +++ b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/routing/none-location.json @@ -0,0 +1,35 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/routing/none-location", + "type": "module", + "attributes": { + "name": "@ember/routing/none-location", + "submodules": {}, + "elements": {}, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/routing/none-location.ts", + "line": 9, + "parent": null, + "publicclasses": [ + "NoneLocation" + ], + "privateclasses": [], + "staticfunctions": {}, + "allstaticfunctions": {}, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/routing/route-info.json b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/routing/route-info.json new file mode 100644 index 000000000..f1df03efe --- /dev/null +++ b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/routing/route-info.json @@ -0,0 +1,37 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/routing/route-info", + "type": "module", + "attributes": { + "name": "@ember/routing/route-info", + "submodules": {}, + "elements": {}, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/routing/route-info.ts", + "line": 124, + "description": "

Re-exports the RouteInfo and RouteInfoWithMetadata types from router.js.\nRouteInfo and RouteInfoWithMetadata appear as properties on Transition\ninstances.

\n", + "parent": null, + "publicclasses": [ + "RouteInfo", + "RouteInfoWithAttributes" + ], + "privateclasses": [], + "staticfunctions": {}, + "allstaticfunctions": {}, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/routing/route.json b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/routing/route.json new file mode 100644 index 000000000..621dbea2d --- /dev/null +++ b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/routing/route.json @@ -0,0 +1,37 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/routing/route", + "type": "module", + "attributes": { + "name": "@ember/routing/route", + "submodules": {}, + "elements": {}, + "fors": { + "Route": 1 + }, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/routing/route.ts", + "line": 79, + "parent": null, + "publicclasses": [ + "Route" + ], + "privateclasses": [], + "staticfunctions": {}, + "allstaticfunctions": {}, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/routing/router-service.json b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/routing/router-service.json new file mode 100644 index 000000000..1a2f34591 --- /dev/null +++ b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/routing/router-service.json @@ -0,0 +1,35 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/routing/router-service", + "type": "module", + "attributes": { + "name": "@ember/routing/router-service", + "submodules": {}, + "elements": {}, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/routing/router-service.ts", + "line": 27, + "parent": null, + "publicclasses": [ + "RouterService" + ], + "privateclasses": [], + "staticfunctions": {}, + "allstaticfunctions": {}, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/routing/router.json b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/routing/router.json new file mode 100644 index 000000000..6117e67c4 --- /dev/null +++ b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/routing/router.json @@ -0,0 +1,35 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/routing/router", + "type": "module", + "attributes": { + "name": "@ember/routing/router", + "submodules": {}, + "elements": {}, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/routing/router.ts", + "line": 145, + "parent": null, + "publicclasses": [ + "EmberRouter" + ], + "privateclasses": [], + "staticfunctions": {}, + "allstaticfunctions": {}, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/routing/transition.json b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/routing/transition.json new file mode 100644 index 000000000..31f627a10 --- /dev/null +++ b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/routing/transition.json @@ -0,0 +1,36 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/routing/transition", + "type": "module", + "attributes": { + "name": "@ember/routing/transition", + "submodules": {}, + "elements": {}, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/routing/transition.ts", + "line": 10, + "description": "

Re-exports the Transition type from router.js. Transitions are used in\nEmber's Route hooks and RouterService events.

\n", + "parent": null, + "publicclasses": [ + "Transition" + ], + "privateclasses": [], + "staticfunctions": {}, + "allstaticfunctions": {}, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/runloop.json b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/runloop.json new file mode 100644 index 000000000..6ef41c069 --- /dev/null +++ b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/runloop.json @@ -0,0 +1,927 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/runloop", + "type": "module", + "attributes": { + "name": "@ember/runloop", + "submodules": {}, + "elements": {}, + "fors": { + "@ember/runloop": 1 + }, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/runloop/index.ts", + "line": 101, + "parent": null, + "publicclasses": [], + "privateclasses": [], + "staticfunctions": { + "@ember/runloop": [ + { + "file": "packages/@ember/runloop/index.ts", + "line": 334, + "description": "Begins a new RunLoop. Any deferred actions invoked after the begin will\nbe buffered until you invoke a matching call to `end()`. This is\na lower-level way to use a RunLoop instead of using `run()`.\n\n```javascript\nimport { begin, end } from '@ember/runloop';\n\nbegin();\n// code to be executed within a RunLoop\nend();\n```", + "itemtype": "method", + "name": "begin", + "static": 1, + "return": { + "description": "", + "type": "Void" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 212, + "description": "Allows you to specify which context to call the specified function in while\nadding the execution of that function to the Ember run loop. This ability\nmakes this method a great way to asynchronously integrate third-party libraries\ninto your Ember application.\n\n`bind` takes two main arguments, the desired context and the function to\ninvoke in that context. Any additional arguments will be supplied as arguments\nto the function that is passed in.\n\nLet's use the creation of a TinyMCE component as an example. Currently,\nTinyMCE provides a setup configuration option we can use to do some processing\nafter the TinyMCE instance is initialized but before it is actually rendered.\nWe can use that setup option to do some additional setup for our component.\nThe component itself could look something like the following:\n\n```app/components/rich-text-editor.js\nimport Component from '@ember/component';\nimport { on } from '@ember/object/evented';\nimport { bind } from '@ember/runloop';\n\nexport default Component.extend({\n initializeTinyMCE: on('didInsertElement', function() {\n tinymce.init({\n selector: '#' + this.$().prop('id'),\n setup: bind(this, this.setupEditor)\n });\n }),\n\n didInsertElement() {\n tinymce.init({\n selector: '#' + this.$().prop('id'),\n setup: bind(this, this.setupEditor)\n });\n }\n\n setupEditor(editor) {\n this.set('editor', editor);\n\n editor.on('change', function() {\n console.log('content changed!');\n });\n }\n});\n```\n\nIn this example, we use `bind` to bind the setupEditor method to the\ncontext of the RichTextEditor component and to have the invocation of that\nmethod be safely handled and executed by the Ember run loop.", + "itemtype": "method", + "name": "bind", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to call", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "Method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Any additional arguments you wish to pass to the method.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "returns a new function that will always have a particular context", + "type": "Function" + }, + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 711, + "description": "Cancels a scheduled item. Must be a value returned by `later()`,\n`once()`, `scheduleOnce()`, `next()`, `debounce()`, or\n`throttle()`.\n\n```javascript\nimport {\n next,\n cancel,\n later,\n scheduleOnce,\n once,\n throttle,\n debounce\n} from '@ember/runloop';\n\nlet runNext = next(myContext, function() {\n // will not be executed\n});\n\ncancel(runNext);\n\nlet runLater = later(myContext, function() {\n // will not be executed\n}, 500);\n\ncancel(runLater);\n\nlet runScheduleOnce = scheduleOnce('afterRender', myContext, function() {\n // will not be executed\n});\n\ncancel(runScheduleOnce);\n\nlet runOnce = once(myContext, function() {\n // will not be executed\n});\n\ncancel(runOnce);\n\nlet throttle = throttle(myContext, function() {\n // will not be executed\n}, 1, false);\n\ncancel(throttle);\n\nlet debounce = debounce(myContext, function() {\n // will not be executed\n}, 1);\n\ncancel(debounce);\n\nlet debounceImmediate = debounce(myContext, function() {\n // will be executed since we passed in true (immediate)\n}, 100, true);\n\n// the 100ms delay until this method can be called again will be canceled\ncancel(debounceImmediate);\n```", + "itemtype": "method", + "name": "cancel", + "static": 1, + "params": [ + { + "name": "timer", + "description": "Timer object to cancel", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "true if canceled or false/undefined if it wasn't found", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 782, + "description": "Delay calling the target method until the debounce period has elapsed\nwith no additional debounce calls. If `debounce` is called again before\nthe specified time has elapsed, the timer is reset and the entire period\nmust pass again before the target method is called.\n\nThis method should be used when an event may be called multiple times\nbut the action should only be called once when the event is done firing.\nA common example is for scroll events where you only want updates to\nhappen once scrolling has ceased.\n\n```javascript\nimport { debounce } from '@ember/runloop';\n\nfunction whoRan() {\n console.log(this.name + ' ran.');\n}\n\nlet myContext = { name: 'debounce' };\n\ndebounce(myContext, whoRan, 150);\n\n// less than 150ms passes\ndebounce(myContext, whoRan, 150);\n\n// 150ms passes\n// whoRan is invoked with context myContext\n// console logs 'debounce ran.' one time.\n```\n\nImmediate allows you to run the function immediately, but debounce\nother calls for this function until the wait time has elapsed. If\n`debounce` is called again before the specified time has elapsed,\nthe timer is reset and the entire period must pass again before\nthe method can be called again.\n\n```javascript\nimport { debounce } from '@ember/runloop';\n\nfunction whoRan() {\n console.log(this.name + ' ran.');\n}\n\nlet myContext = { name: 'debounce' };\n\ndebounce(myContext, whoRan, 150, true);\n\n// console logs 'debounce ran.' one time immediately.\n// 100ms passes\ndebounce(myContext, whoRan, 150, true);\n\n// 150ms passes and nothing else is logged to the console and\n// the debouncee is no longer being watched\ndebounce(myContext, whoRan, 150, true);\n\n// console logs 'debounce ran.' one time immediately.\n// 150ms passes and nothing else is logged to the console and\n// the debouncee is no longer being watched\n```", + "itemtype": "method", + "name": "debounce", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to invoke", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + }, + { + "name": "wait", + "description": "Number of milliseconds to wait.", + "type": "Number" + }, + { + "name": "immediate", + "description": "Trigger the function on the leading instead\n of the trailing edge of the wait interval. Defaults to false.", + "type": "Boolean" + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 357, + "description": "Ends a RunLoop. This must be called sometime after you call\n`begin()` to flush any deferred actions. This is a lower-level way\nto use a RunLoop instead of using `run()`.\n\n```javascript\nimport { begin, end } from '@ember/runloop';\n\nbegin();\n// code to be executed within a RunLoop\nend();\n```", + "itemtype": "method", + "name": "end", + "static": 1, + "return": { + "description": "", + "type": "Void" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 153, + "description": "If no run-loop is present, it creates a new one. If a run loop is\npresent it will queue itself to run on the existing run-loops action\nqueue.\n\nPlease note: This is not for normal usage, and should be used sparingly.\n\nIf invoked when not within a run loop:\n\n```javascript\nimport { join } from '@ember/runloop';\n\njoin(function() {\n // creates a new run-loop\n});\n```\n\nAlternatively, if called within an existing run loop:\n\n```javascript\nimport { run, join } from '@ember/runloop';\n\nrun(function() {\n // creates a new run-loop\n\n join(function() {\n // joins with the existing run-loop, and queues for invocation on\n // the existing run-loops action queue.\n });\n});\n```", + "itemtype": "method", + "name": "join", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to call", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "Method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Any additional arguments you wish to pass to the method.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Return value from invoking the passed function. Please note,\nwhen called within an existing loop, no return value is possible.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 453, + "description": "Invokes the passed target/method and optional arguments after a specified\nperiod of time. The last parameter of this method must always be a number\nof milliseconds.\n\nYou should use this method whenever you need to run some action after a\nperiod of time instead of using `setTimeout()`. This method will ensure that\nitems that expire during the same script execution cycle all execute\ntogether, which is often more efficient than using a real setTimeout.\n\n```javascript\nimport { later } from '@ember/runloop';\n\nlater(myContext, function() {\n // code here will execute within a RunLoop in about 500ms with this == myContext\n}, 500);\n```", + "itemtype": "method", + "name": "later", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to invoke", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + }, + { + "name": "wait", + "description": "Number of milliseconds to wait.", + "type": "Number" + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 626, + "description": "Schedules an item to run from within a separate run loop, after\ncontrol has been returned to the system. This is equivalent to calling\n`later` with a wait time of 1ms.\n\n```javascript\nimport { next } from '@ember/runloop';\n\nnext(myContext, function() {\n // code to be executed in the next run loop,\n // which will be scheduled after the current one\n});\n```\n\nMultiple operations scheduled with `next` will coalesce\ninto the same later run loop, along with any other operations\nscheduled by `later` that expire right around the same\ntime that `next` operations will fire.\n\nNote that there are often alternatives to using `next`.\nFor instance, if you'd like to schedule an operation to happen\nafter all DOM element operations have completed within the current\nrun loop, you can make use of the `afterRender` run loop queue (added\nby the `ember-views` package, along with the preceding `render` queue\nwhere all the DOM element operations happen).\n\nExample:\n\n```app/components/my-component.js\nimport Component from '@ember/component';\nimport { scheduleOnce } from '@ember/runloop';\n\nexport Component.extend({\n didInsertElement() {\n this._super(...arguments);\n scheduleOnce('afterRender', this, 'processChildElements');\n },\n\n processChildElements() {\n // ... do something with component's child component\n // elements after they've finished rendering, which\n // can't be done within this component's\n // `didInsertElement` hook because that gets run\n // before the child elements have been added to the DOM.\n }\n});\n```\n\nOne benefit of the above approach compared to using `next` is\nthat you will be able to perform DOM/CSS operations before unprocessed\nelements are rendered to the screen, which may prevent flickering or\nother artifacts caused by delaying processing until after rendering.\n\nThe other major benefit to the above approach is that `next`\nintroduces an element of non-determinism, which can make things much\nharder to test, due to its reliance on `setTimeout`; it's much harder\nto guarantee the order of scheduled operations when they are scheduled\noutside of the current run loop, i.e. with `next`.", + "itemtype": "method", + "name": "next", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to invoke", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 501, + "description": "Schedule a function to run one time during the current RunLoop. This is equivalent\n to calling `scheduleOnce` with the \"actions\" queue.", + "itemtype": "method", + "name": "once", + "static": 1, + "params": [ + { + "name": "target", + "description": "The target of the method to invoke.", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 108, + "description": "Runs the passed target and method inside of a RunLoop, ensuring any\ndeferred actions including bindings and views updates are flushed at the\nend.\n\nNormally you should not need to invoke this method yourself. However if\nyou are implementing raw event handlers when interfacing with other\nlibraries or plugins, you should probably wrap all of your code inside this\ncall.\n\n```javascript\nimport { run } from '@ember/runloop';\n\nrun(function() {\n // code to be executed within a RunLoop\n});\n```", + "itemtype": "method", + "name": "run", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to call", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "Method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Any additional arguments you wish to pass to the method.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "return value from invoking the passed function.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 380, + "description": "Adds the passed target/method and any optional arguments to the named\nqueue to be executed at the end of the RunLoop. If you have not already\nstarted a RunLoop when calling this method one will be started for you\nautomatically.\n\nAt the end of a RunLoop, any methods scheduled in this way will be invoked.\nMethods will be invoked in an order matching the named queues defined in\nthe `queues` property.\n\n```javascript\nimport { schedule } from '@ember/runloop';\n\nschedule('afterRender', this, function() {\n // this will be executed in the 'afterRender' queue\n console.log('scheduled on afterRender queue');\n});\n\nschedule('actions', this, function() {\n // this will be executed in the 'actions' queue\n console.log('scheduled on actions queue');\n});\n\n// Note the functions will be run in order based on the run queues order.\n// Output would be:\n// scheduled on actions queue\n// scheduled on afterRender queue\n```", + "itemtype": "method", + "name": "schedule", + "static": 1, + "params": [ + { + "name": "queue", + "description": "The name of the queue to schedule against. Default queues is 'actions'", + "type": "String" + }, + { + "name": "target", + "description": "target object to use as the context when invoking a method.", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke. If you pass a string it\n will be resolved on the target object at the time the scheduled item is\n invoked allowing you to change the target function.", + "type": "String|Function" + }, + { + "name": "arguments*", + "description": "Optional arguments to be passed to the queued method.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 532, + "description": "Schedules a function to run one time in a given queue of the current RunLoop.\nCalling this method with the same queue/target/method combination will have\nno effect (past the initial call).\n\nNote that although you can pass optional arguments these will not be\nconsidered when looking for duplicates. New arguments will replace previous\ncalls.\n\n```javascript\nimport { run, scheduleOnce } from '@ember/runloop';\n\nfunction sayHi() {\n console.log('hi');\n}\n\nrun(function() {\n scheduleOnce('afterRender', myContext, sayHi);\n scheduleOnce('afterRender', myContext, sayHi);\n // sayHi will only be executed once, in the afterRender queue of the RunLoop\n});\n```\n\nAlso note that for `scheduleOnce` to prevent additional calls, you need to\npass the same function instance. The following case works as expected:\n\n```javascript\nfunction log() {\n console.log('Logging only once');\n}\n\nfunction scheduleIt() {\n scheduleOnce('actions', myContext, log);\n}\n\nscheduleIt();\nscheduleIt();\n```\n\nBut this other case will schedule the function multiple times:\n\n```javascript\nimport { scheduleOnce } from '@ember/runloop';\n\nfunction scheduleIt() {\n scheduleOnce('actions', myContext, function() {\n console.log('Closure');\n });\n}\n\nscheduleIt();\nscheduleIt();\n\n// \"Closure\" will print twice, even though we're using `scheduleOnce`,\n// because the function we pass to it won't match the\n// previously scheduled operation.\n```\n\nAvailable queues, and their order, can be found at `queues`", + "itemtype": "method", + "name": "scheduleOnce", + "static": 1, + "params": [ + { + "name": "queue", + "description": "The name of the queue to schedule against. Default queues is 'actions'.", + "type": "String", + "optional": true + }, + { + "name": "target", + "description": "The target of the method to invoke.", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 879, + "description": "Ensure that the target method is never called more frequently than\nthe specified spacing period. The target method is called immediately.\n\n```javascript\nimport { throttle } from '@ember/runloop';\n\nfunction whoRan() {\n console.log(this.name + ' ran.');\n}\n\nlet myContext = { name: 'throttle' };\n\nthrottle(myContext, whoRan, 150);\n// whoRan is invoked with context myContext\n// console logs 'throttle ran.'\n\n// 50ms passes\nthrottle(myContext, whoRan, 150);\n\n// 50ms passes\nthrottle(myContext, whoRan, 150);\n\n// 150ms passes\nthrottle(myContext, whoRan, 150);\n// whoRan is invoked with context myContext\n// console logs 'throttle ran.'\n```", + "itemtype": "method", + "name": "throttle", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to invoke", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + }, + { + "name": "spacing", + "description": "Number of milliseconds to space out requests.", + "type": "Number" + }, + { + "name": "immediate", + "description": "Trigger the function on the leading instead\n of the trailing edge of the wait interval. Defaults to true.", + "type": "Boolean" + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + } + ] + }, + "allstaticfunctions": { + "@ember/runloop": [ + { + "file": "packages/@ember/runloop/index.ts", + "line": 334, + "description": "Begins a new RunLoop. Any deferred actions invoked after the begin will\nbe buffered until you invoke a matching call to `end()`. This is\na lower-level way to use a RunLoop instead of using `run()`.\n\n```javascript\nimport { begin, end } from '@ember/runloop';\n\nbegin();\n// code to be executed within a RunLoop\nend();\n```", + "itemtype": "method", + "name": "begin", + "static": 1, + "return": { + "description": "", + "type": "Void" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 212, + "description": "Allows you to specify which context to call the specified function in while\nadding the execution of that function to the Ember run loop. This ability\nmakes this method a great way to asynchronously integrate third-party libraries\ninto your Ember application.\n\n`bind` takes two main arguments, the desired context and the function to\ninvoke in that context. Any additional arguments will be supplied as arguments\nto the function that is passed in.\n\nLet's use the creation of a TinyMCE component as an example. Currently,\nTinyMCE provides a setup configuration option we can use to do some processing\nafter the TinyMCE instance is initialized but before it is actually rendered.\nWe can use that setup option to do some additional setup for our component.\nThe component itself could look something like the following:\n\n```app/components/rich-text-editor.js\nimport Component from '@ember/component';\nimport { on } from '@ember/object/evented';\nimport { bind } from '@ember/runloop';\n\nexport default Component.extend({\n initializeTinyMCE: on('didInsertElement', function() {\n tinymce.init({\n selector: '#' + this.$().prop('id'),\n setup: bind(this, this.setupEditor)\n });\n }),\n\n didInsertElement() {\n tinymce.init({\n selector: '#' + this.$().prop('id'),\n setup: bind(this, this.setupEditor)\n });\n }\n\n setupEditor(editor) {\n this.set('editor', editor);\n\n editor.on('change', function() {\n console.log('content changed!');\n });\n }\n});\n```\n\nIn this example, we use `bind` to bind the setupEditor method to the\ncontext of the RichTextEditor component and to have the invocation of that\nmethod be safely handled and executed by the Ember run loop.", + "itemtype": "method", + "name": "bind", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to call", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "Method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Any additional arguments you wish to pass to the method.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "returns a new function that will always have a particular context", + "type": "Function" + }, + "since": "1.4.0", + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 711, + "description": "Cancels a scheduled item. Must be a value returned by `later()`,\n`once()`, `scheduleOnce()`, `next()`, `debounce()`, or\n`throttle()`.\n\n```javascript\nimport {\n next,\n cancel,\n later,\n scheduleOnce,\n once,\n throttle,\n debounce\n} from '@ember/runloop';\n\nlet runNext = next(myContext, function() {\n // will not be executed\n});\n\ncancel(runNext);\n\nlet runLater = later(myContext, function() {\n // will not be executed\n}, 500);\n\ncancel(runLater);\n\nlet runScheduleOnce = scheduleOnce('afterRender', myContext, function() {\n // will not be executed\n});\n\ncancel(runScheduleOnce);\n\nlet runOnce = once(myContext, function() {\n // will not be executed\n});\n\ncancel(runOnce);\n\nlet throttle = throttle(myContext, function() {\n // will not be executed\n}, 1, false);\n\ncancel(throttle);\n\nlet debounce = debounce(myContext, function() {\n // will not be executed\n}, 1);\n\ncancel(debounce);\n\nlet debounceImmediate = debounce(myContext, function() {\n // will be executed since we passed in true (immediate)\n}, 100, true);\n\n// the 100ms delay until this method can be called again will be canceled\ncancel(debounceImmediate);\n```", + "itemtype": "method", + "name": "cancel", + "static": 1, + "params": [ + { + "name": "timer", + "description": "Timer object to cancel", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "true if canceled or false/undefined if it wasn't found", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 782, + "description": "Delay calling the target method until the debounce period has elapsed\nwith no additional debounce calls. If `debounce` is called again before\nthe specified time has elapsed, the timer is reset and the entire period\nmust pass again before the target method is called.\n\nThis method should be used when an event may be called multiple times\nbut the action should only be called once when the event is done firing.\nA common example is for scroll events where you only want updates to\nhappen once scrolling has ceased.\n\n```javascript\nimport { debounce } from '@ember/runloop';\n\nfunction whoRan() {\n console.log(this.name + ' ran.');\n}\n\nlet myContext = { name: 'debounce' };\n\ndebounce(myContext, whoRan, 150);\n\n// less than 150ms passes\ndebounce(myContext, whoRan, 150);\n\n// 150ms passes\n// whoRan is invoked with context myContext\n// console logs 'debounce ran.' one time.\n```\n\nImmediate allows you to run the function immediately, but debounce\nother calls for this function until the wait time has elapsed. If\n`debounce` is called again before the specified time has elapsed,\nthe timer is reset and the entire period must pass again before\nthe method can be called again.\n\n```javascript\nimport { debounce } from '@ember/runloop';\n\nfunction whoRan() {\n console.log(this.name + ' ran.');\n}\n\nlet myContext = { name: 'debounce' };\n\ndebounce(myContext, whoRan, 150, true);\n\n// console logs 'debounce ran.' one time immediately.\n// 100ms passes\ndebounce(myContext, whoRan, 150, true);\n\n// 150ms passes and nothing else is logged to the console and\n// the debouncee is no longer being watched\ndebounce(myContext, whoRan, 150, true);\n\n// console logs 'debounce ran.' one time immediately.\n// 150ms passes and nothing else is logged to the console and\n// the debouncee is no longer being watched\n```", + "itemtype": "method", + "name": "debounce", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to invoke", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + }, + { + "name": "wait", + "description": "Number of milliseconds to wait.", + "type": "Number" + }, + { + "name": "immediate", + "description": "Trigger the function on the leading instead\n of the trailing edge of the wait interval. Defaults to false.", + "type": "Boolean" + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 357, + "description": "Ends a RunLoop. This must be called sometime after you call\n`begin()` to flush any deferred actions. This is a lower-level way\nto use a RunLoop instead of using `run()`.\n\n```javascript\nimport { begin, end } from '@ember/runloop';\n\nbegin();\n// code to be executed within a RunLoop\nend();\n```", + "itemtype": "method", + "name": "end", + "static": 1, + "return": { + "description": "", + "type": "Void" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 153, + "description": "If no run-loop is present, it creates a new one. If a run loop is\npresent it will queue itself to run on the existing run-loops action\nqueue.\n\nPlease note: This is not for normal usage, and should be used sparingly.\n\nIf invoked when not within a run loop:\n\n```javascript\nimport { join } from '@ember/runloop';\n\njoin(function() {\n // creates a new run-loop\n});\n```\n\nAlternatively, if called within an existing run loop:\n\n```javascript\nimport { run, join } from '@ember/runloop';\n\nrun(function() {\n // creates a new run-loop\n\n join(function() {\n // joins with the existing run-loop, and queues for invocation on\n // the existing run-loops action queue.\n });\n});\n```", + "itemtype": "method", + "name": "join", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to call", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "Method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Any additional arguments you wish to pass to the method.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Return value from invoking the passed function. Please note,\nwhen called within an existing loop, no return value is possible.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 453, + "description": "Invokes the passed target/method and optional arguments after a specified\nperiod of time. The last parameter of this method must always be a number\nof milliseconds.\n\nYou should use this method whenever you need to run some action after a\nperiod of time instead of using `setTimeout()`. This method will ensure that\nitems that expire during the same script execution cycle all execute\ntogether, which is often more efficient than using a real setTimeout.\n\n```javascript\nimport { later } from '@ember/runloop';\n\nlater(myContext, function() {\n // code here will execute within a RunLoop in about 500ms with this == myContext\n}, 500);\n```", + "itemtype": "method", + "name": "later", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to invoke", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + }, + { + "name": "wait", + "description": "Number of milliseconds to wait.", + "type": "Number" + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 626, + "description": "Schedules an item to run from within a separate run loop, after\ncontrol has been returned to the system. This is equivalent to calling\n`later` with a wait time of 1ms.\n\n```javascript\nimport { next } from '@ember/runloop';\n\nnext(myContext, function() {\n // code to be executed in the next run loop,\n // which will be scheduled after the current one\n});\n```\n\nMultiple operations scheduled with `next` will coalesce\ninto the same later run loop, along with any other operations\nscheduled by `later` that expire right around the same\ntime that `next` operations will fire.\n\nNote that there are often alternatives to using `next`.\nFor instance, if you'd like to schedule an operation to happen\nafter all DOM element operations have completed within the current\nrun loop, you can make use of the `afterRender` run loop queue (added\nby the `ember-views` package, along with the preceding `render` queue\nwhere all the DOM element operations happen).\n\nExample:\n\n```app/components/my-component.js\nimport Component from '@ember/component';\nimport { scheduleOnce } from '@ember/runloop';\n\nexport Component.extend({\n didInsertElement() {\n this._super(...arguments);\n scheduleOnce('afterRender', this, 'processChildElements');\n },\n\n processChildElements() {\n // ... do something with component's child component\n // elements after they've finished rendering, which\n // can't be done within this component's\n // `didInsertElement` hook because that gets run\n // before the child elements have been added to the DOM.\n }\n});\n```\n\nOne benefit of the above approach compared to using `next` is\nthat you will be able to perform DOM/CSS operations before unprocessed\nelements are rendered to the screen, which may prevent flickering or\nother artifacts caused by delaying processing until after rendering.\n\nThe other major benefit to the above approach is that `next`\nintroduces an element of non-determinism, which can make things much\nharder to test, due to its reliance on `setTimeout`; it's much harder\nto guarantee the order of scheduled operations when they are scheduled\noutside of the current run loop, i.e. with `next`.", + "itemtype": "method", + "name": "next", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to invoke", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 501, + "description": "Schedule a function to run one time during the current RunLoop. This is equivalent\n to calling `scheduleOnce` with the \"actions\" queue.", + "itemtype": "method", + "name": "once", + "static": 1, + "params": [ + { + "name": "target", + "description": "The target of the method to invoke.", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 108, + "description": "Runs the passed target and method inside of a RunLoop, ensuring any\ndeferred actions including bindings and views updates are flushed at the\nend.\n\nNormally you should not need to invoke this method yourself. However if\nyou are implementing raw event handlers when interfacing with other\nlibraries or plugins, you should probably wrap all of your code inside this\ncall.\n\n```javascript\nimport { run } from '@ember/runloop';\n\nrun(function() {\n // code to be executed within a RunLoop\n});\n```", + "itemtype": "method", + "name": "run", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to call", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "Method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Any additional arguments you wish to pass to the method.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "return value from invoking the passed function.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 380, + "description": "Adds the passed target/method and any optional arguments to the named\nqueue to be executed at the end of the RunLoop. If you have not already\nstarted a RunLoop when calling this method one will be started for you\nautomatically.\n\nAt the end of a RunLoop, any methods scheduled in this way will be invoked.\nMethods will be invoked in an order matching the named queues defined in\nthe `queues` property.\n\n```javascript\nimport { schedule } from '@ember/runloop';\n\nschedule('afterRender', this, function() {\n // this will be executed in the 'afterRender' queue\n console.log('scheduled on afterRender queue');\n});\n\nschedule('actions', this, function() {\n // this will be executed in the 'actions' queue\n console.log('scheduled on actions queue');\n});\n\n// Note the functions will be run in order based on the run queues order.\n// Output would be:\n// scheduled on actions queue\n// scheduled on afterRender queue\n```", + "itemtype": "method", + "name": "schedule", + "static": 1, + "params": [ + { + "name": "queue", + "description": "The name of the queue to schedule against. Default queues is 'actions'", + "type": "String" + }, + { + "name": "target", + "description": "target object to use as the context when invoking a method.", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke. If you pass a string it\n will be resolved on the target object at the time the scheduled item is\n invoked allowing you to change the target function.", + "type": "String|Function" + }, + { + "name": "arguments*", + "description": "Optional arguments to be passed to the queued method.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "*" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 532, + "description": "Schedules a function to run one time in a given queue of the current RunLoop.\nCalling this method with the same queue/target/method combination will have\nno effect (past the initial call).\n\nNote that although you can pass optional arguments these will not be\nconsidered when looking for duplicates. New arguments will replace previous\ncalls.\n\n```javascript\nimport { run, scheduleOnce } from '@ember/runloop';\n\nfunction sayHi() {\n console.log('hi');\n}\n\nrun(function() {\n scheduleOnce('afterRender', myContext, sayHi);\n scheduleOnce('afterRender', myContext, sayHi);\n // sayHi will only be executed once, in the afterRender queue of the RunLoop\n});\n```\n\nAlso note that for `scheduleOnce` to prevent additional calls, you need to\npass the same function instance. The following case works as expected:\n\n```javascript\nfunction log() {\n console.log('Logging only once');\n}\n\nfunction scheduleIt() {\n scheduleOnce('actions', myContext, log);\n}\n\nscheduleIt();\nscheduleIt();\n```\n\nBut this other case will schedule the function multiple times:\n\n```javascript\nimport { scheduleOnce } from '@ember/runloop';\n\nfunction scheduleIt() {\n scheduleOnce('actions', myContext, function() {\n console.log('Closure');\n });\n}\n\nscheduleIt();\nscheduleIt();\n\n// \"Closure\" will print twice, even though we're using `scheduleOnce`,\n// because the function we pass to it won't match the\n// previously scheduled operation.\n```\n\nAvailable queues, and their order, can be found at `queues`", + "itemtype": "method", + "name": "scheduleOnce", + "static": 1, + "params": [ + { + "name": "queue", + "description": "The name of the queue to schedule against. Default queues is 'actions'.", + "type": "String", + "optional": true + }, + { + "name": "target", + "description": "The target of the method to invoke.", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n If you pass a string it will be resolved on the\n target at the time the method is invoked.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + }, + { + "file": "packages/@ember/runloop/index.ts", + "line": 879, + "description": "Ensure that the target method is never called more frequently than\nthe specified spacing period. The target method is called immediately.\n\n```javascript\nimport { throttle } from '@ember/runloop';\n\nfunction whoRan() {\n console.log(this.name + ' ran.');\n}\n\nlet myContext = { name: 'throttle' };\n\nthrottle(myContext, whoRan, 150);\n// whoRan is invoked with context myContext\n// console logs 'throttle ran.'\n\n// 50ms passes\nthrottle(myContext, whoRan, 150);\n\n// 50ms passes\nthrottle(myContext, whoRan, 150);\n\n// 150ms passes\nthrottle(myContext, whoRan, 150);\n// whoRan is invoked with context myContext\n// console logs 'throttle ran.'\n```", + "itemtype": "method", + "name": "throttle", + "static": 1, + "params": [ + { + "name": "target", + "description": "target of method to invoke", + "type": "Object", + "optional": true + }, + { + "name": "method", + "description": "The method to invoke.\n May be a function or a string. If you pass a string\n then it will be looked up on the passed target.", + "type": "Function|String" + }, + { + "name": "args*", + "description": "Optional arguments to pass to the timeout.", + "type": "Object", + "optional": true + }, + { + "name": "spacing", + "description": "Number of milliseconds to space out requests.", + "type": "Number" + }, + { + "name": "immediate", + "description": "Trigger the function on the leading instead\n of the trailing edge of the wait interval. Defaults to true.", + "type": "Boolean" + } + ], + "return": { + "description": "Timer information for use in canceling, see `cancel`.", + "type": "Array" + }, + "access": "public", + "tagname": "", + "class": "@ember/runloop", + "module": "@ember/runloop" + } + ] + }, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/service.json b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/service.json new file mode 100644 index 000000000..2b8b3cbb9 --- /dev/null +++ b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/service.json @@ -0,0 +1,139 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/service", + "type": "module", + "attributes": { + "name": "@ember/service", + "submodules": {}, + "elements": {}, + "fors": { + "@ember/service": 1 + }, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/service/index.ts", + "line": 87, + "access": "public", + "tagname": "", + "parent": null, + "publicclasses": [ + "Service" + ], + "privateclasses": [], + "staticfunctions": { + "@ember/service": [ + { + "file": "packages/@ember/service/index.ts", + "line": 10, + "itemtype": "method", + "name": "inject", + "static": 1, + "since": "1.10.0", + "params": [ + { + "name": "name", + "description": "(optional) name of the service to inject, defaults to\n the property's name", + "type": "String" + } + ], + "return": { + "description": "injection decorator instance", + "type": "ComputedDecorator" + }, + "access": "public", + "tagname": "", + "class": "@ember/service", + "module": "@ember/service" + }, + { + "file": "packages/@ember/service/index.ts", + "line": 30, + "description": "Creates a property that lazily looks up a service in the container. There are\nno restrictions as to what objects a service can be injected into.\n\nExample:\n\n```app/routes/application.js\nimport Route from '@ember/routing/route';\nimport { service } from '@ember/service';\n\nexport default class ApplicationRoute extends Route {\n @service('auth') authManager;\n\n model() {\n return this.authManager.findCurrentUser();\n }\n}\n```\n\nClassic Class Example:\n\n```app/routes/application.js\nimport Route from '@ember/routing/route';\nimport { service } from '@ember/service';\n\nexport default Route.extend({\n authManager: service('auth'),\n\n model() {\n return this.get('authManager').findCurrentUser();\n }\n});\n```\n\nThis example will create an `authManager` property on the application route\nthat looks up the `auth` service in the container, making it easily accessible\nin the `model` hook.", + "itemtype": "method", + "name": "service", + "static": 1, + "since": "4.1.0", + "params": [ + { + "name": "name", + "description": "(optional) name of the service to inject, defaults to\n the property's name", + "type": "String" + } + ], + "return": { + "description": "injection decorator instance", + "type": "ComputedDecorator" + }, + "access": "public", + "tagname": "", + "class": "@ember/service", + "module": "@ember/service" + } + ] + }, + "allstaticfunctions": { + "@ember/service": [ + { + "file": "packages/@ember/service/index.ts", + "line": 10, + "itemtype": "method", + "name": "inject", + "static": 1, + "since": "1.10.0", + "params": [ + { + "name": "name", + "description": "(optional) name of the service to inject, defaults to\n the property's name", + "type": "String" + } + ], + "return": { + "description": "injection decorator instance", + "type": "ComputedDecorator" + }, + "access": "public", + "tagname": "", + "class": "@ember/service", + "module": "@ember/service" + }, + { + "file": "packages/@ember/service/index.ts", + "line": 30, + "description": "Creates a property that lazily looks up a service in the container. There are\nno restrictions as to what objects a service can be injected into.\n\nExample:\n\n```app/routes/application.js\nimport Route from '@ember/routing/route';\nimport { service } from '@ember/service';\n\nexport default class ApplicationRoute extends Route {\n @service('auth') authManager;\n\n model() {\n return this.authManager.findCurrentUser();\n }\n}\n```\n\nClassic Class Example:\n\n```app/routes/application.js\nimport Route from '@ember/routing/route';\nimport { service } from '@ember/service';\n\nexport default Route.extend({\n authManager: service('auth'),\n\n model() {\n return this.get('authManager').findCurrentUser();\n }\n});\n```\n\nThis example will create an `authManager` property on the application route\nthat looks up the `auth` service in the container, making it easily accessible\nin the `model` hook.", + "itemtype": "method", + "name": "service", + "static": 1, + "since": "4.1.0", + "params": [ + { + "name": "name", + "description": "(optional) name of the service to inject, defaults to\n the property's name", + "type": "String" + } + ], + "return": { + "description": "injection decorator instance", + "type": "ComputedDecorator" + }, + "access": "public", + "tagname": "", + "class": "@ember/service", + "module": "@ember/service" + } + ] + }, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/template.json b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/template.json new file mode 100644 index 000000000..0a2c24a21 --- /dev/null +++ b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/template.json @@ -0,0 +1,121 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/template", + "type": "module", + "attributes": { + "name": "@ember/template", + "submodules": {}, + "elements": {}, + "fors": { + "@ember/template": 1 + }, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/-internals/glimmer/lib/utils/string.ts", + "line": 7, + "parent": null, + "publicclasses": [ + "SafeString" + ], + "privateclasses": [], + "staticfunctions": { + "@ember/template": [ + { + "file": "packages/@ember/-internals/glimmer/lib/utils/string.ts", + "line": 121, + "description": "Use this method to indicate that a string should be rendered as HTML\nwhen the string is used in a template. To say this another way,\nstrings marked with `htmlSafe` will not be HTML escaped.\n\nA word of warning - The `htmlSafe` method does not make the string safe;\nit only tells the framework to treat the string as if it is safe to render\nas HTML. If a string contains user inputs or other untrusted\ndata, you must sanitize the string before using the `htmlSafe` method.\nOtherwise your code is vulnerable to\n[Cross-Site Scripting](https://owasp.org/www-community/attacks/DOM_Based_XSS).\nThere are many open source sanitization libraries to choose from,\nboth for front end and server-side sanitization.\n\n```javascript\nimport { htmlSafe } from '@ember/template';\n\nconst someTrustedOrSanitizedString = \"
Hello!
\"\n\nhtmlSafe(someTrustedorSanitizedString)\n```", + "itemtype": "method", + "name": "htmlSafe", + "params": [ + { + "name": "str", + "description": "The string to treat as trusted.", + "type": "String" + } + ], + "static": 1, + "return": { + "description": "A string that will not be HTML escaped by Handlebars.", + "type": "SafeString" + }, + "access": "public", + "tagname": "", + "class": "@ember/template", + "module": "@ember/template" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/utils/string.ts", + "line": 159, + "description": "Detects if a string was decorated using `htmlSafe`.\n\n```javascript\nimport { htmlSafe, isHTMLSafe } from '@ember/template';\n\nlet plainString = 'plain string';\nlet safeString = htmlSafe('
someValue
');\n\nisHTMLSafe(plainString); // false\nisHTMLSafe(safeString); // true\n```", + "itemtype": "method", + "name": "isHTMLSafe", + "static": 1, + "return": { + "description": "`true` if the string was decorated with `htmlSafe`, `false` otherwise.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/template", + "module": "@ember/template" + } + ] + }, + "allstaticfunctions": { + "@ember/template": [ + { + "file": "packages/@ember/-internals/glimmer/lib/utils/string.ts", + "line": 121, + "description": "Use this method to indicate that a string should be rendered as HTML\nwhen the string is used in a template. To say this another way,\nstrings marked with `htmlSafe` will not be HTML escaped.\n\nA word of warning - The `htmlSafe` method does not make the string safe;\nit only tells the framework to treat the string as if it is safe to render\nas HTML. If a string contains user inputs or other untrusted\ndata, you must sanitize the string before using the `htmlSafe` method.\nOtherwise your code is vulnerable to\n[Cross-Site Scripting](https://owasp.org/www-community/attacks/DOM_Based_XSS).\nThere are many open source sanitization libraries to choose from,\nboth for front end and server-side sanitization.\n\n```javascript\nimport { htmlSafe } from '@ember/template';\n\nconst someTrustedOrSanitizedString = \"
Hello!
\"\n\nhtmlSafe(someTrustedorSanitizedString)\n```", + "itemtype": "method", + "name": "htmlSafe", + "params": [ + { + "name": "str", + "description": "The string to treat as trusted.", + "type": "String" + } + ], + "static": 1, + "return": { + "description": "A string that will not be HTML escaped by Handlebars.", + "type": "SafeString" + }, + "access": "public", + "tagname": "", + "class": "@ember/template", + "module": "@ember/template" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/utils/string.ts", + "line": 159, + "description": "Detects if a string was decorated using `htmlSafe`.\n\n```javascript\nimport { htmlSafe, isHTMLSafe } from '@ember/template';\n\nlet plainString = 'plain string';\nlet safeString = htmlSafe('
someValue
');\n\nisHTMLSafe(plainString); // false\nisHTMLSafe(safeString); // true\n```", + "itemtype": "method", + "name": "isHTMLSafe", + "static": 1, + "return": { + "description": "`true` if the string was decorated with `htmlSafe`, `false` otherwise.", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/template", + "module": "@ember/template" + } + ] + }, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/test.json b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/test.json new file mode 100644 index 000000000..601e6b820 --- /dev/null +++ b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/test.json @@ -0,0 +1,266 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/test", + "type": "module", + "attributes": { + "name": "@ember/test", + "submodules": {}, + "elements": {}, + "fors": { + "@ember/test": 1, + "Ember.Test": 1 + }, + "namespaces": { + "Ember": 1 + }, + "tag": "module", + "file": "packages/ember-testing/lib/adapters/adapter.ts", + "line": 7, + "parent": null, + "publicclasses": [ + "TestAdapter" + ], + "privateclasses": [], + "staticfunctions": { + "@ember/test": [ + { + "file": "packages/ember-testing/lib/test/waiters.ts", + "line": 98, + "description": "Iterates through each registered test waiter, and invokes\nits callback. If any waiter returns false, this method will return\ntrue indicating that the waiters have not settled yet.\n\nThis is generally used internally from the acceptance/integration test\ninfrastructure.", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "checkWaiters", + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/helpers.ts", + "line": 16, + "description": "`registerHelper` is used to register a test helper that will be injected\nwhen `App.injectTestHelpers` is called.\n\nThe helper method will always be called with the current Application as\nthe first parameter.\n\nFor example:\n\n```javascript\nimport { registerHelper } from '@ember/test';\nimport { run } from '@ember/runloop';\n\nregisterHelper('boot', function(app) {\n run(app, app.advanceReadiness);\n});\n```\n\nThis helper can later be called without arguments because it will be\ncalled with `app` as the first parameter.\n\n```javascript\nimport Application from '@ember/application';\n\nApp = Application.create();\nApp.injectTestHelpers();\nboot();\n```", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "registerHelper", + "params": [ + { + "name": "name", + "description": "The name of the helper method to add.", + "type": "String" + }, + { + "name": "helperMethod", + "description": "", + "type": "Function" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/waiters.ts", + "line": 7, + "description": "This allows ember-testing to play nicely with other asynchronous\nevents, such as an application that is waiting for a CSS3\ntransition or an IndexDB transaction. The waiter runs periodically\nafter each async helper (i.e. `click`, `andThen`, `visit`, etc) has executed,\nuntil the returning result is truthy. After the waiters finish, the next async helper\nis executed and the process repeats.\n\nFor example:\n\n```javascript\nimport { registerWaiter } from '@ember/test';\n\nregisterWaiter(function() {\n return myPendingTransactions() === 0;\n});\n```\nThe `context` argument allows you to optionally specify the `this`\nwith which your callback will be invoked.\n\nFor example:\n\n```javascript\nimport { registerWaiter } from '@ember/test';\n\nregisterWaiter(MyDB, MyDB.hasPendingTransactions);\n```", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "registerWaiter", + "params": [ + { + "name": "context", + "description": "(optional)", + "type": "Object" + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "since": "1.2.0", + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/helpers.ts", + "line": 116, + "description": "Remove a previously added helper method.\n\nExample:\n\n```javascript\nimport { unregisterHelper } from '@ember/test';\n\nunregisterHelper('wait');\n```", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregisterHelper", + "static": 1, + "params": [ + { + "name": "name", + "description": "The helper to remove.", + "type": "String" + } + ], + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/waiters.ts", + "line": 70, + "description": "`unregisterWaiter` is used to unregister a callback that was\nregistered with `registerWaiter`.", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "unregisterWaiter", + "params": [ + { + "name": "context", + "description": "(optional)", + "type": "Object" + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "since": "1.2.0", + "class": "@ember/test", + "module": "@ember/test" + } + ] + }, + "allstaticfunctions": { + "@ember/test": [ + { + "file": "packages/ember-testing/lib/test/waiters.ts", + "line": 98, + "description": "Iterates through each registered test waiter, and invokes\nits callback. If any waiter returns false, this method will return\ntrue indicating that the waiters have not settled yet.\n\nThis is generally used internally from the acceptance/integration test\ninfrastructure.", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "checkWaiters", + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/helpers.ts", + "line": 16, + "description": "`registerHelper` is used to register a test helper that will be injected\nwhen `App.injectTestHelpers` is called.\n\nThe helper method will always be called with the current Application as\nthe first parameter.\n\nFor example:\n\n```javascript\nimport { registerHelper } from '@ember/test';\nimport { run } from '@ember/runloop';\n\nregisterHelper('boot', function(app) {\n run(app, app.advanceReadiness);\n});\n```\n\nThis helper can later be called without arguments because it will be\ncalled with `app` as the first parameter.\n\n```javascript\nimport Application from '@ember/application';\n\nApp = Application.create();\nApp.injectTestHelpers();\nboot();\n```", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "registerHelper", + "params": [ + { + "name": "name", + "description": "The name of the helper method to add.", + "type": "String" + }, + { + "name": "helperMethod", + "description": "", + "type": "Function" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/waiters.ts", + "line": 7, + "description": "This allows ember-testing to play nicely with other asynchronous\nevents, such as an application that is waiting for a CSS3\ntransition or an IndexDB transaction. The waiter runs periodically\nafter each async helper (i.e. `click`, `andThen`, `visit`, etc) has executed,\nuntil the returning result is truthy. After the waiters finish, the next async helper\nis executed and the process repeats.\n\nFor example:\n\n```javascript\nimport { registerWaiter } from '@ember/test';\n\nregisterWaiter(function() {\n return myPendingTransactions() === 0;\n});\n```\nThe `context` argument allows you to optionally specify the `this`\nwith which your callback will be invoked.\n\nFor example:\n\n```javascript\nimport { registerWaiter } from '@ember/test';\n\nregisterWaiter(MyDB, MyDB.hasPendingTransactions);\n```", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "registerWaiter", + "params": [ + { + "name": "context", + "description": "(optional)", + "type": "Object" + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "since": "1.2.0", + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/helpers.ts", + "line": 116, + "description": "Remove a previously added helper method.\n\nExample:\n\n```javascript\nimport { unregisterHelper } from '@ember/test';\n\nunregisterHelper('wait');\n```", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "unregisterHelper", + "static": 1, + "params": [ + { + "name": "name", + "description": "The helper to remove.", + "type": "String" + } + ], + "class": "@ember/test", + "module": "@ember/test" + }, + { + "file": "packages/ember-testing/lib/test/waiters.ts", + "line": 70, + "description": "`unregisterWaiter` is used to unregister a callback that was\nregistered with `registerWaiter`.", + "access": "public", + "tagname": "", + "static": 1, + "itemtype": "method", + "name": "unregisterWaiter", + "params": [ + { + "name": "context", + "description": "(optional)", + "type": "Object" + }, + { + "name": "callback", + "description": "", + "type": "Function" + } + ], + "since": "1.2.0", + "class": "@ember/test", + "module": "@ember/test" + } + ] + }, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/utils.json b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/utils.json new file mode 100644 index 000000000..6cbccc04b --- /dev/null +++ b/json-docs/ember/5.3.0/modules/ember-5.3.0-@ember/utils.json @@ -0,0 +1,386 @@ +{ + "data": { + "id": "ember-5.3.0-@ember/utils", + "type": "module", + "attributes": { + "name": "@ember/utils", + "submodules": {}, + "elements": {}, + "fors": { + "Ember": 1, + "@ember/utils": 1 + }, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/utils/lib/compare.ts", + "line": 49, + "parent": null, + "publicclasses": [], + "privateclasses": [], + "staticfunctions": { + "@ember/utils": [ + { + "file": "packages/@ember/utils/lib/compare.ts", + "line": 53, + "description": "Compares two javascript values and returns:\n\n - -1 if the first is smaller than the second,\n - 0 if both are equal,\n - 1 if the first is greater than the second.\n\n ```javascript\n import { compare } from '@ember/utils';\n\n compare('hello', 'hello'); // 0\n compare('abc', 'dfg'); // -1\n compare(2, 1); // 1\n ```\n\nIf the types of the two objects are different precedence occurs in the\nfollowing order, with types earlier in the list considered `<` types\nlater in the list:\n\n - undefined\n - null\n - boolean\n - number\n - string\n - array\n - object\n - instance\n - function\n - class\n - date\n\n ```javascript\n import { compare } from '@ember/utils';\n\n compare('hello', 50); // 1\n compare(50, 'hello'); // -1\n ```", + "itemtype": "method", + "name": "compare", + "static": 1, + "params": [ + { + "name": "v", + "description": "First value to compare", + "type": "Object" + }, + { + "name": "w", + "description": "Second value to compare", + "type": "Object" + } + ], + "return": { + "description": "-1 if v < w, 0 if v = w and 1 if v > w.", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/utils/lib/is_blank.ts", + "line": 5, + "description": "A value is blank if it is empty or a whitespace string.\n\n```javascript\nimport { isBlank } from '@ember/utils';\n\nisBlank(null); // true\nisBlank(undefined); // true\nisBlank(''); // true\nisBlank([]); // true\nisBlank('\\n\\t'); // true\nisBlank(' '); // true\nisBlank({}); // false\nisBlank('\\n\\t Hello'); // false\nisBlank('Hello world'); // false\nisBlank([1,2,3]); // false\n```", + "itemtype": "method", + "name": "isBlank", + "static": 1, + "params": [ + { + "name": "obj", + "description": "Value to test", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/utils/lib/is_empty.ts", + "line": 6, + "description": "Verifies that a value is `null` or `undefined`, an empty string, or an empty\narray.\n\nConstrains the rules on `isNone` by returning true for empty strings and\nempty arrays.\n\nIf the value is an object with a `size` property of type number, it is used\nto check emptiness.\n\n```javascript\nisEmpty(null); // true\nisEmpty(undefined); // true\nisEmpty(''); // true\nisEmpty([]); // true\nisEmpty({ size: 0}); // true\nisEmpty({}); // false\nisEmpty('Adam Hawkins'); // false\nisEmpty([0,1,2]); // false\nisEmpty('\\n\\t'); // false\nisEmpty(' '); // false\nisEmpty({ size: 1 }) // false\nisEmpty({ size: () => 0 }) // false\n```", + "itemtype": "method", + "name": "isEmpty", + "static": 1, + "params": [ + { + "name": "obj", + "description": "Value to test", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/utils/lib/is-equal.ts", + "line": 4, + "description": "Compares two objects, returning true if they are equal.\n\n```javascript\nimport { isEqual } from '@ember/utils';\n\nisEqual('hello', 'hello'); // true\nisEqual(1, 2); // false\n```\n\n`isEqual` is a more specific comparison than a triple equal comparison.\nIt will call the `isEqual` instance method on the objects being\ncompared, allowing finer control over when objects should be considered\nequal to each other.\n\n```javascript\nimport { isEqual } from '@ember/utils';\nimport EmberObject from '@ember/object';\n\nlet Person = EmberObject.extend({\n isEqual(other) { return this.ssn == other.ssn; }\n});\n\nlet personA = Person.create({name: 'Muhammad Ali', ssn: '123-45-6789'});\nlet personB = Person.create({name: 'Cassius Clay', ssn: '123-45-6789'});\n\nisEqual(personA, personB); // true\n```\n\nDue to the expense of array comparisons, collections will never be equal to\neach other even if each of their items are equal to each other.\n\n```javascript\nimport { isEqual } from '@ember/utils';\n\nisEqual([4, 2], [4, 2]); // false\n```", + "itemtype": "method", + "name": "isEqual", + "static": 1, + "params": [ + { + "name": "a", + "description": "first object to compare", + "type": "Object" + }, + { + "name": "b", + "description": "second object to compare", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/utils/lib/is_none.ts", + "line": 4, + "description": "Returns true if the passed value is null or undefined. This avoids errors\nfrom JSLint complaining about use of ==, which can be technically\nconfusing.\n\n```javascript\nisNone(null); // true\nisNone(undefined); // true\nisNone(''); // false\nisNone([]); // false\nisNone(function() {}); // false\n```", + "itemtype": "method", + "name": "isNone", + "static": 1, + "params": [ + { + "name": "obj", + "description": "Value to test", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/utils/lib/is_present.ts", + "line": 5, + "description": "A value is present if it not `isBlank`.\n\n```javascript\nisPresent(null); // false\nisPresent(undefined); // false\nisPresent(''); // false\nisPresent(' '); // false\nisPresent('\\n\\t'); // false\nisPresent([]); // false\nisPresent({ length: 0 }); // false\nisPresent(false); // true\nisPresent(true); // true\nisPresent('string'); // true\nisPresent(0); // true\nisPresent(function() {}); // true\nisPresent({}); // true\nisPresent('\\n\\t Hello'); // true\nisPresent([1, 2, 3]); // true\n```", + "itemtype": "method", + "name": "isPresent", + "static": 1, + "params": [ + { + "name": "obj", + "description": "Value to test", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.8.0", + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/utils/lib/type-of.ts", + "line": 40, + "description": "Returns a consistent type for the passed object.\n\nUse this instead of the built-in `typeof` to get the type of an item.\nIt will return the same result across all browsers and includes a bit\nmore detail. Here is what will be returned:\n\n | Return Value | Meaning |\n |---------------|------------------------------------------------------|\n | 'string' | String primitive or String object. |\n | 'number' | Number primitive or Number object. |\n | 'boolean' | Boolean primitive or Boolean object. |\n | 'null' | Null value |\n | 'undefined' | Undefined value |\n | 'function' | A function |\n | 'array' | An instance of Array |\n | 'regexp' | An instance of RegExp |\n | 'date' | An instance of Date |\n | 'filelist' | An instance of FileList |\n | 'class' | An Ember class (created using EmberObject.extend()) |\n | 'instance' | An Ember object instance |\n | 'error' | An instance of the Error object |\n | 'object' | A JavaScript object not inheriting from EmberObject |\n\nExamples:\n\n```javascript\nimport { A } from '@ember/array';\nimport { typeOf } from '@ember/utils';\nimport EmberObject from '@ember/object';\n\ntypeOf(); // 'undefined'\ntypeOf(null); // 'null'\ntypeOf(undefined); // 'undefined'\ntypeOf('michael'); // 'string'\ntypeOf(new String('michael')); // 'string'\ntypeOf(101); // 'number'\ntypeOf(new Number(101)); // 'number'\ntypeOf(true); // 'boolean'\ntypeOf(new Boolean(true)); // 'boolean'\ntypeOf(A); // 'function'\ntypeOf(A()); // 'array'\ntypeOf([1, 2, 90]); // 'array'\ntypeOf(/abc/); // 'regexp'\ntypeOf(new Date()); // 'date'\ntypeOf(event.target.files); // 'filelist'\ntypeOf(EmberObject.extend()); // 'class'\ntypeOf(EmberObject.create()); // 'instance'\ntypeOf(new Error('teamocil')); // 'error'\n\n// 'normal' JavaScript object\ntypeOf({ a: 'b' }); // 'object'\n```", + "itemtype": "method", + "name": "typeOf", + "params": [ + { + "name": "item", + "description": "the item to check" + } + ], + "return": { + "description": "the type", + "type": "String" + }, + "access": "public", + "tagname": "", + "static": 1, + "class": "@ember/utils", + "module": "@ember/utils" + } + ] + }, + "allstaticfunctions": { + "@ember/utils": [ + { + "file": "packages/@ember/utils/lib/compare.ts", + "line": 53, + "description": "Compares two javascript values and returns:\n\n - -1 if the first is smaller than the second,\n - 0 if both are equal,\n - 1 if the first is greater than the second.\n\n ```javascript\n import { compare } from '@ember/utils';\n\n compare('hello', 'hello'); // 0\n compare('abc', 'dfg'); // -1\n compare(2, 1); // 1\n ```\n\nIf the types of the two objects are different precedence occurs in the\nfollowing order, with types earlier in the list considered `<` types\nlater in the list:\n\n - undefined\n - null\n - boolean\n - number\n - string\n - array\n - object\n - instance\n - function\n - class\n - date\n\n ```javascript\n import { compare } from '@ember/utils';\n\n compare('hello', 50); // 1\n compare(50, 'hello'); // -1\n ```", + "itemtype": "method", + "name": "compare", + "static": 1, + "params": [ + { + "name": "v", + "description": "First value to compare", + "type": "Object" + }, + { + "name": "w", + "description": "Second value to compare", + "type": "Object" + } + ], + "return": { + "description": "-1 if v < w, 0 if v = w and 1 if v > w.", + "type": "Number" + }, + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/utils/lib/is_blank.ts", + "line": 5, + "description": "A value is blank if it is empty or a whitespace string.\n\n```javascript\nimport { isBlank } from '@ember/utils';\n\nisBlank(null); // true\nisBlank(undefined); // true\nisBlank(''); // true\nisBlank([]); // true\nisBlank('\\n\\t'); // true\nisBlank(' '); // true\nisBlank({}); // false\nisBlank('\\n\\t Hello'); // false\nisBlank('Hello world'); // false\nisBlank([1,2,3]); // false\n```", + "itemtype": "method", + "name": "isBlank", + "static": 1, + "params": [ + { + "name": "obj", + "description": "Value to test", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.5.0", + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/utils/lib/is_empty.ts", + "line": 6, + "description": "Verifies that a value is `null` or `undefined`, an empty string, or an empty\narray.\n\nConstrains the rules on `isNone` by returning true for empty strings and\nempty arrays.\n\nIf the value is an object with a `size` property of type number, it is used\nto check emptiness.\n\n```javascript\nisEmpty(null); // true\nisEmpty(undefined); // true\nisEmpty(''); // true\nisEmpty([]); // true\nisEmpty({ size: 0}); // true\nisEmpty({}); // false\nisEmpty('Adam Hawkins'); // false\nisEmpty([0,1,2]); // false\nisEmpty('\\n\\t'); // false\nisEmpty(' '); // false\nisEmpty({ size: 1 }) // false\nisEmpty({ size: () => 0 }) // false\n```", + "itemtype": "method", + "name": "isEmpty", + "static": 1, + "params": [ + { + "name": "obj", + "description": "Value to test", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/utils/lib/is-equal.ts", + "line": 4, + "description": "Compares two objects, returning true if they are equal.\n\n```javascript\nimport { isEqual } from '@ember/utils';\n\nisEqual('hello', 'hello'); // true\nisEqual(1, 2); // false\n```\n\n`isEqual` is a more specific comparison than a triple equal comparison.\nIt will call the `isEqual` instance method on the objects being\ncompared, allowing finer control over when objects should be considered\nequal to each other.\n\n```javascript\nimport { isEqual } from '@ember/utils';\nimport EmberObject from '@ember/object';\n\nlet Person = EmberObject.extend({\n isEqual(other) { return this.ssn == other.ssn; }\n});\n\nlet personA = Person.create({name: 'Muhammad Ali', ssn: '123-45-6789'});\nlet personB = Person.create({name: 'Cassius Clay', ssn: '123-45-6789'});\n\nisEqual(personA, personB); // true\n```\n\nDue to the expense of array comparisons, collections will never be equal to\neach other even if each of their items are equal to each other.\n\n```javascript\nimport { isEqual } from '@ember/utils';\n\nisEqual([4, 2], [4, 2]); // false\n```", + "itemtype": "method", + "name": "isEqual", + "static": 1, + "params": [ + { + "name": "a", + "description": "first object to compare", + "type": "Object" + }, + { + "name": "b", + "description": "second object to compare", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/utils/lib/is_none.ts", + "line": 4, + "description": "Returns true if the passed value is null or undefined. This avoids errors\nfrom JSLint complaining about use of ==, which can be technically\nconfusing.\n\n```javascript\nisNone(null); // true\nisNone(undefined); // true\nisNone(''); // false\nisNone([]); // false\nisNone(function() {}); // false\n```", + "itemtype": "method", + "name": "isNone", + "static": 1, + "params": [ + { + "name": "obj", + "description": "Value to test", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/utils/lib/is_present.ts", + "line": 5, + "description": "A value is present if it not `isBlank`.\n\n```javascript\nisPresent(null); // false\nisPresent(undefined); // false\nisPresent(''); // false\nisPresent(' '); // false\nisPresent('\\n\\t'); // false\nisPresent([]); // false\nisPresent({ length: 0 }); // false\nisPresent(false); // true\nisPresent(true); // true\nisPresent('string'); // true\nisPresent(0); // true\nisPresent(function() {}); // true\nisPresent({}); // true\nisPresent('\\n\\t Hello'); // true\nisPresent([1, 2, 3]); // true\n```", + "itemtype": "method", + "name": "isPresent", + "static": 1, + "params": [ + { + "name": "obj", + "description": "Value to test", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.8.0", + "access": "public", + "tagname": "", + "class": "@ember/utils", + "module": "@ember/utils" + }, + { + "file": "packages/@ember/utils/lib/type-of.ts", + "line": 40, + "description": "Returns a consistent type for the passed object.\n\nUse this instead of the built-in `typeof` to get the type of an item.\nIt will return the same result across all browsers and includes a bit\nmore detail. Here is what will be returned:\n\n | Return Value | Meaning |\n |---------------|------------------------------------------------------|\n | 'string' | String primitive or String object. |\n | 'number' | Number primitive or Number object. |\n | 'boolean' | Boolean primitive or Boolean object. |\n | 'null' | Null value |\n | 'undefined' | Undefined value |\n | 'function' | A function |\n | 'array' | An instance of Array |\n | 'regexp' | An instance of RegExp |\n | 'date' | An instance of Date |\n | 'filelist' | An instance of FileList |\n | 'class' | An Ember class (created using EmberObject.extend()) |\n | 'instance' | An Ember object instance |\n | 'error' | An instance of the Error object |\n | 'object' | A JavaScript object not inheriting from EmberObject |\n\nExamples:\n\n```javascript\nimport { A } from '@ember/array';\nimport { typeOf } from '@ember/utils';\nimport EmberObject from '@ember/object';\n\ntypeOf(); // 'undefined'\ntypeOf(null); // 'null'\ntypeOf(undefined); // 'undefined'\ntypeOf('michael'); // 'string'\ntypeOf(new String('michael')); // 'string'\ntypeOf(101); // 'number'\ntypeOf(new Number(101)); // 'number'\ntypeOf(true); // 'boolean'\ntypeOf(new Boolean(true)); // 'boolean'\ntypeOf(A); // 'function'\ntypeOf(A()); // 'array'\ntypeOf([1, 2, 90]); // 'array'\ntypeOf(/abc/); // 'regexp'\ntypeOf(new Date()); // 'date'\ntypeOf(event.target.files); // 'filelist'\ntypeOf(EmberObject.extend()); // 'class'\ntypeOf(EmberObject.create()); // 'instance'\ntypeOf(new Error('teamocil')); // 'error'\n\n// 'normal' JavaScript object\ntypeOf({ a: 'b' }); // 'object'\n```", + "itemtype": "method", + "name": "typeOf", + "params": [ + { + "name": "item", + "description": "the item to check" + } + ], + "return": { + "description": "the type", + "type": "String" + }, + "access": "public", + "tagname": "", + "static": 1, + "class": "@ember/utils", + "module": "@ember/utils" + } + ] + }, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/modules/ember-5.3.0-@glimmer/component.json b/json-docs/ember/5.3.0/modules/ember-5.3.0-@glimmer/component.json new file mode 100644 index 000000000..4c81a632f --- /dev/null +++ b/json-docs/ember/5.3.0/modules/ember-5.3.0-@glimmer/component.json @@ -0,0 +1,36 @@ +{ + "data": { + "id": "ember-5.3.0-@glimmer/component", + "type": "module", + "attributes": { + "name": "@glimmer/component", + "submodules": {}, + "elements": {}, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/-internals/glimmer/lib/glimmer-component-docs.ts", + "line": 1, + "description": "

A component is a reusable UI element that consists of a .hbs template and an\noptional JavaScript class that defines its behavior. For example, someone\nmight make a button in the template and handle the click behavior in the\nJavaScript file that shares the same name as the template.

\n

Components are broken down into two categories:

\n
    \n
  • Components without JavaScript, that are based only on a template. These\nare called Template-only or TO components.
  • \n
  • Components with JavaScript, which consist of a template and a backing\nclass.
  • \n
\n

Ember ships with two types of JavaScript classes for components:

\n
    \n
  1. Glimmer components, imported from @glimmer/component, which are the\ndefault components for Ember Octane (3.15) and more recent editions.
  2. \n
  3. Classic components, imported from @ember/component, which were the\ndefault for older editions of Ember (pre 3.15).
  4. \n
\n

Below is the documentation for Template-only and Glimmer components. If you\nare looking for the API documentation for Classic components, it is\navailable here. The source code for\nGlimmer components can be found in @glimmer/component.

\n

Defining a Template-only Component

\n

The simplest way to create a component is to create a template file in\napp/templates/components. For example, if you name a template\napp/templates/components/person-profile.hbs:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n3\n
<h1>{{@person.name}}</h1>\n<img src={{@person.avatar}}>\n<p class='signature'>{{@person.signature}}</p>
\n
\n
\n \n

You will be able to use <PersonProfile /> to invoke this component elsewhere\nin your application:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<PersonProfile @person={{this.currentUser}} />
\n
\n
\n \n

Note that component names are capitalized here in order to distinguish them\nfrom regular HTML elements, but they are dasherized in the file system.

\n

While the angle bracket invocation form is generally preferred, it is also\npossible to invoke the same component with the {{person-profile}} syntax:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
{{person-profile person=this.currentUser}}
\n
\n
\n \n

Note that with this syntax, you use dashes in the component name and\narguments are passed without the @ sign.

\n

In both cases, Ember will render the content of the component template we\ncreated above. The end result will be something like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<h1>Tomster</h1>\n<img src="https://emberjs.com/tomster.jpg">\n<p class='signature'>Out of office this week</p>
\n
\n
\n \n

File System Nesting

\n

Components can be nested inside sub-folders for logical groupping. For\nexample, if we placed our template in\napp/templates/components/person/short-profile.hbs, we can invoke it as\n<Person::ShortProfile />:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
<Person::ShortProfile @person={{this.currentUser}} />
\n
\n
\n \n

Or equivalently, {{person/short-profile}}:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
app/templates/application.hbs
1\n
{{person/short-profile person=this.currentUser}}
\n
\n
\n \n

Using Blocks

\n

You can use yield inside a template to include the contents of any block\nattached to the component. For instance, if we added a {{yield}} to our\ncomponent like so:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{@person.name}}</h1>\n{{yield}}
\n
\n
\n \n

We could then invoke it like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<PersonProfile @person={{this.currentUser}}>\n  <p>Admin mode</p>\n</PersonProfile>
\n
\n
\n \n

or with curly syntax like this:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
{{#person-profile person=this.currentUser}}\n  <p>Admin mode</p>\n{{/person-profile}}
\n
\n
\n \n

And the content passed in between the brackets of the component would be\nrendered in the same place as the {{yield}} within it, replacing it.

\n

Blocks are executed in their original context, meaning they have access to the\nscope and any in-scope variables where they were defined.

\n

Passing parameters to blocks

\n

You can also pass positional parameters to {{yield}}, which are then made\navailable in the block:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{@person.name}}</h1>\n{{yield @person.signature}}
\n
\n
\n \n

We can then use this value in the block like so:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n
<PersonProfile @person={{this.currentUser}} as |signature|>\n  {{signature}}\n</PersonProfile>
\n
\n
\n \n

Passing multiple blocks

\n

You can pass multiple blocks to a component by giving them names, and\nspecifying which block you are yielding to with {{yield}}. For instance, if\nwe wanted to add a way for users to customize the title of our\n<PersonProfile> component, we could add a named block inside of the header:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{yield to="title"}}</h1>\n{{yield}}
\n
\n
\n \n

This component could then be invoked like so:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<PersonProfile @person={{this.currentUser}}>\n  <:title>{{this.currentUser.name}}</:title>\n  <:default>{{this.currentUser.signature}}</:default>\n</PersonProfile>
\n
\n
\n \n

When passing named blocks, you must name every block, including the default\nblock, which is the block that is defined if you do not pass a to parameter\nto {{yield}}. Whenever you invoke a component without passing explicitly\nnamed blocks, the passed block is considered the default block.

\n

Passing parameters to named blocks

\n

You can also pass parameters to named blocks:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{yield @person.name to="title"}}</h1>\n{{yield @person.signature}}
\n
\n
\n \n

These parameters can then be used like so:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n
<PersonProfile @person={{this.currentUser}}>\n  <:title as |name|>{{name}}</:title>\n  <:default as |signature|>{{signature}}</:default>\n</PersonProfile>
\n
\n
\n \n

Checking to see if a block exists

\n

You can also check to see if a block exists using the (has-block) keyword,\nand conditionally use it, or provide a default template instead.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
<h1>\n  {{#if (has-block "title")}}\n    {{yield @person.name to="title"}}\n  {{else}}\n    {{@person.name}}\n  {{/if}}\n</h1>\n\n{{#if (has-block)}}\n  {{yield @person.signature}}\n{{else}}\n  {{@person.signature}}\n{{/if}}
\n
\n
\n \n

With this template, we can then optionally pass in one block, both blocks, or\nnone at all:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n
{{! passing both blocks }}\n<PersonProfile @person={{this.currentUser}}>\n  <:title as |name|>{{name}}</:title>\n  <:default as |signature|>{{signature}}</:default>\n</PersonProfile>\n\n{{! passing just the title block }}\n<PersonProfile @person={{this.currentUser}}>\n  <:title as |name|>{{name}}</:title>\n</PersonProfile>\n\n{{! passing just the default block }}\n<PersonProfile @person={{this.currentUser}} as |signature|>\n  {{signature}}\n</PersonProfile>\n\n{{! not passing any blocks }}\n<PersonProfile @person={{this.currentUser}}/>
\n
\n
\n \n

Checking to see if a block has parameters

\n

We can also check if a block receives parameters using the (has-block-params)\nkeyword, and conditionally yield different values if so.

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n3\n4\n5\n
{{#if (has-block-params)}}\n  {{yield @person.signature}}\n{{else}}\n  {{yield}}\n{{/if}}
\n
\n
\n \n

Customizing Components With JavaScript

\n

To add JavaScript to a component, create a JavaScript file in the same\nlocation as the template file, with the same name, and export a subclass\nof Component as the default value. For example, to add Javascript to the\nPersonProfile component which we defined above, we would create\napp/components/person-profile.js and export our class as the default, like\nso:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.js
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n
import Component from '@glimmer/component';\n\nexport default class PersonProfileComponent extends Component {\n  get displayName() {\n    let { title, firstName, lastName } = this.args.person;\n\n    if (title) {\n      return `${title} ${lastName}`;\n    } else {\n      return `${firstName} ${lastName}`;\n    }\n  })\n}
\n
\n
\n \n

You can add your own properties, methods, and lifecycle hooks to this\nsubclass to customize its behavior, and you can reference the instance of the\nclass in your template using {{this}}. For instance, we could access the\ndisplayName property of our PersonProfile component instance in the\ntemplate like this:

\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
profile.hbs
1\n2\n
<h1>{{this.displayName}}</h1>\n{{yield}}
\n
\n
\n \n

constructor

\n

params: owner object and args object

\n

Constructs a new component and assigns itself the passed properties. The\nconstructor is run whenever a new instance of the component is created, and\ncan be used to setup the initial state of the component.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import Component from '@glimmer/component';\n\nexport default class SomeComponent extends Component {\n  constructor(owner, args) {\n    super(owner, args);\n\n    if (this.args.displayMode === 'list') {\n      this.items = [];\n    }\n  }\n}
\n
\n
\n \n

Service injections and arguments are available in the constructor.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n
import Component from '@glimmer/component';\nimport { service } from '@ember/service';\n\nexport default class SomeComponent extends Component {\n  @service myAnimations;\n\n  constructor(owner, args) {\n    super(owner, args);\n\n    if (this.args.fadeIn === true) {\n      this.myAnimations.register(this, 'fade-in');\n    }\n  }\n}
\n
\n
\n \n

willDestroy

\n

willDestroy is called after the component has been removed from the DOM, but\nbefore the component is fully destroyed. This lifecycle hook can be used to\ncleanup the component and any related state.

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n
import Component from '@glimmer/component';\nimport { service } from '@ember/service';\n\nexport default class SomeComponent extends Component {\n  @service myAnimations;\n\n  willDestroy() {\n    super.willDestroy(...arguments);\n\n    this.myAnimations.unregister(this);\n  }\n}
\n
\n
\n \n

args

\n

The args property of Glimmer components is an object that contains the\narguments that are passed to the component. For instance, the\nfollowing component usage:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
<SomeComponent @fadeIn={{true}} />
\n
\n
\n \n

Would result in the following args object to be passed to the component:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n
{ fadeIn: true }
\n
\n
\n \n

args can be accessed at any point in the component lifecycle, including\nconstructor and willDestroy. They are also automatically marked as tracked\nproperties, and they can be depended on as computed property dependencies:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n
import Component from '@glimmer/component';\nimport { computed } from '@ember/object';\n\nexport default class SomeComponent extends Component {\n\n  @computed('args.someValue')\n  get computedGetter() {\n    // updates whenever args.someValue updates\n    return this.args.someValue;\n  }\n\n  get standardGetter() {\n    // updates whenever args.anotherValue updates (Ember 3.13+)\n    return this.args.anotherValue;\n  }\n}
\n
\n
\n \n

isDestroying

\n

A boolean flag to tell if the component is in the process of destroying. This is set to\ntrue before willDestroy is called.

\n

isDestroyed

\n

A boolean to tell if the component has been fully destroyed. This is set to true\nafter willDestroy is called.

\n", + "access": "public", + "tagname": "", + "parent": null, + "publicclasses": [], + "privateclasses": [], + "staticfunctions": {}, + "allstaticfunctions": {}, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/modules/ember-5.3.0-@glimmer/tracking.json b/json-docs/ember/5.3.0/modules/ember-5.3.0-@glimmer/tracking.json new file mode 100644 index 000000000..835ef5328 --- /dev/null +++ b/json-docs/ember/5.3.0/modules/ember-5.3.0-@glimmer/tracking.json @@ -0,0 +1,92 @@ +{ + "data": { + "id": "ember-5.3.0-@glimmer/tracking", + "type": "module", + "attributes": { + "name": "@glimmer/tracking", + "submodules": {}, + "elements": {}, + "fors": { + "@glimmer/tracking": 1 + }, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/-internals/glimmer/lib/glimmer-tracking-docs.ts", + "line": 1, + "description": "

In order to tell Ember a value might change, we need to mark it as trackable.\nTrackable values are values that:

\n
    \n
  • Can change over their component’s lifetime and
  • \n
  • Should cause Ember to rerender if and when they change
  • \n
\n

We can do this by marking the field with the @tracked decorator.

\n

Caching a getter value

\n

The @cached decorator can be used on getters in order to cache the\nreturn value of the getter.

\n

This method adds an extra overhead to each memoized getter, therefore caching\nthe values should not be the default strategy, but used in last resort.

\n", + "access": "public", + "tagname": "", + "parent": null, + "publicclasses": [], + "privateclasses": [], + "staticfunctions": { + "@glimmer/tracking": [ + { + "file": "packages/@ember/-internals/glimmer/lib/glimmer-tracking-docs.ts", + "line": 158, + "description": "Gives the getter a caching behavior. The return value of the getter\nwill be cached until any of the properties it is entangled with\nare invalidated. This is useful when a getter is expensive and\nused very often.\n\nFor instance, in this `GuestList` class, we have the `sortedGuests`\ngetter that sorts the guests alphabetically:\n\n```javascript\n import { tracked } from '@glimmer/tracking';\n\n class GuestList {\n @tracked guests = ['Zoey', 'Tomster'];\n\n get sortedGuests() {\n return this.guests.slice().sort()\n }\n }\n```\n\nEvery time `sortedGuests` is accessed, a new array will be created and sorted,\nbecause JavaScript getters do not cache by default. When the guest list\nis small, like the one in the example, this is not a problem. However, if\nthe guest list were to grow very large, it would mean that we would be doing\na large amount of work each time we accessed `sortedGuests`. With `@cached`,\nwe can cache the value instead:\n\n```javascript\n import { tracked, cached } from '@glimmer/tracking';\n\n class GuestList {\n @tracked guests = ['Zoey', 'Tomster'];\n\n @cached\n get sortedGuests() {\n return this.guests.slice().sort()\n }\n }\n```\n\nNow the `sortedGuests` getter will be cached based on autotracking.\nIt will only rerun and create a new sorted array when the guests tracked\nproperty is updated.\n\n\n### Tradeoffs\n\nOveruse is discouraged.\n\nIn general, you should avoid using `@cached` unless you have confirmed that\nthe getter you are decorating is computationally expensive, since `@cached`\nadds a small amount of overhead to the getter.\nWhile the individual costs are small, a systematic use of the `@cached`\ndecorator can add up to a large impact overall in your app.\nMany getters and tracked properties are only accessed once during rendering,\nand then never rerendered, so adding `@cached` when unnecessary can\nnegatively impact performance.\n\nAlso, `@cached` may rerun even if the values themselves have not changed,\nsince tracked properties will always invalidate.\nFor example updating an integer value from `5` to an other `5` will trigger\na rerun of the cached properties building from this integer.\n\nAvoiding a cache invalidation in this case is not something that can\nbe achieved on the `@cached` decorator itself, but rather when updating\nthe underlying tracked values, by applying some diff checking mechanisms:\n\n```javascript\nif (nextValue !== this.trackedProp) {\n this.trackedProp = nextValue;\n}\n```\n\nHere equal values won't update the property, therefore not triggering\nthe subsequent cache invalidations of the `@cached` properties who were\nusing this `trackedProp`.\n\nAs a reminder, do not use this piece of code inside a tracked getter,\nas the dependency chain could lead to an infinite loop. Mutating an adjacent\nproperty from a getter is not a good practice anyway, even with a caching\nmechanism reducing reruns.\n\nThe cost of these edge-guards adds up to the trade-off calculation of using\na caching strategy, hence requiring a very sensitive and moderate approach\nregarding performance.", + "itemtype": "method", + "name": "cached", + "static": 1, + "access": "public", + "tagname": "", + "class": "@glimmer/tracking", + "module": "@glimmer/tracking" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/glimmer-tracking-docs.ts", + "line": 22, + "description": "Marks a property as tracked. By default, values that are rendered in Ember app\ntemplates are _static_, meaning that updates to them won't cause the\napplication to rerender. Marking a property as tracked means that when that\nproperty changes, any templates that used that property, directly or\nindirectly, will rerender. For instance, consider this component:\n\n```handlebars\n
Count: {{this.count}}
\n
Times Ten: {{this.timesTen}}
\n
\n \n
\n```\n\n```javascript\nimport Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { action } from '@ember/object';\n\nexport default class CounterComponent extends Component {\n @tracked count = 0;\n\n get timesTen() {\n return this.count * 10;\n }\n\n @action\n plusOne() {\n this.count += 1;\n }\n}\n```\n\nBoth the `{{this.count}}` and the `{{this.timesTen}}` properties in the\ntemplate will update whenever the button is clicked. Any tracked properties\nthat are used in any way to calculate a value that is used in the template\nwill cause a rerender when updated - this includes through method calls and\nother means:\n\n```javascript\nimport Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\n\nclass Entry {\n @tracked name;\n @tracked phoneNumber;\n\n constructor(name, phoneNumber) {\n this.name = name;\n this.phoneNumber = phoneNumber;\n }\n}\n\nexport default class PhoneBookComponent extends Component {\n entries = [\n new Entry('Pizza Palace', 5551234),\n new Entry('1st Street Cleaners', 5554321),\n new Entry('Plants R Us', 5552468),\n ];\n\n // Any usage of this property will update whenever any of the names in the\n // entries arrays are updated\n get names() {\n return this.entries.map(e => e.name);\n }\n\n // Any usage of this property will update whenever any of the numbers in the\n // entries arrays are updated\n get numbers() {\n return this.getFormattedNumbers();\n }\n\n getFormattedNumbers() {\n return this.entries\n .map(e => e.phoneNumber)\n .map(number => {\n let numberString = '' + number;\n\n return numberString.slice(0, 3) + '-' + numberString.slice(3);\n });\n }\n}\n```\n\nIt's important to note that setting tracked properties will always trigger an\nupdate, even if the property is set to the same value as it was before.\n\n```js\nlet entry = new Entry('Pizza Palace', 5551234);\n\n// if entry was used when rendering, this would cause a rerender, even though\n// the name is being set to the same value as it was before\nentry.name = entry.name;\n```\n\n`tracked` can also be used with the classic Ember object model in a similar\nmanner to classic computed properties:\n\n```javascript\nimport EmberObject from '@ember/object';\nimport { tracked } from '@glimmer/tracking';\n\nconst Entry = EmberObject.extend({\n name: tracked(),\n phoneNumber: tracked()\n});\n```\n\nOften this is unnecessary, but to ensure robust auto-tracking behavior it is\nadvisable to mark tracked state appropriately wherever possible.\n\nThis form of `tracked` also accepts an optional configuration object\ncontaining either an initial `value` or an `initializer` function (but not\nboth).\n\n```javascript\nimport EmberObject from '@ember/object';\nimport { tracked } from '@glimmer/tracking';\n\nconst Entry = EmberObject.extend({\n name: tracked({ value: 'Zoey' }),\n favoriteSongs: tracked({\n initializer: () => ['Raspberry Beret', 'Time After Time']\n })\n});\n```", + "itemtype": "method", + "name": "tracked", + "static": 1, + "access": "public", + "tagname": "", + "class": "@glimmer/tracking", + "module": "@glimmer/tracking" + } + ] + }, + "allstaticfunctions": { + "@glimmer/tracking": [ + { + "file": "packages/@ember/-internals/glimmer/lib/glimmer-tracking-docs.ts", + "line": 158, + "description": "Gives the getter a caching behavior. The return value of the getter\nwill be cached until any of the properties it is entangled with\nare invalidated. This is useful when a getter is expensive and\nused very often.\n\nFor instance, in this `GuestList` class, we have the `sortedGuests`\ngetter that sorts the guests alphabetically:\n\n```javascript\n import { tracked } from '@glimmer/tracking';\n\n class GuestList {\n @tracked guests = ['Zoey', 'Tomster'];\n\n get sortedGuests() {\n return this.guests.slice().sort()\n }\n }\n```\n\nEvery time `sortedGuests` is accessed, a new array will be created and sorted,\nbecause JavaScript getters do not cache by default. When the guest list\nis small, like the one in the example, this is not a problem. However, if\nthe guest list were to grow very large, it would mean that we would be doing\na large amount of work each time we accessed `sortedGuests`. With `@cached`,\nwe can cache the value instead:\n\n```javascript\n import { tracked, cached } from '@glimmer/tracking';\n\n class GuestList {\n @tracked guests = ['Zoey', 'Tomster'];\n\n @cached\n get sortedGuests() {\n return this.guests.slice().sort()\n }\n }\n```\n\nNow the `sortedGuests` getter will be cached based on autotracking.\nIt will only rerun and create a new sorted array when the guests tracked\nproperty is updated.\n\n\n### Tradeoffs\n\nOveruse is discouraged.\n\nIn general, you should avoid using `@cached` unless you have confirmed that\nthe getter you are decorating is computationally expensive, since `@cached`\nadds a small amount of overhead to the getter.\nWhile the individual costs are small, a systematic use of the `@cached`\ndecorator can add up to a large impact overall in your app.\nMany getters and tracked properties are only accessed once during rendering,\nand then never rerendered, so adding `@cached` when unnecessary can\nnegatively impact performance.\n\nAlso, `@cached` may rerun even if the values themselves have not changed,\nsince tracked properties will always invalidate.\nFor example updating an integer value from `5` to an other `5` will trigger\na rerun of the cached properties building from this integer.\n\nAvoiding a cache invalidation in this case is not something that can\nbe achieved on the `@cached` decorator itself, but rather when updating\nthe underlying tracked values, by applying some diff checking mechanisms:\n\n```javascript\nif (nextValue !== this.trackedProp) {\n this.trackedProp = nextValue;\n}\n```\n\nHere equal values won't update the property, therefore not triggering\nthe subsequent cache invalidations of the `@cached` properties who were\nusing this `trackedProp`.\n\nAs a reminder, do not use this piece of code inside a tracked getter,\nas the dependency chain could lead to an infinite loop. Mutating an adjacent\nproperty from a getter is not a good practice anyway, even with a caching\nmechanism reducing reruns.\n\nThe cost of these edge-guards adds up to the trade-off calculation of using\na caching strategy, hence requiring a very sensitive and moderate approach\nregarding performance.", + "itemtype": "method", + "name": "cached", + "static": 1, + "access": "public", + "tagname": "", + "class": "@glimmer/tracking", + "module": "@glimmer/tracking" + }, + { + "file": "packages/@ember/-internals/glimmer/lib/glimmer-tracking-docs.ts", + "line": 22, + "description": "Marks a property as tracked. By default, values that are rendered in Ember app\ntemplates are _static_, meaning that updates to them won't cause the\napplication to rerender. Marking a property as tracked means that when that\nproperty changes, any templates that used that property, directly or\nindirectly, will rerender. For instance, consider this component:\n\n```handlebars\n
Count: {{this.count}}
\n
Times Ten: {{this.timesTen}}
\n
\n \n
\n```\n\n```javascript\nimport Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { action } from '@ember/object';\n\nexport default class CounterComponent extends Component {\n @tracked count = 0;\n\n get timesTen() {\n return this.count * 10;\n }\n\n @action\n plusOne() {\n this.count += 1;\n }\n}\n```\n\nBoth the `{{this.count}}` and the `{{this.timesTen}}` properties in the\ntemplate will update whenever the button is clicked. Any tracked properties\nthat are used in any way to calculate a value that is used in the template\nwill cause a rerender when updated - this includes through method calls and\nother means:\n\n```javascript\nimport Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\n\nclass Entry {\n @tracked name;\n @tracked phoneNumber;\n\n constructor(name, phoneNumber) {\n this.name = name;\n this.phoneNumber = phoneNumber;\n }\n}\n\nexport default class PhoneBookComponent extends Component {\n entries = [\n new Entry('Pizza Palace', 5551234),\n new Entry('1st Street Cleaners', 5554321),\n new Entry('Plants R Us', 5552468),\n ];\n\n // Any usage of this property will update whenever any of the names in the\n // entries arrays are updated\n get names() {\n return this.entries.map(e => e.name);\n }\n\n // Any usage of this property will update whenever any of the numbers in the\n // entries arrays are updated\n get numbers() {\n return this.getFormattedNumbers();\n }\n\n getFormattedNumbers() {\n return this.entries\n .map(e => e.phoneNumber)\n .map(number => {\n let numberString = '' + number;\n\n return numberString.slice(0, 3) + '-' + numberString.slice(3);\n });\n }\n}\n```\n\nIt's important to note that setting tracked properties will always trigger an\nupdate, even if the property is set to the same value as it was before.\n\n```js\nlet entry = new Entry('Pizza Palace', 5551234);\n\n// if entry was used when rendering, this would cause a rerender, even though\n// the name is being set to the same value as it was before\nentry.name = entry.name;\n```\n\n`tracked` can also be used with the classic Ember object model in a similar\nmanner to classic computed properties:\n\n```javascript\nimport EmberObject from '@ember/object';\nimport { tracked } from '@glimmer/tracking';\n\nconst Entry = EmberObject.extend({\n name: tracked(),\n phoneNumber: tracked()\n});\n```\n\nOften this is unnecessary, but to ensure robust auto-tracking behavior it is\nadvisable to mark tracked state appropriately wherever possible.\n\nThis form of `tracked` also accepts an optional configuration object\ncontaining either an initial `value` or an `initializer` function (but not\nboth).\n\n```javascript\nimport EmberObject from '@ember/object';\nimport { tracked } from '@glimmer/tracking';\n\nconst Entry = EmberObject.extend({\n name: tracked({ value: 'Zoey' }),\n favoriteSongs: tracked({\n initializer: () => ['Raspberry Beret', 'Time After Time']\n })\n});\n```", + "itemtype": "method", + "name": "tracked", + "static": 1, + "access": "public", + "tagname": "", + "class": "@glimmer/tracking", + "module": "@glimmer/tracking" + } + ] + }, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/modules/ember-5.3.0-@glimmer/tracking/primitives/cache.json b/json-docs/ember/5.3.0/modules/ember-5.3.0-@glimmer/tracking/primitives/cache.json new file mode 100644 index 000000000..24e045e5f --- /dev/null +++ b/json-docs/ember/5.3.0/modules/ember-5.3.0-@glimmer/tracking/primitives/cache.json @@ -0,0 +1,116 @@ +{ + "data": { + "id": "ember-5.3.0-@glimmer/tracking/primitives/cache", + "type": "module", + "attributes": { + "name": "@glimmer/tracking/primitives/cache", + "submodules": {}, + "elements": {}, + "fors": { + "@glimmer/tracking/primitives/cache": 1 + }, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/-internals/metal/lib/cache.ts", + "line": 3, + "description": "

Ember uses caching based on trackable values to avoid updating large portions\nof the application. This caching is exposed via a cache primitive that can be\nused to cache a specific computation, so that it will not update and will\nreturn the cached value until a tracked value used in its computation has\nupdated.

\n", + "access": "public", + "tagname": "", + "parent": null, + "publicclasses": [], + "privateclasses": [], + "staticfunctions": { + "@glimmer/tracking/primitives/cache": [ + { + "file": "packages/@ember/-internals/metal/lib/cache.ts", + "line": 14, + "description": "Receives a function, and returns a wrapped version of it that memoizes based on\n_autotracking_. The function will only rerun whenever any tracked values used\nwithin it have changed. Otherwise, it will return the previous value.\n\n```js\nimport { tracked } from '@glimmer/tracking';\nimport { createCache, getValue } from '@glimmer/tracking/primitives/cache';\n\nclass State {\n @tracked value;\n}\n\nlet state = new State();\nlet computeCount = 0;\n\nlet counter = createCache(() => {\n // consume the state. Now, `counter` will\n // only rerun if `state.value` changes.\n state.value;\n\n return ++computeCount;\n});\n\ngetValue(counter); // 1\n\n// returns the same value because no tracked state has changed\ngetValue(counter); // 1\n\nstate.value = 'foo';\n\n// reruns because a tracked value used in the function has changed,\n// incermenting the counter\ngetValue(counter); // 2\n```", + "itemtype": "method", + "name": "createCache", + "static": 1, + "access": "public", + "tagname": "", + "class": "@glimmer/tracking/primitives/cache", + "module": "@glimmer/tracking/primitives/cache" + }, + { + "file": "packages/@ember/-internals/metal/lib/cache.ts", + "line": 56, + "description": "Gets the value of a cache created with `createCache`.\n\n```js\nimport { tracked } from '@glimmer/tracking';\nimport { createCache, getValue } from '@glimmer/tracking/primitives/cache';\n\nlet computeCount = 0;\n\nlet counter = createCache(() => {\n return ++computeCount;\n});\n\ngetValue(counter); // 1\n```", + "itemtype": "method", + "name": "getValue", + "static": 1, + "access": "public", + "tagname": "", + "class": "@glimmer/tracking/primitives/cache", + "module": "@glimmer/tracking/primitives/cache" + }, + { + "file": "packages/@ember/-internals/metal/lib/cache.ts", + "line": 78, + "description": "Can be used to check if a memoized function is _constant_. If no tracked state\nwas used while running a memoized function, it will never rerun, because nothing\ncan invalidate its result. `isConst` can be used to determine if a memoized\nfunction is constant or not, in order to optimize code surrounding that\nfunction.\n\n```js\nimport { tracked } from '@glimmer/tracking';\nimport { createCache, getValue, isConst } from '@glimmer/tracking/primitives/cache';\n\nclass State {\n @tracked value;\n}\n\nlet state = new State();\nlet computeCount = 0;\n\nlet counter = createCache(() => {\n // consume the state\n state.value;\n\n return computeCount++;\n});\n\nlet constCounter = createCache(() => {\n return computeCount++;\n});\n\ngetValue(counter);\ngetValue(constCounter);\n\nisConst(counter); // false\nisConst(constCounter); // true\n```\n\nIf called on a cache that hasn't been accessed yet, it will throw an\nerror. This is because there's no way to know if the function will be constant\nor not yet, and so this helps prevent missing an optimization opportunity on\naccident.", + "itemtype": "method", + "name": "isConst", + "static": 1, + "access": "public", + "tagname": "", + "class": "@glimmer/tracking/primitives/cache", + "module": "@glimmer/tracking/primitives/cache" + } + ] + }, + "allstaticfunctions": { + "@glimmer/tracking/primitives/cache": [ + { + "file": "packages/@ember/-internals/metal/lib/cache.ts", + "line": 14, + "description": "Receives a function, and returns a wrapped version of it that memoizes based on\n_autotracking_. The function will only rerun whenever any tracked values used\nwithin it have changed. Otherwise, it will return the previous value.\n\n```js\nimport { tracked } from '@glimmer/tracking';\nimport { createCache, getValue } from '@glimmer/tracking/primitives/cache';\n\nclass State {\n @tracked value;\n}\n\nlet state = new State();\nlet computeCount = 0;\n\nlet counter = createCache(() => {\n // consume the state. Now, `counter` will\n // only rerun if `state.value` changes.\n state.value;\n\n return ++computeCount;\n});\n\ngetValue(counter); // 1\n\n// returns the same value because no tracked state has changed\ngetValue(counter); // 1\n\nstate.value = 'foo';\n\n// reruns because a tracked value used in the function has changed,\n// incermenting the counter\ngetValue(counter); // 2\n```", + "itemtype": "method", + "name": "createCache", + "static": 1, + "access": "public", + "tagname": "", + "class": "@glimmer/tracking/primitives/cache", + "module": "@glimmer/tracking/primitives/cache" + }, + { + "file": "packages/@ember/-internals/metal/lib/cache.ts", + "line": 56, + "description": "Gets the value of a cache created with `createCache`.\n\n```js\nimport { tracked } from '@glimmer/tracking';\nimport { createCache, getValue } from '@glimmer/tracking/primitives/cache';\n\nlet computeCount = 0;\n\nlet counter = createCache(() => {\n return ++computeCount;\n});\n\ngetValue(counter); // 1\n```", + "itemtype": "method", + "name": "getValue", + "static": 1, + "access": "public", + "tagname": "", + "class": "@glimmer/tracking/primitives/cache", + "module": "@glimmer/tracking/primitives/cache" + }, + { + "file": "packages/@ember/-internals/metal/lib/cache.ts", + "line": 78, + "description": "Can be used to check if a memoized function is _constant_. If no tracked state\nwas used while running a memoized function, it will never rerun, because nothing\ncan invalidate its result. `isConst` can be used to determine if a memoized\nfunction is constant or not, in order to optimize code surrounding that\nfunction.\n\n```js\nimport { tracked } from '@glimmer/tracking';\nimport { createCache, getValue, isConst } from '@glimmer/tracking/primitives/cache';\n\nclass State {\n @tracked value;\n}\n\nlet state = new State();\nlet computeCount = 0;\n\nlet counter = createCache(() => {\n // consume the state\n state.value;\n\n return computeCount++;\n});\n\nlet constCounter = createCache(() => {\n return computeCount++;\n});\n\ngetValue(counter);\ngetValue(constCounter);\n\nisConst(counter); // false\nisConst(constCounter); // true\n```\n\nIf called on a cache that hasn't been accessed yet, it will throw an\nerror. This is because there's no way to know if the function will be constant\nor not yet, and so this helps prevent missing an optimization opportunity on\naccident.", + "itemtype": "method", + "name": "isConst", + "static": 1, + "access": "public", + "tagname": "", + "class": "@glimmer/tracking/primitives/cache", + "module": "@glimmer/tracking/primitives/cache" + } + ] + }, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/modules/ember-5.3.0-ember.json b/json-docs/ember/5.3.0/modules/ember-5.3.0-ember.json new file mode 100644 index 000000000..288257476 --- /dev/null +++ b/json-docs/ember/5.3.0/modules/ember-5.3.0-ember.json @@ -0,0 +1,67 @@ +{ + "data": { + "id": "ember-5.3.0-ember", + "type": "module", + "attributes": { + "name": "ember", + "submodules": {}, + "elements": {}, + "fors": { + "Ember.Templates.helpers": 1, + "@ember/helper": 1, + "Ember": 1, + "@ember/object": 1, + "Ember.Test": 1 + }, + "namespaces": { + "Ember": 1, + "Ember.Test": 1 + }, + "tag": "module", + "file": "packages/ember-testing/lib/test.ts", + "line": 11, + "access": "private", + "tagname": "", + "parent": null, + "publicclasses": [ + "Ember.Templates.helpers", + "Ember.NativeArray", + "Ember.Test.QUnitAdapter", + "Ember.Test" + ], + "privateclasses": [ + "ComponentStateBucket", + "Ember.InjectedProperty", + "Libraries", + "Ember.ProxyMixin", + "Ember.ActionHandler", + "Ember.Comparable", + "ContainerProxyMixin", + "RegistryProxyMixin", + "Ember.TargetActionSupport", + "Ember.String", + "Ember.ActionSupport", + "Ember.ClassNamesSupport", + "Ember.ViewMixin", + "Ember.EventDispatcher", + "Ember.CoreView", + "Ember.MutableEnumerable", + "RoutingService" + ], + "staticfunctions": {}, + "allstaticfunctions": {}, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/modules/ember-5.3.0-ember/routing.json b/json-docs/ember/5.3.0/modules/ember-5.3.0-ember/routing.json new file mode 100644 index 000000000..cfe6226b6 --- /dev/null +++ b/json-docs/ember/5.3.0/modules/ember-5.3.0-ember/routing.json @@ -0,0 +1,35 @@ +{ + "data": { + "id": "ember-5.3.0-ember/routing", + "type": "module", + "attributes": { + "name": "ember/routing", + "submodules": {}, + "elements": {}, + "fors": { + "Ember": 1 + }, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/routing/lib/controller_for.ts", + "line": 5, + "parent": null, + "publicclasses": [], + "privateclasses": [], + "staticfunctions": {}, + "allstaticfunctions": {}, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/modules/ember-5.3.0-rsvp.json b/json-docs/ember/5.3.0/modules/ember-5.3.0-rsvp.json new file mode 100644 index 000000000..776716727 --- /dev/null +++ b/json-docs/ember/5.3.0/modules/ember-5.3.0-rsvp.json @@ -0,0 +1,728 @@ +{ + "data": { + "id": "ember-5.3.0-rsvp", + "type": "module", + "attributes": { + "name": "rsvp", + "submodules": {}, + "elements": {}, + "fors": { + "rsvp": 1, + "EventTarget": 1, + "EmberENV": 1 + }, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/-internals/environment/lib/env.ts", + "line": 4, + "access": "public", + "tagname": "", + "parent": null, + "publicclasses": [ + "Promise", + "EventTarget", + "EmberENV" + ], + "privateclasses": [ + "Container", + "Registry" + ], + "staticfunctions": { + "rsvp": [ + { + "file": "node_modules/rsvp/lib/rsvp/all.js", + "line": 3, + "description": "This is a convenient alias for `Promise.all`.", + "itemtype": "method", + "name": "all", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "array", + "description": "Array of promises.", + "type": "Array" + }, + { + "name": "label", + "description": "An optional label. This is useful\nfor tooling.", + "type": "String", + "optional": true + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/all-settled.js", + "line": 20, + "description": "`RSVP.allSettled` is similar to `RSVP.all`, but instead of implementing\na fail-fast method, it waits until all the promises have returned and\nshows you all the results. This is useful if you want to handle multiple\npromises' failure states together as a set.\n\nReturns a promise that is fulfilled when all the given promises have been\nsettled. The return promise is fulfilled with an array of the states of\nthe promises passed into the `promises` array argument.\n\nEach state object will either indicate fulfillment or rejection, and\nprovide the corresponding value or reason. The states will take one of\nthe following formats:\n\n```javascript\n{ state: 'fulfilled', value: value }\n or\n{ state: 'rejected', reason: reason }\n```\n\nExample:\n\n```javascript\nlet promise1 = RSVP.Promise.resolve(1);\nlet promise2 = RSVP.Promise.reject(new Error('2'));\nlet promise3 = RSVP.Promise.reject(new Error('3'));\nlet promises = [ promise1, promise2, promise3 ];\n\nRSVP.allSettled(promises).then(function(array){\n // array == [\n // { state: 'fulfilled', value: 1 },\n // { state: 'rejected', reason: Error },\n // { state: 'rejected', reason: Error }\n // ]\n // Note that for the second item, reason.message will be '2', and for the\n // third item, reason.message will be '3'.\n}, function(error) {\n // Not run. (This block would only be called if allSettled had failed,\n // for instance if passed an incorrect argument type.)\n});\n```", + "itemtype": "method", + "name": "allSettled", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "entries", + "description": "", + "type": "Array" + }, + { + "name": "label", + "description": "- optional string that describes the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled with an array of the settled\nstates of the constituent promises.", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/defer.js", + "line": 3, + "description": "`defer` returns an object similar to jQuery's `$.Deferred`.\n`defer` should be used when porting over code reliant on `$.Deferred`'s\ninterface. New code should use the `Promise` constructor instead.\n\nThe object returned from `defer` is a plain object with three properties:\n\n* promise - an `Promise`.\n* reject - a function that causes the `promise` property on this object to\n become rejected\n* resolve - a function that causes the `promise` property on this object to\n become fulfilled.\n\nExample:\n\n ```javascript\n let deferred = defer();\n\n deferred.resolve(\"Success!\");\n\n deferred.promise.then(function(value){\n // value here is \"Success!\"\n });\n ```", + "itemtype": "method", + "name": "defer", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/node.js", + "line": 44, + "description": "`denodeify` takes a 'node-style' function and returns a function that\nwill return an `Promise`. You can use `denodeify` in Node.js or the\nbrowser when you'd prefer to use promises over using callbacks. For example,\n`denodeify` transforms the following:\n\n```javascript\nlet fs = require('fs');\n\nfs.readFile('myfile.txt', function(err, data){\n if (err) return handleError(err);\n handleData(data);\n});\n```\n\ninto:\n\n```javascript\nlet fs = require('fs');\nlet readFile = denodeify(fs.readFile);\n\nreadFile('myfile.txt').then(handleData, handleError);\n```\n\nIf the node function has multiple success parameters, then `denodeify`\njust returns the first one:\n\n```javascript\nlet request = denodeify(require('request'));\n\nrequest('http://example.com').then(function(res) {\n // ...\n});\n```\n\nHowever, if you need all success parameters, setting `denodeify`'s\nsecond parameter to `true` causes it to return all success parameters\nas an array:\n\n```javascript\nlet request = denodeify(require('request'), true);\n\nrequest('http://example.com').then(function(result) {\n // result[0] -> res\n // result[1] -> body\n});\n```\n\nOr if you pass it an array with names it returns the parameters as a hash:\n\n```javascript\nlet request = denodeify(require('request'), ['res', 'body']);\n\nrequest('http://example.com').then(function(result) {\n // result.res\n // result.body\n});\n```\n\nSometimes you need to retain the `this`:\n\n```javascript\nlet app = require('express')();\nlet render = denodeify(app.render.bind(app));\n```\n\nThe denodified function inherits from the original function. It works in all\nenvironments, except IE 10 and below. Consequently all properties of the original\nfunction are available to you. However, any properties you change on the\ndenodeified function won't be changed on the original function. Example:\n\n```javascript\nlet request = denodeify(require('request')),\n cookieJar = request.jar(); // <- Inheritance is used here\n\nrequest('http://example.com', {jar: cookieJar}).then(function(res) {\n // cookieJar.cookies holds now the cookies returned by example.com\n});\n```\n\nUsing `denodeify` makes it easier to compose asynchronous operations instead\nof using callbacks. For example, instead of:\n\n```javascript\nlet fs = require('fs');\n\nfs.readFile('myfile.txt', function(err, data){\n if (err) { ... } // Handle error\n fs.writeFile('myfile2.txt', data, function(err){\n if (err) { ... } // Handle error\n console.log('done')\n });\n});\n```\n\nyou can chain the operations together using `then` from the returned promise:\n\n```javascript\nlet fs = require('fs');\nlet readFile = denodeify(fs.readFile);\nlet writeFile = denodeify(fs.writeFile);\n\nreadFile('myfile.txt').then(function(data){\n return writeFile('myfile2.txt', data);\n}).then(function(){\n console.log('done')\n}).catch(function(error){\n // Handle error\n});\n```", + "itemtype": "method", + "name": "denodeify", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "nodeFunc", + "description": "a 'node-style' function that takes a callback as\nits last argument. The callback expects an error to be passed as its first\nargument (if an error occurred, otherwise null), and the value from the\noperation as its second argument ('function(err, value){ }').", + "type": "Function" + }, + { + "name": "options", + "description": "An optional paramter that if set\nto `true` causes the promise to fulfill with the callback's success arguments\nas an array. This is useful if the node function has multiple success\nparamters. If you set this paramter to an array with names, the promise will\nfulfill with a hash with these names as keys and the success parameters as\nvalues.", + "type": "Boolean|Array", + "optional": true + } + ], + "return": { + "description": "a function that wraps `nodeFunc` to return a `Promise`", + "type": "Function" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/filter.js", + "line": 42, + "description": "`filter` is similar to JavaScript's native `filter` method.\n`filterFn` is eagerly called meaning that as soon as any promise\n resolves its value will be passed to `filterFn`. `filter` returns\n a promise that will become fulfilled with the result of running\n `filterFn` on the values the promises become fulfilled with.\n\n For example:\n\n ```javascript\n import { filter, resolve } from 'rsvp';\n\n let promise1 = resolve(1);\n let promise2 = resolve(2);\n let promise3 = resolve(3);\n\n let promises = [promise1, promise2, promise3];\n\n let filterFn = function(item){\n return item > 1;\n };\n\n filter(promises, filterFn).then(function(result){\n // result is [ 2, 3 ]\n });\n ```\n\n If any of the `promises` given to `filter` are rejected, the first promise\n that is rejected will be given as an argument to the returned promise's\n rejection handler. For example:\n\n ```javascript\n import { filter, reject, resolve } from 'rsvp';\n\n let promise1 = resolve(1);\n let promise2 = reject(new Error('2'));\n let promise3 = reject(new Error('3'));\n let promises = [ promise1, promise2, promise3 ];\n\n let filterFn = function(item){\n return item > 1;\n };\n\n filter(promises, filterFn).then(function(array){\n // Code here never runs because there are rejected promises!\n }, function(reason) {\n // reason.message === '2'\n });\n ```\n\n `filter` will also wait for any promises returned from `filterFn`.\n For instance, you may want to fetch a list of users then return a subset\n of those users based on some asynchronous operation:\n\n ```javascript\n import { filter, resolve } from 'rsvp';\n\n let alice = { name: 'alice' };\n let bob = { name: 'bob' };\n let users = [ alice, bob ];\n\n let promises = users.map(function(user){\n return resolve(user);\n });\n\n let filterFn = function(user){\n // Here, Alice has permissions to create a blog post, but Bob does not.\n return getPrivilegesForUser(user).then(function(privs){\n return privs.can_create_blog_post === true;\n });\n };\n filter(promises, filterFn).then(function(users){\n // true, because the server told us only Alice can create a blog post.\n users.length === 1;\n // false, because Alice is the only user present in `users`\n users[0] === bob;\n });\n ```", + "itemtype": "method", + "name": "filter", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "promises", + "description": "", + "type": "Array" + }, + { + "name": "filterFn", + "description": "- function to be called on each resolved value to\n filter the final results.", + "type": "Function" + }, + { + "name": "label", + "description": "optional string describing the promise. Useful for\n tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/hash.js", + "line": 4, + "description": "`hash` is similar to `all`, but takes an object instead of an array\nfor its `promises` argument.\n\nReturns a promise that is fulfilled when all the given promises have been\nfulfilled, or rejected if any of them become rejected. The returned promise\nis fulfilled with a hash that has the same key names as the `promises` object\nargument. If any of the values in the object are not promises, they will\nsimply be copied over to the fulfilled object.\n\nExample:\n\n```javascript\nlet promises = {\n myPromise: resolve(1),\n yourPromise: resolve(2),\n theirPromise: resolve(3),\n notAPromise: 4\n};\n\nhash(promises).then(function(hash){\n // hash here is an object that looks like:\n // {\n // myPromise: 1,\n // yourPromise: 2,\n // theirPromise: 3,\n // notAPromise: 4\n // }\n});\n```\n\nIf any of the `promises` given to `hash` are rejected, the first promise\nthat is rejected will be given as the reason to the rejection handler.\n\nExample:\n\n```javascript\nlet promises = {\n myPromise: resolve(1),\n rejectedPromise: reject(new Error('rejectedPromise')),\n anotherRejectedPromise: reject(new Error('anotherRejectedPromise')),\n};\n\nhash(promises).then(function(hash){\n // Code here never runs because there are rejected promises!\n}, function(reason) {\n // reason.message === 'rejectedPromise'\n});\n```\n\nAn important note: `hash` is intended for plain JavaScript objects that\nare just a set of keys and values. `hash` will NOT preserve prototype\nchains.\n\nExample:\n\n```javascript\nimport { hash, resolve } from 'rsvp';\nfunction MyConstructor(){\n this.example = resolve('Example');\n}\n\nMyConstructor.prototype = {\n protoProperty: resolve('Proto Property')\n};\n\nlet myObject = new MyConstructor();\n\nhash(myObject).then(function(hash){\n // protoProperty will not be present, instead you will just have an\n // object that looks like:\n // {\n // example: 'Example'\n // }\n //\n // hash.hasOwnProperty('protoProperty'); // false\n // 'undefined' === typeof hash.protoProperty\n});\n```", + "itemtype": "method", + "name": "hash", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "object", + "description": "", + "type": "Object" + }, + { + "name": "label", + "description": "optional string that describes the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled when all properties of `promises`\nhave been fulfilled, or rejected if any of them become rejected.", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/hash-settled.js", + "line": 16, + "description": "`hashSettled` is similar to `allSettled`, but takes an object\ninstead of an array for its `promises` argument.\n\nUnlike `all` or `hash`, which implement a fail-fast method,\nbut like `allSettled`, `hashSettled` waits until all the\nconstituent promises have returned and then shows you all the results\nwith their states and values/reasons. This is useful if you want to\nhandle multiple promises' failure states together as a set.\n\nReturns a promise that is fulfilled when all the given promises have been\nsettled, or rejected if the passed parameters are invalid.\n\nThe returned promise is fulfilled with a hash that has the same key names as\nthe `promises` object argument. If any of the values in the object are not\npromises, they will be copied over to the fulfilled object and marked with state\n'fulfilled'.\n\nExample:\n\n```javascript\nimport { hashSettled, resolve } from 'rsvp';\n\nlet promises = {\n myPromise: resolve(1),\n yourPromise: resolve(2),\n theirPromise: resolve(3),\n notAPromise: 4\n};\n\nhashSettled(promises).then(function(hash){\n // hash here is an object that looks like:\n // {\n // myPromise: { state: 'fulfilled', value: 1 },\n // yourPromise: { state: 'fulfilled', value: 2 },\n // theirPromise: { state: 'fulfilled', value: 3 },\n // notAPromise: { state: 'fulfilled', value: 4 }\n // }\n});\n```\n\nIf any of the `promises` given to `hash` are rejected, the state will\nbe set to 'rejected' and the reason for rejection provided.\n\nExample:\n\n```javascript\nimport { hashSettled, reject, resolve } from 'rsvp';\n\nlet promises = {\n myPromise: resolve(1),\n rejectedPromise: reject(new Error('rejection')),\n anotherRejectedPromise: reject(new Error('more rejection')),\n};\n\nhashSettled(promises).then(function(hash){\n // hash here is an object that looks like:\n // {\n // myPromise: { state: 'fulfilled', value: 1 },\n // rejectedPromise: { state: 'rejected', reason: Error },\n // anotherRejectedPromise: { state: 'rejected', reason: Error },\n // }\n // Note that for rejectedPromise, reason.message == 'rejection',\n // and for anotherRejectedPromise, reason.message == 'more rejection'.\n});\n```\n\nAn important note: `hashSettled` is intended for plain JavaScript objects that\nare just a set of keys and values. `hashSettled` will NOT preserve prototype\nchains.\n\nExample:\n\n```javascript\nimport Promise, { hashSettled, resolve } from 'rsvp';\n\nfunction MyConstructor(){\n this.example = resolve('Example');\n}\n\nMyConstructor.prototype = {\n protoProperty: Promise.resolve('Proto Property')\n};\n\nlet myObject = new MyConstructor();\n\nhashSettled(myObject).then(function(hash){\n // protoProperty will not be present, instead you will just have an\n // object that looks like:\n // {\n // example: { state: 'fulfilled', value: 'Example' }\n // }\n //\n // hash.hasOwnProperty('protoProperty'); // false\n // 'undefined' === typeof hash.protoProperty\n});\n```", + "itemtype": "method", + "name": "hashSettled", + "access": "public", + "tagname": "", + "params": [ + { + "name": "object", + "description": "", + "type": "Object" + }, + { + "name": "label", + "description": "optional string that describes the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled when when all properties of `promises`\nhave been settled.", + "type": "Promise" + }, + "static": 1, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/map.js", + "line": 39, + "description": "`map` is similar to JavaScript's native `map` method. `mapFn` is eagerly called\n meaning that as soon as any promise resolves its value will be passed to `mapFn`.\n `map` returns a promise that will become fulfilled with the result of running\n `mapFn` on the values the promises become fulfilled with.\n\n For example:\n\n ```javascript\n import { map, resolve } from 'rsvp';\n\n let promise1 = resolve(1);\n let promise2 = resolve(2);\n let promise3 = resolve(3);\n let promises = [ promise1, promise2, promise3 ];\n\n let mapFn = function(item){\n return item + 1;\n };\n\n map(promises, mapFn).then(function(result){\n // result is [ 2, 3, 4 ]\n });\n ```\n\n If any of the `promises` given to `map` are rejected, the first promise\n that is rejected will be given as an argument to the returned promise's\n rejection handler. For example:\n\n ```javascript\n import { map, reject, resolve } from 'rsvp';\n\n let promise1 = resolve(1);\n let promise2 = reject(new Error('2'));\n let promise3 = reject(new Error('3'));\n let promises = [ promise1, promise2, promise3 ];\n\n let mapFn = function(item){\n return item + 1;\n };\n\n map(promises, mapFn).then(function(array){\n // Code here never runs because there are rejected promises!\n }, function(reason) {\n // reason.message === '2'\n });\n ```\n\n `map` will also wait if a promise is returned from `mapFn`. For example,\n say you want to get all comments from a set of blog posts, but you need\n the blog posts first because they contain a url to those comments.\n\n ```javscript\n import { map } from 'rsvp';\n\n let mapFn = function(blogPost){\n // getComments does some ajax and returns an Promise that is fulfilled\n // with some comments data\n return getComments(blogPost.comments_url);\n };\n\n // getBlogPosts does some ajax and returns an Promise that is fulfilled\n // with some blog post data\n map(getBlogPosts(), mapFn).then(function(comments){\n // comments is the result of asking the server for the comments\n // of all blog posts returned from getBlogPosts()\n });\n ```", + "itemtype": "method", + "name": "map", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "promises", + "description": "", + "type": "Array" + }, + { + "name": "mapFn", + "description": "function to be called on each fulfilled promise.", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\n Useful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled with the result of calling\n `mapFn` on each fulfilled promise or value when they become fulfilled.\n The promise will be rejected if any of the given `promises` become rejected.", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/race.js", + "line": 3, + "description": "This is a convenient alias for `Promise.race`.", + "itemtype": "method", + "name": "race", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "array", + "description": "Array of promises.", + "type": "Array" + }, + { + "name": "label", + "description": "An optional label. This is useful\nfor tooling.", + "type": "String", + "optional": true + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/reject.js", + "line": 3, + "description": "This is a convenient alias for `Promise.reject`.", + "itemtype": "method", + "name": "reject", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "reason", + "description": "value that the returned promise will be rejected with.", + "type": "*" + }, + { + "name": "label", + "description": "optional string for identifying the returned promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise rejected with the given `reason`.", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/resolve.js", + "line": 3, + "description": "This is a convenient alias for `Promise.resolve`.", + "itemtype": "method", + "name": "resolve", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "value", + "description": "value that the returned promise will be resolved with", + "type": "*" + }, + { + "name": "label", + "description": "optional string for identifying the returned promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise that will become fulfilled with the given\n`value`", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/rethrow.js", + "line": 1, + "description": "`rethrow` will rethrow an error on the next turn of the JavaScript event\nloop in order to aid debugging.\n\nPromises A+ specifies that any exceptions that occur with a promise must be\ncaught by the promises implementation and bubbled to the last handler. For\nthis reason, it is recommended that you always specify a second rejection\nhandler function to `then`. However, `rethrow` will throw the exception\noutside of the promise, so it bubbles up to your console if in the browser,\nor domain/cause uncaught exception in Node. `rethrow` will also throw the\nerror again so the error can be handled by the promise per the spec.\n\n```javascript\nimport { rethrow } from 'rsvp';\n\nfunction throws(){\n throw new Error('Whoops!');\n}\n\nlet promise = new Promise(function(resolve, reject){\n throws();\n});\n\npromise.catch(rethrow).then(function(){\n // Code here doesn't run because the promise became rejected due to an\n // error!\n}, function (err){\n // handle the error here\n});\n```\n\nThe 'Whoops' error will be thrown on the next turn of the event loop\nand you can watch for it in your console. You can also handle it using a\nrejection handler given to `.then` or `.catch` on the returned promise.", + "itemtype": "method", + "name": "rethrow", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "reason", + "description": "reason the promise became rejected.", + "type": "Error" + } + ], + "throws": { + "description": "Error" + }, + "class": "rsvp", + "module": "rsvp" + } + ] + }, + "allstaticfunctions": { + "rsvp": [ + { + "file": "node_modules/rsvp/lib/rsvp/all.js", + "line": 3, + "description": "This is a convenient alias for `Promise.all`.", + "itemtype": "method", + "name": "all", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "array", + "description": "Array of promises.", + "type": "Array" + }, + { + "name": "label", + "description": "An optional label. This is useful\nfor tooling.", + "type": "String", + "optional": true + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/all-settled.js", + "line": 20, + "description": "`RSVP.allSettled` is similar to `RSVP.all`, but instead of implementing\na fail-fast method, it waits until all the promises have returned and\nshows you all the results. This is useful if you want to handle multiple\npromises' failure states together as a set.\n\nReturns a promise that is fulfilled when all the given promises have been\nsettled. The return promise is fulfilled with an array of the states of\nthe promises passed into the `promises` array argument.\n\nEach state object will either indicate fulfillment or rejection, and\nprovide the corresponding value or reason. The states will take one of\nthe following formats:\n\n```javascript\n{ state: 'fulfilled', value: value }\n or\n{ state: 'rejected', reason: reason }\n```\n\nExample:\n\n```javascript\nlet promise1 = RSVP.Promise.resolve(1);\nlet promise2 = RSVP.Promise.reject(new Error('2'));\nlet promise3 = RSVP.Promise.reject(new Error('3'));\nlet promises = [ promise1, promise2, promise3 ];\n\nRSVP.allSettled(promises).then(function(array){\n // array == [\n // { state: 'fulfilled', value: 1 },\n // { state: 'rejected', reason: Error },\n // { state: 'rejected', reason: Error }\n // ]\n // Note that for the second item, reason.message will be '2', and for the\n // third item, reason.message will be '3'.\n}, function(error) {\n // Not run. (This block would only be called if allSettled had failed,\n // for instance if passed an incorrect argument type.)\n});\n```", + "itemtype": "method", + "name": "allSettled", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "entries", + "description": "", + "type": "Array" + }, + { + "name": "label", + "description": "- optional string that describes the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled with an array of the settled\nstates of the constituent promises.", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/defer.js", + "line": 3, + "description": "`defer` returns an object similar to jQuery's `$.Deferred`.\n`defer` should be used when porting over code reliant on `$.Deferred`'s\ninterface. New code should use the `Promise` constructor instead.\n\nThe object returned from `defer` is a plain object with three properties:\n\n* promise - an `Promise`.\n* reject - a function that causes the `promise` property on this object to\n become rejected\n* resolve - a function that causes the `promise` property on this object to\n become fulfilled.\n\nExample:\n\n ```javascript\n let deferred = defer();\n\n deferred.resolve(\"Success!\");\n\n deferred.promise.then(function(value){\n // value here is \"Success!\"\n });\n ```", + "itemtype": "method", + "name": "defer", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/node.js", + "line": 44, + "description": "`denodeify` takes a 'node-style' function and returns a function that\nwill return an `Promise`. You can use `denodeify` in Node.js or the\nbrowser when you'd prefer to use promises over using callbacks. For example,\n`denodeify` transforms the following:\n\n```javascript\nlet fs = require('fs');\n\nfs.readFile('myfile.txt', function(err, data){\n if (err) return handleError(err);\n handleData(data);\n});\n```\n\ninto:\n\n```javascript\nlet fs = require('fs');\nlet readFile = denodeify(fs.readFile);\n\nreadFile('myfile.txt').then(handleData, handleError);\n```\n\nIf the node function has multiple success parameters, then `denodeify`\njust returns the first one:\n\n```javascript\nlet request = denodeify(require('request'));\n\nrequest('http://example.com').then(function(res) {\n // ...\n});\n```\n\nHowever, if you need all success parameters, setting `denodeify`'s\nsecond parameter to `true` causes it to return all success parameters\nas an array:\n\n```javascript\nlet request = denodeify(require('request'), true);\n\nrequest('http://example.com').then(function(result) {\n // result[0] -> res\n // result[1] -> body\n});\n```\n\nOr if you pass it an array with names it returns the parameters as a hash:\n\n```javascript\nlet request = denodeify(require('request'), ['res', 'body']);\n\nrequest('http://example.com').then(function(result) {\n // result.res\n // result.body\n});\n```\n\nSometimes you need to retain the `this`:\n\n```javascript\nlet app = require('express')();\nlet render = denodeify(app.render.bind(app));\n```\n\nThe denodified function inherits from the original function. It works in all\nenvironments, except IE 10 and below. Consequently all properties of the original\nfunction are available to you. However, any properties you change on the\ndenodeified function won't be changed on the original function. Example:\n\n```javascript\nlet request = denodeify(require('request')),\n cookieJar = request.jar(); // <- Inheritance is used here\n\nrequest('http://example.com', {jar: cookieJar}).then(function(res) {\n // cookieJar.cookies holds now the cookies returned by example.com\n});\n```\n\nUsing `denodeify` makes it easier to compose asynchronous operations instead\nof using callbacks. For example, instead of:\n\n```javascript\nlet fs = require('fs');\n\nfs.readFile('myfile.txt', function(err, data){\n if (err) { ... } // Handle error\n fs.writeFile('myfile2.txt', data, function(err){\n if (err) { ... } // Handle error\n console.log('done')\n });\n});\n```\n\nyou can chain the operations together using `then` from the returned promise:\n\n```javascript\nlet fs = require('fs');\nlet readFile = denodeify(fs.readFile);\nlet writeFile = denodeify(fs.writeFile);\n\nreadFile('myfile.txt').then(function(data){\n return writeFile('myfile2.txt', data);\n}).then(function(){\n console.log('done')\n}).catch(function(error){\n // Handle error\n});\n```", + "itemtype": "method", + "name": "denodeify", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "nodeFunc", + "description": "a 'node-style' function that takes a callback as\nits last argument. The callback expects an error to be passed as its first\nargument (if an error occurred, otherwise null), and the value from the\noperation as its second argument ('function(err, value){ }').", + "type": "Function" + }, + { + "name": "options", + "description": "An optional paramter that if set\nto `true` causes the promise to fulfill with the callback's success arguments\nas an array. This is useful if the node function has multiple success\nparamters. If you set this paramter to an array with names, the promise will\nfulfill with a hash with these names as keys and the success parameters as\nvalues.", + "type": "Boolean|Array", + "optional": true + } + ], + "return": { + "description": "a function that wraps `nodeFunc` to return a `Promise`", + "type": "Function" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/filter.js", + "line": 42, + "description": "`filter` is similar to JavaScript's native `filter` method.\n`filterFn` is eagerly called meaning that as soon as any promise\n resolves its value will be passed to `filterFn`. `filter` returns\n a promise that will become fulfilled with the result of running\n `filterFn` on the values the promises become fulfilled with.\n\n For example:\n\n ```javascript\n import { filter, resolve } from 'rsvp';\n\n let promise1 = resolve(1);\n let promise2 = resolve(2);\n let promise3 = resolve(3);\n\n let promises = [promise1, promise2, promise3];\n\n let filterFn = function(item){\n return item > 1;\n };\n\n filter(promises, filterFn).then(function(result){\n // result is [ 2, 3 ]\n });\n ```\n\n If any of the `promises` given to `filter` are rejected, the first promise\n that is rejected will be given as an argument to the returned promise's\n rejection handler. For example:\n\n ```javascript\n import { filter, reject, resolve } from 'rsvp';\n\n let promise1 = resolve(1);\n let promise2 = reject(new Error('2'));\n let promise3 = reject(new Error('3'));\n let promises = [ promise1, promise2, promise3 ];\n\n let filterFn = function(item){\n return item > 1;\n };\n\n filter(promises, filterFn).then(function(array){\n // Code here never runs because there are rejected promises!\n }, function(reason) {\n // reason.message === '2'\n });\n ```\n\n `filter` will also wait for any promises returned from `filterFn`.\n For instance, you may want to fetch a list of users then return a subset\n of those users based on some asynchronous operation:\n\n ```javascript\n import { filter, resolve } from 'rsvp';\n\n let alice = { name: 'alice' };\n let bob = { name: 'bob' };\n let users = [ alice, bob ];\n\n let promises = users.map(function(user){\n return resolve(user);\n });\n\n let filterFn = function(user){\n // Here, Alice has permissions to create a blog post, but Bob does not.\n return getPrivilegesForUser(user).then(function(privs){\n return privs.can_create_blog_post === true;\n });\n };\n filter(promises, filterFn).then(function(users){\n // true, because the server told us only Alice can create a blog post.\n users.length === 1;\n // false, because Alice is the only user present in `users`\n users[0] === bob;\n });\n ```", + "itemtype": "method", + "name": "filter", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "promises", + "description": "", + "type": "Array" + }, + { + "name": "filterFn", + "description": "- function to be called on each resolved value to\n filter the final results.", + "type": "Function" + }, + { + "name": "label", + "description": "optional string describing the promise. Useful for\n tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/hash.js", + "line": 4, + "description": "`hash` is similar to `all`, but takes an object instead of an array\nfor its `promises` argument.\n\nReturns a promise that is fulfilled when all the given promises have been\nfulfilled, or rejected if any of them become rejected. The returned promise\nis fulfilled with a hash that has the same key names as the `promises` object\nargument. If any of the values in the object are not promises, they will\nsimply be copied over to the fulfilled object.\n\nExample:\n\n```javascript\nlet promises = {\n myPromise: resolve(1),\n yourPromise: resolve(2),\n theirPromise: resolve(3),\n notAPromise: 4\n};\n\nhash(promises).then(function(hash){\n // hash here is an object that looks like:\n // {\n // myPromise: 1,\n // yourPromise: 2,\n // theirPromise: 3,\n // notAPromise: 4\n // }\n});\n```\n\nIf any of the `promises` given to `hash` are rejected, the first promise\nthat is rejected will be given as the reason to the rejection handler.\n\nExample:\n\n```javascript\nlet promises = {\n myPromise: resolve(1),\n rejectedPromise: reject(new Error('rejectedPromise')),\n anotherRejectedPromise: reject(new Error('anotherRejectedPromise')),\n};\n\nhash(promises).then(function(hash){\n // Code here never runs because there are rejected promises!\n}, function(reason) {\n // reason.message === 'rejectedPromise'\n});\n```\n\nAn important note: `hash` is intended for plain JavaScript objects that\nare just a set of keys and values. `hash` will NOT preserve prototype\nchains.\n\nExample:\n\n```javascript\nimport { hash, resolve } from 'rsvp';\nfunction MyConstructor(){\n this.example = resolve('Example');\n}\n\nMyConstructor.prototype = {\n protoProperty: resolve('Proto Property')\n};\n\nlet myObject = new MyConstructor();\n\nhash(myObject).then(function(hash){\n // protoProperty will not be present, instead you will just have an\n // object that looks like:\n // {\n // example: 'Example'\n // }\n //\n // hash.hasOwnProperty('protoProperty'); // false\n // 'undefined' === typeof hash.protoProperty\n});\n```", + "itemtype": "method", + "name": "hash", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "object", + "description": "", + "type": "Object" + }, + { + "name": "label", + "description": "optional string that describes the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled when all properties of `promises`\nhave been fulfilled, or rejected if any of them become rejected.", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/hash-settled.js", + "line": 16, + "description": "`hashSettled` is similar to `allSettled`, but takes an object\ninstead of an array for its `promises` argument.\n\nUnlike `all` or `hash`, which implement a fail-fast method,\nbut like `allSettled`, `hashSettled` waits until all the\nconstituent promises have returned and then shows you all the results\nwith their states and values/reasons. This is useful if you want to\nhandle multiple promises' failure states together as a set.\n\nReturns a promise that is fulfilled when all the given promises have been\nsettled, or rejected if the passed parameters are invalid.\n\nThe returned promise is fulfilled with a hash that has the same key names as\nthe `promises` object argument. If any of the values in the object are not\npromises, they will be copied over to the fulfilled object and marked with state\n'fulfilled'.\n\nExample:\n\n```javascript\nimport { hashSettled, resolve } from 'rsvp';\n\nlet promises = {\n myPromise: resolve(1),\n yourPromise: resolve(2),\n theirPromise: resolve(3),\n notAPromise: 4\n};\n\nhashSettled(promises).then(function(hash){\n // hash here is an object that looks like:\n // {\n // myPromise: { state: 'fulfilled', value: 1 },\n // yourPromise: { state: 'fulfilled', value: 2 },\n // theirPromise: { state: 'fulfilled', value: 3 },\n // notAPromise: { state: 'fulfilled', value: 4 }\n // }\n});\n```\n\nIf any of the `promises` given to `hash` are rejected, the state will\nbe set to 'rejected' and the reason for rejection provided.\n\nExample:\n\n```javascript\nimport { hashSettled, reject, resolve } from 'rsvp';\n\nlet promises = {\n myPromise: resolve(1),\n rejectedPromise: reject(new Error('rejection')),\n anotherRejectedPromise: reject(new Error('more rejection')),\n};\n\nhashSettled(promises).then(function(hash){\n // hash here is an object that looks like:\n // {\n // myPromise: { state: 'fulfilled', value: 1 },\n // rejectedPromise: { state: 'rejected', reason: Error },\n // anotherRejectedPromise: { state: 'rejected', reason: Error },\n // }\n // Note that for rejectedPromise, reason.message == 'rejection',\n // and for anotherRejectedPromise, reason.message == 'more rejection'.\n});\n```\n\nAn important note: `hashSettled` is intended for plain JavaScript objects that\nare just a set of keys and values. `hashSettled` will NOT preserve prototype\nchains.\n\nExample:\n\n```javascript\nimport Promise, { hashSettled, resolve } from 'rsvp';\n\nfunction MyConstructor(){\n this.example = resolve('Example');\n}\n\nMyConstructor.prototype = {\n protoProperty: Promise.resolve('Proto Property')\n};\n\nlet myObject = new MyConstructor();\n\nhashSettled(myObject).then(function(hash){\n // protoProperty will not be present, instead you will just have an\n // object that looks like:\n // {\n // example: { state: 'fulfilled', value: 'Example' }\n // }\n //\n // hash.hasOwnProperty('protoProperty'); // false\n // 'undefined' === typeof hash.protoProperty\n});\n```", + "itemtype": "method", + "name": "hashSettled", + "access": "public", + "tagname": "", + "params": [ + { + "name": "object", + "description": "", + "type": "Object" + }, + { + "name": "label", + "description": "optional string that describes the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled when when all properties of `promises`\nhave been settled.", + "type": "Promise" + }, + "static": 1, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/map.js", + "line": 39, + "description": "`map` is similar to JavaScript's native `map` method. `mapFn` is eagerly called\n meaning that as soon as any promise resolves its value will be passed to `mapFn`.\n `map` returns a promise that will become fulfilled with the result of running\n `mapFn` on the values the promises become fulfilled with.\n\n For example:\n\n ```javascript\n import { map, resolve } from 'rsvp';\n\n let promise1 = resolve(1);\n let promise2 = resolve(2);\n let promise3 = resolve(3);\n let promises = [ promise1, promise2, promise3 ];\n\n let mapFn = function(item){\n return item + 1;\n };\n\n map(promises, mapFn).then(function(result){\n // result is [ 2, 3, 4 ]\n });\n ```\n\n If any of the `promises` given to `map` are rejected, the first promise\n that is rejected will be given as an argument to the returned promise's\n rejection handler. For example:\n\n ```javascript\n import { map, reject, resolve } from 'rsvp';\n\n let promise1 = resolve(1);\n let promise2 = reject(new Error('2'));\n let promise3 = reject(new Error('3'));\n let promises = [ promise1, promise2, promise3 ];\n\n let mapFn = function(item){\n return item + 1;\n };\n\n map(promises, mapFn).then(function(array){\n // Code here never runs because there are rejected promises!\n }, function(reason) {\n // reason.message === '2'\n });\n ```\n\n `map` will also wait if a promise is returned from `mapFn`. For example,\n say you want to get all comments from a set of blog posts, but you need\n the blog posts first because they contain a url to those comments.\n\n ```javscript\n import { map } from 'rsvp';\n\n let mapFn = function(blogPost){\n // getComments does some ajax and returns an Promise that is fulfilled\n // with some comments data\n return getComments(blogPost.comments_url);\n };\n\n // getBlogPosts does some ajax and returns an Promise that is fulfilled\n // with some blog post data\n map(getBlogPosts(), mapFn).then(function(comments){\n // comments is the result of asking the server for the comments\n // of all blog posts returned from getBlogPosts()\n });\n ```", + "itemtype": "method", + "name": "map", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "promises", + "description": "", + "type": "Array" + }, + { + "name": "mapFn", + "description": "function to be called on each fulfilled promise.", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\n Useful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled with the result of calling\n `mapFn` on each fulfilled promise or value when they become fulfilled.\n The promise will be rejected if any of the given `promises` become rejected.", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/race.js", + "line": 3, + "description": "This is a convenient alias for `Promise.race`.", + "itemtype": "method", + "name": "race", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "array", + "description": "Array of promises.", + "type": "Array" + }, + { + "name": "label", + "description": "An optional label. This is useful\nfor tooling.", + "type": "String", + "optional": true + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/reject.js", + "line": 3, + "description": "This is a convenient alias for `Promise.reject`.", + "itemtype": "method", + "name": "reject", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "reason", + "description": "value that the returned promise will be rejected with.", + "type": "*" + }, + { + "name": "label", + "description": "optional string for identifying the returned promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise rejected with the given `reason`.", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/resolve.js", + "line": 3, + "description": "This is a convenient alias for `Promise.resolve`.", + "itemtype": "method", + "name": "resolve", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "value", + "description": "value that the returned promise will be resolved with", + "type": "*" + }, + { + "name": "label", + "description": "optional string for identifying the returned promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise that will become fulfilled with the given\n`value`", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/rethrow.js", + "line": 1, + "description": "`rethrow` will rethrow an error on the next turn of the JavaScript event\nloop in order to aid debugging.\n\nPromises A+ specifies that any exceptions that occur with a promise must be\ncaught by the promises implementation and bubbled to the last handler. For\nthis reason, it is recommended that you always specify a second rejection\nhandler function to `then`. However, `rethrow` will throw the exception\noutside of the promise, so it bubbles up to your console if in the browser,\nor domain/cause uncaught exception in Node. `rethrow` will also throw the\nerror again so the error can be handled by the promise per the spec.\n\n```javascript\nimport { rethrow } from 'rsvp';\n\nfunction throws(){\n throw new Error('Whoops!');\n}\n\nlet promise = new Promise(function(resolve, reject){\n throws();\n});\n\npromise.catch(rethrow).then(function(){\n // Code here doesn't run because the promise became rejected due to an\n // error!\n}, function (err){\n // handle the error here\n});\n```\n\nThe 'Whoops' error will be thrown on the next turn of the event loop\nand you can watch for it in your console. You can also handle it using a\nrejection handler given to `.then` or `.catch` on the returned promise.", + "itemtype": "method", + "name": "rethrow", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "reason", + "description": "reason the promise became rejected.", + "type": "Error" + } + ], + "throws": { + "description": "Error" + }, + "class": "rsvp", + "module": "rsvp" + } + ] + }, + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [] + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/namespaces/ember-5.3.0-FEATURES.json b/json-docs/ember/5.3.0/namespaces/ember-5.3.0-FEATURES.json new file mode 100644 index 000000000..aeb7b406e --- /dev/null +++ b/json-docs/ember/5.3.0/namespaces/ember-5.3.0-FEATURES.json @@ -0,0 +1,71 @@ +{ + "data": { + "id": "ember-5.3.0-FEATURES", + "type": "namespace", + "attributes": { + "name": "FEATURES", + "shortname": "FEATURES", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/canary-features", + "namespace": "", + "file": "packages/@ember/canary-features/index.ts", + "line": 18, + "description": "

The hash of enabled Canary features. Add to this, any canary features\nbefore creating your application.

\n", + "static": 1, + "since": "1.1.0", + "access": "public", + "tagname": "", + "methods": [ + { + "file": "packages/@ember/canary-features/index.ts", + "line": 29, + "description": "

Determine whether the specified feature is enabled. Used by Ember's\nbuild tools to exclude experimental features from beta/stable builds.

\n

You can define the following configuration options:

\n
    \n
  • EmberENV.ENABLE_OPTIONAL_FEATURES - enable any features that have not been explicitly\nenabled/disabled.
  • \n
\n", + "itemtype": "method", + "name": "isEnabled", + "params": [ + { + "name": "feature", + "description": "The feature to check", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "since": "1.1.0", + "access": "public", + "tagname": "", + "class": "FEATURES", + "module": "@ember/canary-features" + } + ], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/canary-features", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/namespaces/ember-5.3.0-Instrumentation.json b/json-docs/ember/5.3.0/namespaces/ember-5.3.0-Instrumentation.json new file mode 100644 index 000000000..f91092136 --- /dev/null +++ b/json-docs/ember/5.3.0/namespaces/ember-5.3.0-Instrumentation.json @@ -0,0 +1,46 @@ +{ + "data": { + "id": "ember-5.3.0-Instrumentation", + "type": "namespace", + "attributes": { + "name": "Instrumentation", + "shortname": "Instrumentation", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/instrumentation", + "namespace": "", + "file": "packages/@ember/instrumentation/index.ts", + "line": 39, + "description": "

The purpose of the Ember Instrumentation module is\nto provide efficient, general-purpose instrumentation\nfor Ember.

\n

Subscribe to a listener by using subscribe:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n
import { subscribe } from '@ember/instrumentation';\n\nsubscribe("render", {\n  before(name, timestamp, payload) {\n\n  },\n\n  after(name, timestamp, payload) {\n\n  }\n});
\n
\n
\n \n

If you return a value from the before callback, that same\nvalue will be passed as a fourth parameter to the after\ncallback.

\n

Instrument a block of code by using instrument:

\n
\n
\n
\n \n \n \n \n \n \n \n
1\n2\n3\n4\n5\n
import { instrument } from '@ember/instrumentation';\n\ninstrument("render.handlebars", payload, function() {\n  // rendering logic\n}, binding);
\n
\n
\n \n

Event names passed to instrument are namespaced\nby periods, from more general to more specific. Subscribers\ncan listen for events by whatever level of granularity they\nare interested in.

\n

In the above example, the event is render.handlebars,\nand the subscriber listened for all events beginning with\nrender. It would receive callbacks for events named\nrender, render.handlebars, render.container, or\neven render.handlebars.layout.

\n", + "static": 1, + "access": "private", + "tagname": "", + "methods": [], + "events": [], + "properties": [] + }, + "relationships": { + "parent-class": { + "data": null + }, + "descendants": { + "data": [] + }, + "module": { + "data": { + "id": "ember-5.3.0-@ember/instrumentation", + "type": "module" + } + }, + "project-version": { + "data": { + "id": "ember-5.3.0", + "type": "project-version" + } + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/5.3.0/project-versions/ember-5.3.0.json b/json-docs/ember/5.3.0/project-versions/ember-5.3.0.json new file mode 100644 index 000000000..cc14b6c43 --- /dev/null +++ b/json-docs/ember/5.3.0/project-versions/ember-5.3.0.json @@ -0,0 +1,1053 @@ +{ + "data": { + "id": "ember-5.3.0", + "type": "project-version", + "attributes": { + "version": "5.3.0" + }, + "relationships": { + "classes": { + "data": [ + { + "id": "ember-5.3.0-Promise", + "type": "class" + }, + { + "id": "ember-5.3.0-EventTarget", + "type": "class" + }, + { + "id": "ember-5.3.0-Container", + "type": "class" + }, + { + "id": "ember-5.3.0-Registry", + "type": "class" + }, + { + "id": "ember-5.3.0-EmberENV", + "type": "class" + }, + { + "id": "ember-5.3.0-Ember.Templates.helpers", + "type": "class" + }, + { + "id": "ember-5.3.0-ComponentStateBucket", + "type": "class" + }, + { + "id": "ember-5.3.0-SafeString", + "type": "class" + }, + { + "id": "ember-5.3.0-Component", + "type": "class" + }, + { + "id": "ember-5.3.0-Helper", + "type": "class" + }, + { + "id": "ember-5.3.0-ComputedProperty", + "type": "class" + }, + { + "id": "ember-5.3.0-Descriptor", + "type": "class" + }, + { + "id": "ember-5.3.0-Ember.InjectedProperty", + "type": "class" + }, + { + "id": "ember-5.3.0-Libraries", + "type": "class" + }, + { + "id": "ember-5.3.0-FullName", + "type": "class" + }, + { + "id": "ember-5.3.0-BasicRegistry", + "type": "class" + }, + { + "id": "ember-5.3.0-BasicContainer", + "type": "class" + }, + { + "id": "ember-5.3.0-Owner", + "type": "class" + }, + { + "id": "ember-5.3.0-RegisterOptions", + "type": "class" + }, + { + "id": "ember-5.3.0-Factory", + "type": "class" + }, + { + "id": "ember-5.3.0-FactoryManager", + "type": "class" + }, + { + "id": "ember-5.3.0-Resolver", + "type": "class" + }, + { + "id": "ember-5.3.0-InternalFactory", + "type": "class" + }, + { + "id": "ember-5.3.0-ContainerProxy", + "type": "class" + }, + { + "id": "ember-5.3.0-RegistryProxy", + "type": "class" + }, + { + "id": "ember-5.3.0-Ember.ProxyMixin", + "type": "class" + }, + { + "id": "ember-5.3.0-Ember.ActionHandler", + "type": "class" + }, + { + "id": "ember-5.3.0-Ember.Comparable", + "type": "class" + }, + { + "id": "ember-5.3.0-ContainerProxyMixin", + "type": "class" + }, + { + "id": "ember-5.3.0-RegistryProxyMixin", + "type": "class" + }, + { + "id": "ember-5.3.0-Ember.TargetActionSupport", + "type": "class" + }, + { + "id": "ember-5.3.0-Ember.String", + "type": "class" + }, + { + "id": "ember-5.3.0-Ember.ActionSupport", + "type": "class" + }, + { + "id": "ember-5.3.0-Ember.ClassNamesSupport", + "type": "class" + }, + { + "id": "ember-5.3.0-Ember.ViewMixin", + "type": "class" + }, + { + "id": "ember-5.3.0-Ember.EventDispatcher", + "type": "class" + }, + { + "id": "ember-5.3.0-Ember.CoreView", + "type": "class" + }, + { + "id": "ember-5.3.0-Application", + "type": "class" + }, + { + "id": "ember-5.3.0-ApplicationInstance", + "type": "class" + }, + { + "id": "ember-5.3.0-ApplicationInstance.BootOptions", + "type": "class" + }, + { + "id": "ember-5.3.0-Namespace", + "type": "class" + }, + { + "id": "ember-5.3.0-EmberArray", + "type": "class" + }, + { + "id": "ember-5.3.0-MutableArray", + "type": "class" + }, + { + "id": "ember-5.3.0-Ember.NativeArray", + "type": "class" + }, + { + "id": "ember-5.3.0-ArrayProxy", + "type": "class" + }, + { + "id": "ember-5.3.0-Ember.ControllerMixin", + "type": "class" + }, + { + "id": "ember-5.3.0-Ember.Controller", + "type": "class" + }, + { + "id": "ember-5.3.0-ContainerDebugAdapter", + "type": "class" + }, + { + "id": "ember-5.3.0-DataAdapter", + "type": "class" + }, + { + "id": "ember-5.3.0-Engine", + "type": "class" + }, + { + "id": "ember-5.3.0-EngineInstance", + "type": "class" + }, + { + "id": "ember-5.3.0-Enumerable", + "type": "class" + }, + { + "id": "ember-5.3.0-Ember.MutableEnumerable", + "type": "class" + }, + { + "id": "ember-5.3.0-CoreObject", + "type": "class" + }, + { + "id": "ember-5.3.0-Evented", + "type": "class" + }, + { + "id": "ember-5.3.0-EmberObject", + "type": "class" + }, + { + "id": "ember-5.3.0-Mixin", + "type": "class" + }, + { + "id": "ember-5.3.0-Observable", + "type": "class" + }, + { + "id": "ember-5.3.0-PromiseProxyMixin", + "type": "class" + }, + { + "id": "ember-5.3.0-ObjectProxy", + "type": "class" + }, + { + "id": "ember-5.3.0-Renderer", + "type": "class" + }, + { + "id": "ember-5.3.0-BucketCache", + "type": "class" + }, + { + "id": "ember-5.3.0-RoutingService", + "type": "class" + }, + { + "id": "ember-5.3.0-HashLocation", + "type": "class" + }, + { + "id": "ember-5.3.0-HistoryLocation", + "type": "class" + }, + { + "id": "ember-5.3.0-Location", + "type": "class" + }, + { + "id": "ember-5.3.0-NoneLocation", + "type": "class" + }, + { + "id": "ember-5.3.0-RouteInfo", + "type": "class" + }, + { + "id": "ember-5.3.0-RouteInfoWithAttributes", + "type": "class" + }, + { + "id": "ember-5.3.0-Route", + "type": "class" + }, + { + "id": "ember-5.3.0-RouterService", + "type": "class" + }, + { + "id": "ember-5.3.0-EmberRouter", + "type": "class" + }, + { + "id": "ember-5.3.0-Transition", + "type": "class" + }, + { + "id": "ember-5.3.0-Service", + "type": "class" + }, + { + "id": "ember-5.3.0-TestAdapter", + "type": "class" + }, + { + "id": "ember-5.3.0-Ember.Test.QUnitAdapter", + "type": "class" + }, + { + "id": "ember-5.3.0-Ember.Test", + "type": "class" + } + ] + }, + "namespaces": { + "data": [ + { + "id": "ember-5.3.0-FEATURES", + "type": "namespace" + }, + { + "id": "ember-5.3.0-Instrumentation", + "type": "namespace" + } + ] + }, + "modules": { + "data": [ + { + "id": "ember-5.3.0-rsvp", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/component", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/routing", + "type": "module" + }, + { + "id": "ember-5.3.0-ember", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/template", + "type": "module" + }, + { + "id": "ember-5.3.0-@glimmer/component", + "type": "module" + }, + { + "id": "ember-5.3.0-@glimmer/tracking", + "type": "module" + }, + { + "id": "ember-5.3.0-@glimmer/tracking/primitives/cache", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/object", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/owner", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/utils", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/application", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/application/namespace", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/array", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/array/proxy", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/canary-features", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/component/template-only", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/controller", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/debug", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/debug/container-debug-adapter", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/debug/data-adapter", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/destroyable", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/engine", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/enumerable", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/helper", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/instrumentation", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/object/core", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/object/evented", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/object/mixin", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/object/observable", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/object/promise-proxy-mixin", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/object/proxy", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/renderer", + "type": "module" + }, + { + "id": "ember-5.3.0-ember/routing", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/routing/hash-location", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/routing/history-location", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/routing/location", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/routing/none-location", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/routing/route-info", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/routing/route", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/routing/router-service", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/routing/router", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/routing/transition", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/runloop", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/service", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/test", + "type": "module" + } + ] + }, + "project": { + "data": { + "id": "ember", + "type": "project" + } + }, + "private-classes": { + "data": [ + { + "id": "ember-5.3.0-Container", + "type": "class" + }, + { + "id": "ember-5.3.0-Registry", + "type": "class" + }, + { + "id": "ember-5.3.0-ComponentStateBucket", + "type": "class" + }, + { + "id": "ember-5.3.0-Descriptor", + "type": "class" + }, + { + "id": "ember-5.3.0-Ember.InjectedProperty", + "type": "class" + }, + { + "id": "ember-5.3.0-Libraries", + "type": "class" + }, + { + "id": "ember-5.3.0-BasicRegistry", + "type": "class" + }, + { + "id": "ember-5.3.0-BasicContainer", + "type": "class" + }, + { + "id": "ember-5.3.0-InternalFactory", + "type": "class" + }, + { + "id": "ember-5.3.0-ContainerProxy", + "type": "class" + }, + { + "id": "ember-5.3.0-RegistryProxy", + "type": "class" + }, + { + "id": "ember-5.3.0-Ember.ProxyMixin", + "type": "class" + }, + { + "id": "ember-5.3.0-Ember.ActionHandler", + "type": "class" + }, + { + "id": "ember-5.3.0-Ember.Comparable", + "type": "class" + }, + { + "id": "ember-5.3.0-ContainerProxyMixin", + "type": "class" + }, + { + "id": "ember-5.3.0-RegistryProxyMixin", + "type": "class" + }, + { + "id": "ember-5.3.0-Ember.TargetActionSupport", + "type": "class" + }, + { + "id": "ember-5.3.0-Ember.String", + "type": "class" + }, + { + "id": "ember-5.3.0-Ember.ActionSupport", + "type": "class" + }, + { + "id": "ember-5.3.0-Ember.ClassNamesSupport", + "type": "class" + }, + { + "id": "ember-5.3.0-Ember.ViewMixin", + "type": "class" + }, + { + "id": "ember-5.3.0-Ember.EventDispatcher", + "type": "class" + }, + { + "id": "ember-5.3.0-Ember.CoreView", + "type": "class" + }, + { + "id": "ember-5.3.0-Ember.ControllerMixin", + "type": "class" + }, + { + "id": "ember-5.3.0-Enumerable", + "type": "class" + }, + { + "id": "ember-5.3.0-Ember.MutableEnumerable", + "type": "class" + }, + { + "id": "ember-5.3.0-BucketCache", + "type": "class" + }, + { + "id": "ember-5.3.0-RoutingService", + "type": "class" + } + ] + }, + "public-classes": { + "data": [ + { + "id": "ember-5.3.0-Promise", + "type": "class" + }, + { + "id": "ember-5.3.0-EventTarget", + "type": "class" + }, + { + "id": "ember-5.3.0-EmberENV", + "type": "class" + }, + { + "id": "ember-5.3.0-Ember.Templates.helpers", + "type": "class" + }, + { + "id": "ember-5.3.0-SafeString", + "type": "class" + }, + { + "id": "ember-5.3.0-Component", + "type": "class" + }, + { + "id": "ember-5.3.0-Helper", + "type": "class" + }, + { + "id": "ember-5.3.0-ComputedProperty", + "type": "class" + }, + { + "id": "ember-5.3.0-FullName", + "type": "class" + }, + { + "id": "ember-5.3.0-Owner", + "type": "class" + }, + { + "id": "ember-5.3.0-RegisterOptions", + "type": "class" + }, + { + "id": "ember-5.3.0-Factory", + "type": "class" + }, + { + "id": "ember-5.3.0-FactoryManager", + "type": "class" + }, + { + "id": "ember-5.3.0-Resolver", + "type": "class" + }, + { + "id": "ember-5.3.0-Application", + "type": "class" + }, + { + "id": "ember-5.3.0-ApplicationInstance", + "type": "class" + }, + { + "id": "ember-5.3.0-ApplicationInstance.BootOptions", + "type": "class" + }, + { + "id": "ember-5.3.0-Namespace", + "type": "class" + }, + { + "id": "ember-5.3.0-EmberArray", + "type": "class" + }, + { + "id": "ember-5.3.0-MutableArray", + "type": "class" + }, + { + "id": "ember-5.3.0-Ember.NativeArray", + "type": "class" + }, + { + "id": "ember-5.3.0-ArrayProxy", + "type": "class" + }, + { + "id": "ember-5.3.0-Ember.Controller", + "type": "class" + }, + { + "id": "ember-5.3.0-ContainerDebugAdapter", + "type": "class" + }, + { + "id": "ember-5.3.0-DataAdapter", + "type": "class" + }, + { + "id": "ember-5.3.0-Engine", + "type": "class" + }, + { + "id": "ember-5.3.0-EngineInstance", + "type": "class" + }, + { + "id": "ember-5.3.0-CoreObject", + "type": "class" + }, + { + "id": "ember-5.3.0-Evented", + "type": "class" + }, + { + "id": "ember-5.3.0-EmberObject", + "type": "class" + }, + { + "id": "ember-5.3.0-Mixin", + "type": "class" + }, + { + "id": "ember-5.3.0-Observable", + "type": "class" + }, + { + "id": "ember-5.3.0-PromiseProxyMixin", + "type": "class" + }, + { + "id": "ember-5.3.0-ObjectProxy", + "type": "class" + }, + { + "id": "ember-5.3.0-Renderer", + "type": "class" + }, + { + "id": "ember-5.3.0-HashLocation", + "type": "class" + }, + { + "id": "ember-5.3.0-HistoryLocation", + "type": "class" + }, + { + "id": "ember-5.3.0-Location", + "type": "class" + }, + { + "id": "ember-5.3.0-NoneLocation", + "type": "class" + }, + { + "id": "ember-5.3.0-RouteInfo", + "type": "class" + }, + { + "id": "ember-5.3.0-RouteInfoWithAttributes", + "type": "class" + }, + { + "id": "ember-5.3.0-Route", + "type": "class" + }, + { + "id": "ember-5.3.0-RouterService", + "type": "class" + }, + { + "id": "ember-5.3.0-EmberRouter", + "type": "class" + }, + { + "id": "ember-5.3.0-Transition", + "type": "class" + }, + { + "id": "ember-5.3.0-Service", + "type": "class" + }, + { + "id": "ember-5.3.0-TestAdapter", + "type": "class" + }, + { + "id": "ember-5.3.0-Ember.Test.QUnitAdapter", + "type": "class" + }, + { + "id": "ember-5.3.0-Ember.Test", + "type": "class" + } + ] + }, + "private-namespaces": { + "data": [ + { + "id": "ember-5.3.0-Instrumentation", + "type": "namespace" + } + ] + }, + "public-namespaces": { + "data": [ + { + "id": "ember-5.3.0-FEATURES", + "type": "namespace" + } + ] + }, + "private-modules": { + "data": [ + { + "id": "ember-5.3.0-ember", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/enumerable", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/instrumentation", + "type": "module" + } + ] + }, + "public-modules": { + "data": [ + { + "id": "ember-5.3.0-rsvp", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/component", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/routing", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/template", + "type": "module" + }, + { + "id": "ember-5.3.0-@glimmer/component", + "type": "module" + }, + { + "id": "ember-5.3.0-@glimmer/tracking", + "type": "module" + }, + { + "id": "ember-5.3.0-@glimmer/tracking/primitives/cache", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/object", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/owner", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/utils", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/application", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/application/namespace", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/array", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/array/proxy", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/canary-features", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/component/template-only", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/controller", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/debug", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/debug/container-debug-adapter", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/debug/data-adapter", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/destroyable", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/engine", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/helper", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/object/core", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/object/evented", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/object/mixin", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/object/observable", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/object/promise-proxy-mixin", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/object/proxy", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/renderer", + "type": "module" + }, + { + "id": "ember-5.3.0-ember/routing", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/routing/hash-location", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/routing/history-location", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/routing/location", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/routing/none-location", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/routing/route-info", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/routing/route", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/routing/router-service", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/routing/router", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/routing/transition", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/runloop", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/service", + "type": "module" + }, + { + "id": "ember-5.3.0-@ember/test", + "type": "module" + } + ] + } + } + } +} \ No newline at end of file diff --git a/json-docs/ember/projects/ember.json b/json-docs/ember/projects/ember.json index 1191f81d1..8035d0eed 100644 --- a/json-docs/ember/projects/ember.json +++ b/json-docs/ember/projects/ember.json @@ -8,6 +8,10 @@ "relationships": { "project-versions": { "data": [ + { + "id": "ember-5.3.0", + "type": "project-version" + }, { "id": "ember-5.2.0", "type": "project-version" diff --git a/rev-index/ember-5.3.0.json b/rev-index/ember-5.3.0.json new file mode 100644 index 000000000..df53a06da --- /dev/null +++ b/rev-index/ember-5.3.0.json @@ -0,0 +1 @@ +{"data":{"id":"ember-5.3.0","type":"project-version","attributes":{"version":"5.3.0"},"relationships":{"classes":{"data":[{"id":"ember-5.3.0-Promise","type":"class"},{"id":"ember-5.3.0-EventTarget","type":"class"},{"id":"ember-5.3.0-Container","type":"class"},{"id":"ember-5.3.0-Registry","type":"class"},{"id":"ember-5.3.0-EmberENV","type":"class"},{"id":"ember-5.3.0-Ember.Templates.helpers","type":"class"},{"id":"ember-5.3.0-ComponentStateBucket","type":"class"},{"id":"ember-5.3.0-SafeString","type":"class"},{"id":"ember-5.3.0-Component","type":"class"},{"id":"ember-5.3.0-Helper","type":"class"},{"id":"ember-5.3.0-ComputedProperty","type":"class"},{"id":"ember-5.3.0-Descriptor","type":"class"},{"id":"ember-5.3.0-Ember.InjectedProperty","type":"class"},{"id":"ember-5.3.0-Libraries","type":"class"},{"id":"ember-5.3.0-FullName","type":"class"},{"id":"ember-5.3.0-BasicRegistry","type":"class"},{"id":"ember-5.3.0-BasicContainer","type":"class"},{"id":"ember-5.3.0-Owner","type":"class"},{"id":"ember-5.3.0-RegisterOptions","type":"class"},{"id":"ember-5.3.0-Factory","type":"class"},{"id":"ember-5.3.0-FactoryManager","type":"class"},{"id":"ember-5.3.0-Resolver","type":"class"},{"id":"ember-5.3.0-InternalFactory","type":"class"},{"id":"ember-5.3.0-ContainerProxy","type":"class"},{"id":"ember-5.3.0-RegistryProxy","type":"class"},{"id":"ember-5.3.0-Ember.ProxyMixin","type":"class"},{"id":"ember-5.3.0-Ember.ActionHandler","type":"class"},{"id":"ember-5.3.0-Ember.Comparable","type":"class"},{"id":"ember-5.3.0-ContainerProxyMixin","type":"class"},{"id":"ember-5.3.0-RegistryProxyMixin","type":"class"},{"id":"ember-5.3.0-Ember.TargetActionSupport","type":"class"},{"id":"ember-5.3.0-Ember.String","type":"class"},{"id":"ember-5.3.0-Ember.ActionSupport","type":"class"},{"id":"ember-5.3.0-Ember.ClassNamesSupport","type":"class"},{"id":"ember-5.3.0-Ember.ViewMixin","type":"class"},{"id":"ember-5.3.0-Ember.EventDispatcher","type":"class"},{"id":"ember-5.3.0-Ember.CoreView","type":"class"},{"id":"ember-5.3.0-Application","type":"class"},{"id":"ember-5.3.0-ApplicationInstance","type":"class"},{"id":"ember-5.3.0-ApplicationInstance.BootOptions","type":"class"},{"id":"ember-5.3.0-Namespace","type":"class"},{"id":"ember-5.3.0-EmberArray","type":"class"},{"id":"ember-5.3.0-MutableArray","type":"class"},{"id":"ember-5.3.0-Ember.NativeArray","type":"class"},{"id":"ember-5.3.0-ArrayProxy","type":"class"},{"id":"ember-5.3.0-Ember.ControllerMixin","type":"class"},{"id":"ember-5.3.0-Ember.Controller","type":"class"},{"id":"ember-5.3.0-ContainerDebugAdapter","type":"class"},{"id":"ember-5.3.0-DataAdapter","type":"class"},{"id":"ember-5.3.0-Engine","type":"class"},{"id":"ember-5.3.0-EngineInstance","type":"class"},{"id":"ember-5.3.0-Enumerable","type":"class"},{"id":"ember-5.3.0-Ember.MutableEnumerable","type":"class"},{"id":"ember-5.3.0-CoreObject","type":"class"},{"id":"ember-5.3.0-Evented","type":"class"},{"id":"ember-5.3.0-EmberObject","type":"class"},{"id":"ember-5.3.0-Mixin","type":"class"},{"id":"ember-5.3.0-Observable","type":"class"},{"id":"ember-5.3.0-PromiseProxyMixin","type":"class"},{"id":"ember-5.3.0-ObjectProxy","type":"class"},{"id":"ember-5.3.0-Renderer","type":"class"},{"id":"ember-5.3.0-BucketCache","type":"class"},{"id":"ember-5.3.0-RoutingService","type":"class"},{"id":"ember-5.3.0-HashLocation","type":"class"},{"id":"ember-5.3.0-HistoryLocation","type":"class"},{"id":"ember-5.3.0-Location","type":"class"},{"id":"ember-5.3.0-NoneLocation","type":"class"},{"id":"ember-5.3.0-RouteInfo","type":"class"},{"id":"ember-5.3.0-RouteInfoWithAttributes","type":"class"},{"id":"ember-5.3.0-Route","type":"class"},{"id":"ember-5.3.0-RouterService","type":"class"},{"id":"ember-5.3.0-EmberRouter","type":"class"},{"id":"ember-5.3.0-Transition","type":"class"},{"id":"ember-5.3.0-Service","type":"class"},{"id":"ember-5.3.0-TestAdapter","type":"class"},{"id":"ember-5.3.0-Ember.Test.QUnitAdapter","type":"class"},{"id":"ember-5.3.0-Ember.Test","type":"class"}]},"namespaces":{"data":[{"id":"ember-5.3.0-FEATURES","type":"namespace"},{"id":"ember-5.3.0-Instrumentation","type":"namespace"}]},"modules":{"data":[{"id":"ember-5.3.0-rsvp","type":"module"},{"id":"ember-5.3.0-@ember/component","type":"module"},{"id":"ember-5.3.0-@ember/routing","type":"module"},{"id":"ember-5.3.0-ember","type":"module"},{"id":"ember-5.3.0-@ember/template","type":"module"},{"id":"ember-5.3.0-@glimmer/component","type":"module"},{"id":"ember-5.3.0-@glimmer/tracking","type":"module"},{"id":"ember-5.3.0-@glimmer/tracking/primitives/cache","type":"module"},{"id":"ember-5.3.0-@ember/object","type":"module"},{"id":"ember-5.3.0-@ember/owner","type":"module"},{"id":"ember-5.3.0-@ember/utils","type":"module"},{"id":"ember-5.3.0-@ember/application","type":"module"},{"id":"ember-5.3.0-@ember/application/namespace","type":"module"},{"id":"ember-5.3.0-@ember/array","type":"module"},{"id":"ember-5.3.0-@ember/array/proxy","type":"module"},{"id":"ember-5.3.0-@ember/canary-features","type":"module"},{"id":"ember-5.3.0-@ember/component/template-only","type":"module"},{"id":"ember-5.3.0-@ember/controller","type":"module"},{"id":"ember-5.3.0-@ember/debug","type":"module"},{"id":"ember-5.3.0-@ember/debug/container-debug-adapter","type":"module"},{"id":"ember-5.3.0-@ember/debug/data-adapter","type":"module"},{"id":"ember-5.3.0-@ember/destroyable","type":"module"},{"id":"ember-5.3.0-@ember/engine","type":"module"},{"id":"ember-5.3.0-@ember/enumerable","type":"module"},{"id":"ember-5.3.0-@ember/helper","type":"module"},{"id":"ember-5.3.0-@ember/instrumentation","type":"module"},{"id":"ember-5.3.0-@ember/object/core","type":"module"},{"id":"ember-5.3.0-@ember/object/evented","type":"module"},{"id":"ember-5.3.0-@ember/object/mixin","type":"module"},{"id":"ember-5.3.0-@ember/object/observable","type":"module"},{"id":"ember-5.3.0-@ember/object/promise-proxy-mixin","type":"module"},{"id":"ember-5.3.0-@ember/object/proxy","type":"module"},{"id":"ember-5.3.0-@ember/renderer","type":"module"},{"id":"ember-5.3.0-ember/routing","type":"module"},{"id":"ember-5.3.0-@ember/routing/hash-location","type":"module"},{"id":"ember-5.3.0-@ember/routing/history-location","type":"module"},{"id":"ember-5.3.0-@ember/routing/location","type":"module"},{"id":"ember-5.3.0-@ember/routing/none-location","type":"module"},{"id":"ember-5.3.0-@ember/routing/route-info","type":"module"},{"id":"ember-5.3.0-@ember/routing/route","type":"module"},{"id":"ember-5.3.0-@ember/routing/router-service","type":"module"},{"id":"ember-5.3.0-@ember/routing/router","type":"module"},{"id":"ember-5.3.0-@ember/routing/transition","type":"module"},{"id":"ember-5.3.0-@ember/runloop","type":"module"},{"id":"ember-5.3.0-@ember/service","type":"module"},{"id":"ember-5.3.0-@ember/test","type":"module"}]},"project":{"data":{"id":"ember","type":"project"}},"private-classes":{"data":[{"id":"ember-5.3.0-Container","type":"class"},{"id":"ember-5.3.0-Registry","type":"class"},{"id":"ember-5.3.0-ComponentStateBucket","type":"class"},{"id":"ember-5.3.0-Descriptor","type":"class"},{"id":"ember-5.3.0-Ember.InjectedProperty","type":"class"},{"id":"ember-5.3.0-Libraries","type":"class"},{"id":"ember-5.3.0-BasicRegistry","type":"class"},{"id":"ember-5.3.0-BasicContainer","type":"class"},{"id":"ember-5.3.0-InternalFactory","type":"class"},{"id":"ember-5.3.0-ContainerProxy","type":"class"},{"id":"ember-5.3.0-RegistryProxy","type":"class"},{"id":"ember-5.3.0-Ember.ProxyMixin","type":"class"},{"id":"ember-5.3.0-Ember.ActionHandler","type":"class"},{"id":"ember-5.3.0-Ember.Comparable","type":"class"},{"id":"ember-5.3.0-ContainerProxyMixin","type":"class"},{"id":"ember-5.3.0-RegistryProxyMixin","type":"class"},{"id":"ember-5.3.0-Ember.TargetActionSupport","type":"class"},{"id":"ember-5.3.0-Ember.String","type":"class"},{"id":"ember-5.3.0-Ember.ActionSupport","type":"class"},{"id":"ember-5.3.0-Ember.ClassNamesSupport","type":"class"},{"id":"ember-5.3.0-Ember.ViewMixin","type":"class"},{"id":"ember-5.3.0-Ember.EventDispatcher","type":"class"},{"id":"ember-5.3.0-Ember.CoreView","type":"class"},{"id":"ember-5.3.0-Ember.ControllerMixin","type":"class"},{"id":"ember-5.3.0-Enumerable","type":"class"},{"id":"ember-5.3.0-Ember.MutableEnumerable","type":"class"},{"id":"ember-5.3.0-BucketCache","type":"class"},{"id":"ember-5.3.0-RoutingService","type":"class"}]},"public-classes":{"data":[{"id":"ember-5.3.0-Promise","type":"class"},{"id":"ember-5.3.0-EventTarget","type":"class"},{"id":"ember-5.3.0-EmberENV","type":"class"},{"id":"ember-5.3.0-Ember.Templates.helpers","type":"class"},{"id":"ember-5.3.0-SafeString","type":"class"},{"id":"ember-5.3.0-Component","type":"class"},{"id":"ember-5.3.0-Helper","type":"class"},{"id":"ember-5.3.0-ComputedProperty","type":"class"},{"id":"ember-5.3.0-FullName","type":"class"},{"id":"ember-5.3.0-Owner","type":"class"},{"id":"ember-5.3.0-RegisterOptions","type":"class"},{"id":"ember-5.3.0-Factory","type":"class"},{"id":"ember-5.3.0-FactoryManager","type":"class"},{"id":"ember-5.3.0-Resolver","type":"class"},{"id":"ember-5.3.0-Application","type":"class"},{"id":"ember-5.3.0-ApplicationInstance","type":"class"},{"id":"ember-5.3.0-ApplicationInstance.BootOptions","type":"class"},{"id":"ember-5.3.0-Namespace","type":"class"},{"id":"ember-5.3.0-EmberArray","type":"class"},{"id":"ember-5.3.0-MutableArray","type":"class"},{"id":"ember-5.3.0-Ember.NativeArray","type":"class"},{"id":"ember-5.3.0-ArrayProxy","type":"class"},{"id":"ember-5.3.0-Ember.Controller","type":"class"},{"id":"ember-5.3.0-ContainerDebugAdapter","type":"class"},{"id":"ember-5.3.0-DataAdapter","type":"class"},{"id":"ember-5.3.0-Engine","type":"class"},{"id":"ember-5.3.0-EngineInstance","type":"class"},{"id":"ember-5.3.0-CoreObject","type":"class"},{"id":"ember-5.3.0-Evented","type":"class"},{"id":"ember-5.3.0-EmberObject","type":"class"},{"id":"ember-5.3.0-Mixin","type":"class"},{"id":"ember-5.3.0-Observable","type":"class"},{"id":"ember-5.3.0-PromiseProxyMixin","type":"class"},{"id":"ember-5.3.0-ObjectProxy","type":"class"},{"id":"ember-5.3.0-Renderer","type":"class"},{"id":"ember-5.3.0-HashLocation","type":"class"},{"id":"ember-5.3.0-HistoryLocation","type":"class"},{"id":"ember-5.3.0-Location","type":"class"},{"id":"ember-5.3.0-NoneLocation","type":"class"},{"id":"ember-5.3.0-RouteInfo","type":"class"},{"id":"ember-5.3.0-RouteInfoWithAttributes","type":"class"},{"id":"ember-5.3.0-Route","type":"class"},{"id":"ember-5.3.0-RouterService","type":"class"},{"id":"ember-5.3.0-EmberRouter","type":"class"},{"id":"ember-5.3.0-Transition","type":"class"},{"id":"ember-5.3.0-Service","type":"class"},{"id":"ember-5.3.0-TestAdapter","type":"class"},{"id":"ember-5.3.0-Ember.Test.QUnitAdapter","type":"class"},{"id":"ember-5.3.0-Ember.Test","type":"class"}]},"private-namespaces":{"data":[{"id":"ember-5.3.0-Instrumentation","type":"namespace"}]},"public-namespaces":{"data":[{"id":"ember-5.3.0-FEATURES","type":"namespace"}]},"private-modules":{"data":[{"id":"ember-5.3.0-ember","type":"module"},{"id":"ember-5.3.0-@ember/enumerable","type":"module"},{"id":"ember-5.3.0-@ember/instrumentation","type":"module"}]},"public-modules":{"data":[{"id":"ember-5.3.0-rsvp","type":"module"},{"id":"ember-5.3.0-@ember/component","type":"module"},{"id":"ember-5.3.0-@ember/routing","type":"module"},{"id":"ember-5.3.0-@ember/template","type":"module"},{"id":"ember-5.3.0-@glimmer/component","type":"module"},{"id":"ember-5.3.0-@glimmer/tracking","type":"module"},{"id":"ember-5.3.0-@glimmer/tracking/primitives/cache","type":"module"},{"id":"ember-5.3.0-@ember/object","type":"module"},{"id":"ember-5.3.0-@ember/owner","type":"module"},{"id":"ember-5.3.0-@ember/utils","type":"module"},{"id":"ember-5.3.0-@ember/application","type":"module"},{"id":"ember-5.3.0-@ember/application/namespace","type":"module"},{"id":"ember-5.3.0-@ember/array","type":"module"},{"id":"ember-5.3.0-@ember/array/proxy","type":"module"},{"id":"ember-5.3.0-@ember/canary-features","type":"module"},{"id":"ember-5.3.0-@ember/component/template-only","type":"module"},{"id":"ember-5.3.0-@ember/controller","type":"module"},{"id":"ember-5.3.0-@ember/debug","type":"module"},{"id":"ember-5.3.0-@ember/debug/container-debug-adapter","type":"module"},{"id":"ember-5.3.0-@ember/debug/data-adapter","type":"module"},{"id":"ember-5.3.0-@ember/destroyable","type":"module"},{"id":"ember-5.3.0-@ember/engine","type":"module"},{"id":"ember-5.3.0-@ember/helper","type":"module"},{"id":"ember-5.3.0-@ember/object/core","type":"module"},{"id":"ember-5.3.0-@ember/object/evented","type":"module"},{"id":"ember-5.3.0-@ember/object/mixin","type":"module"},{"id":"ember-5.3.0-@ember/object/observable","type":"module"},{"id":"ember-5.3.0-@ember/object/promise-proxy-mixin","type":"module"},{"id":"ember-5.3.0-@ember/object/proxy","type":"module"},{"id":"ember-5.3.0-@ember/renderer","type":"module"},{"id":"ember-5.3.0-ember/routing","type":"module"},{"id":"ember-5.3.0-@ember/routing/hash-location","type":"module"},{"id":"ember-5.3.0-@ember/routing/history-location","type":"module"},{"id":"ember-5.3.0-@ember/routing/location","type":"module"},{"id":"ember-5.3.0-@ember/routing/none-location","type":"module"},{"id":"ember-5.3.0-@ember/routing/route-info","type":"module"},{"id":"ember-5.3.0-@ember/routing/route","type":"module"},{"id":"ember-5.3.0-@ember/routing/router-service","type":"module"},{"id":"ember-5.3.0-@ember/routing/router","type":"module"},{"id":"ember-5.3.0-@ember/routing/transition","type":"module"},{"id":"ember-5.3.0-@ember/runloop","type":"module"},{"id":"ember-5.3.0-@ember/service","type":"module"},{"id":"ember-5.3.0-@ember/test","type":"module"}]}}},"meta":{"class":{"ember-5.3.0-Promise":"ember-5.3.0-Promise","ember-5.3.0-EventTarget":"ember-5.3.0-EventTarget","ember-5.3.0-Container":"ember-5.3.0-Container","ember-5.3.0-Registry":"ember-5.3.0-Registry","ember-5.3.0-EmberENV":"ember-5.3.0-EmberENV","ember-5.3.0-Ember.Templates.helpers":"ember-5.3.0-Ember.Templates.helpers","ember-5.3.0-ComponentStateBucket":"ember-5.3.0-ComponentStateBucket","ember-5.3.0-SafeString":"ember-5.3.0-SafeString","ember-5.3.0-Component":"ember-5.3.0-Component","ember-5.3.0-Helper":"ember-5.3.0-Helper","ember-5.3.0-ComputedProperty":"ember-5.3.0-ComputedProperty","ember-5.3.0-Descriptor":"ember-5.3.0-Descriptor","ember-5.3.0-Ember.InjectedProperty":"ember-5.3.0-Ember.InjectedProperty","ember-5.3.0-Libraries":"ember-5.3.0-Libraries","ember-5.3.0-FullName":"ember-5.3.0-FullName","ember-5.3.0-BasicRegistry":"ember-5.3.0-BasicRegistry","ember-5.3.0-BasicContainer":"ember-5.3.0-BasicContainer","ember-5.3.0-Owner":"ember-5.3.0-Owner","ember-5.3.0-RegisterOptions":"ember-5.3.0-RegisterOptions","ember-5.3.0-Factory":"ember-5.3.0-Factory","ember-5.3.0-FactoryManager":"ember-5.3.0-FactoryManager","ember-5.3.0-Resolver":"ember-5.3.0-Resolver","ember-5.3.0-InternalFactory":"ember-5.3.0-InternalFactory","ember-5.3.0-ContainerProxy":"ember-5.3.0-ContainerProxy","ember-5.3.0-RegistryProxy":"ember-5.3.0-RegistryProxy","ember-5.3.0-Ember.ProxyMixin":"ember-5.3.0-Ember.ProxyMixin","ember-5.3.0-Ember.ActionHandler":"ember-5.3.0-Ember.ActionHandler","ember-5.3.0-Ember.Comparable":"ember-5.3.0-Ember.Comparable","ember-5.3.0-ContainerProxyMixin":"ember-5.3.0-ContainerProxyMixin","ember-5.3.0-RegistryProxyMixin":"ember-5.3.0-RegistryProxyMixin","ember-5.3.0-Ember.TargetActionSupport":"ember-5.3.0-Ember.TargetActionSupport","ember-5.3.0-Ember.String":"ember-5.3.0-Ember.String","ember-5.3.0-Ember.ActionSupport":"ember-5.3.0-Ember.ActionSupport","ember-5.3.0-Ember.ClassNamesSupport":"ember-5.3.0-Ember.ClassNamesSupport","ember-5.3.0-Ember.ViewMixin":"ember-5.3.0-Ember.ViewMixin","ember-5.3.0-Ember.EventDispatcher":"ember-5.3.0-Ember.EventDispatcher","ember-5.3.0-Ember.CoreView":"ember-5.3.0-Ember.CoreView","ember-5.3.0-Application":"ember-5.3.0-Application","ember-5.3.0-ApplicationInstance":"ember-5.3.0-ApplicationInstance","ember-5.3.0-ApplicationInstance.BootOptions":"ember-5.3.0-ApplicationInstance.BootOptions","ember-5.3.0-Namespace":"ember-5.3.0-Namespace","ember-5.3.0-EmberArray":"ember-5.3.0-EmberArray","ember-5.3.0-MutableArray":"ember-5.3.0-MutableArray","ember-5.3.0-Ember.NativeArray":"ember-5.3.0-Ember.NativeArray","ember-5.3.0-ArrayProxy":"ember-5.3.0-ArrayProxy","ember-5.3.0-Ember.ControllerMixin":"ember-5.3.0-Ember.ControllerMixin","ember-5.3.0-Ember.Controller":"ember-5.3.0-Ember.Controller","ember-5.3.0-ContainerDebugAdapter":"ember-5.3.0-ContainerDebugAdapter","ember-5.3.0-DataAdapter":"ember-5.3.0-DataAdapter","ember-5.3.0-Engine":"ember-5.3.0-Engine","ember-5.3.0-EngineInstance":"ember-5.3.0-EngineInstance","ember-5.3.0-Enumerable":"ember-5.3.0-Enumerable","ember-5.3.0-Ember.MutableEnumerable":"ember-5.3.0-Ember.MutableEnumerable","ember-5.3.0-CoreObject":"ember-5.3.0-CoreObject","ember-5.3.0-Evented":"ember-5.3.0-Evented","ember-5.3.0-EmberObject":"ember-5.3.0-EmberObject","ember-5.3.0-Mixin":"ember-5.3.0-Mixin","ember-5.3.0-Observable":"ember-5.3.0-Observable","ember-5.3.0-PromiseProxyMixin":"ember-5.3.0-PromiseProxyMixin","ember-5.3.0-ObjectProxy":"ember-5.3.0-ObjectProxy","ember-5.3.0-Renderer":"ember-5.3.0-Renderer","ember-5.3.0-BucketCache":"ember-5.3.0-BucketCache","ember-5.3.0-RoutingService":"ember-5.3.0-RoutingService","ember-5.3.0-HashLocation":"ember-5.3.0-HashLocation","ember-5.3.0-HistoryLocation":"ember-5.3.0-HistoryLocation","ember-5.3.0-Location":"ember-5.3.0-Location","ember-5.3.0-NoneLocation":"ember-5.3.0-NoneLocation","ember-5.3.0-RouteInfo":"ember-5.3.0-RouteInfo","ember-5.3.0-RouteInfoWithAttributes":"ember-5.3.0-RouteInfoWithAttributes","ember-5.3.0-Route":"ember-5.3.0-Route","ember-5.3.0-RouterService":"ember-5.3.0-RouterService","ember-5.3.0-EmberRouter":"ember-5.3.0-EmberRouter","ember-5.3.0-Transition":"ember-5.3.0-Transition","ember-5.3.0-Service":"ember-5.3.0-Service","ember-5.3.0-TestAdapter":"ember-5.3.0-TestAdapter","ember-5.3.0-Ember.Test.QUnitAdapter":"ember-5.3.0-Ember.Test.QUnitAdapter","ember-5.3.0-Ember.Test":"ember-5.3.0-Ember.Test","ember-5.3.0-Ember":"ember-5.3.0-Ember","ember-5.3.0-Ember.Templates.components":"ember-5.3.0-Ember.Templates.components","ember-5.3.0-rsvp":"ember-5.3.0-rsvp","ember-5.3.0-@ember/application":"ember-5.3.0-@ember/application","ember-5.3.0-@ember/array":"ember-5.3.0-@ember/array","ember-5.3.0-@ember/component":"ember-5.3.0-@ember/component","ember-5.3.0-@ember/component/helper":"ember-5.3.0-@ember/component/helper","ember-5.3.0-@ember/component/template-only":"ember-5.3.0-@ember/component/template-only","ember-5.3.0-@ember/debug":"ember-5.3.0-@ember/debug","ember-5.3.0-@ember/destroyable":"ember-5.3.0-@ember/destroyable","ember-5.3.0-@ember/engine":"ember-5.3.0-@ember/engine","ember-5.3.0-@ember/helper":"ember-5.3.0-@ember/helper","ember-5.3.0-@ember/instrumentation":"ember-5.3.0-@ember/instrumentation","ember-5.3.0-@ember/object":"ember-5.3.0-@ember/object","ember-5.3.0-@ember/object/compat":"ember-5.3.0-@ember/object/compat","ember-5.3.0-@ember/object/computed":"ember-5.3.0-@ember/object/computed","ember-5.3.0-@ember/object/evented":"ember-5.3.0-@ember/object/evented","ember-5.3.0-@ember/object/events":"ember-5.3.0-@ember/object/events","ember-5.3.0-@ember/object/internals":"ember-5.3.0-@ember/object/internals","ember-5.3.0-@ember/object/mixin":"ember-5.3.0-@ember/object/mixin","ember-5.3.0-@ember/object/observers":"ember-5.3.0-@ember/object/observers","ember-5.3.0-@ember/owner":"ember-5.3.0-@ember/owner","ember-5.3.0-@ember/routing":"ember-5.3.0-@ember/routing","ember-5.3.0-@ember/routing/location":"ember-5.3.0-@ember/routing/location","ember-5.3.0-@ember/runloop":"ember-5.3.0-@ember/runloop","ember-5.3.0-@ember/service":"ember-5.3.0-@ember/service","ember-5.3.0-@ember/template":"ember-5.3.0-@ember/template","ember-5.3.0-@ember/test":"ember-5.3.0-@ember/test","ember-5.3.0-@ember/utils":"ember-5.3.0-@ember/utils","ember-5.3.0-@glimmer/tracking":"ember-5.3.0-@glimmer/tracking","ember-5.3.0-@glimmer/tracking/primitives/cache":"ember-5.3.0-@glimmer/tracking/primitives/cache","ember-5.3.0-Ember.@ember/controller":"ember-5.3.0-Ember.@ember/controller"},"namespace":{"ember-5.3.0-FEATURES":"ember-5.3.0-FEATURES","ember-5.3.0-Instrumentation":"ember-5.3.0-Instrumentation"},"module":{"ember-5.3.0-rsvp":"ember-5.3.0-rsvp","ember-5.3.0-@ember/component":"ember-5.3.0-@ember/component","ember-5.3.0-@ember/routing":"ember-5.3.0-@ember/routing","ember-5.3.0-ember":"ember-5.3.0-ember","ember-5.3.0-@ember/template":"ember-5.3.0-@ember/template","ember-5.3.0-@glimmer/component":"ember-5.3.0-@glimmer/component","ember-5.3.0-@glimmer/tracking":"ember-5.3.0-@glimmer/tracking","ember-5.3.0-@glimmer/tracking/primitives/cache":"ember-5.3.0-@glimmer/tracking/primitives/cache","ember-5.3.0-@ember/object":"ember-5.3.0-@ember/object","ember-5.3.0-@ember/owner":"ember-5.3.0-@ember/owner","ember-5.3.0-@ember/utils":"ember-5.3.0-@ember/utils","ember-5.3.0-@ember/application":"ember-5.3.0-@ember/application","ember-5.3.0-@ember/application/namespace":"ember-5.3.0-@ember/application/namespace","ember-5.3.0-@ember/array":"ember-5.3.0-@ember/array","ember-5.3.0-@ember/array/proxy":"ember-5.3.0-@ember/array/proxy","ember-5.3.0-@ember/canary-features":"ember-5.3.0-@ember/canary-features","ember-5.3.0-@ember/component/template-only":"ember-5.3.0-@ember/component/template-only","ember-5.3.0-@ember/controller":"ember-5.3.0-@ember/controller","ember-5.3.0-@ember/debug":"ember-5.3.0-@ember/debug","ember-5.3.0-@ember/debug/container-debug-adapter":"ember-5.3.0-@ember/debug/container-debug-adapter","ember-5.3.0-@ember/debug/data-adapter":"ember-5.3.0-@ember/debug/data-adapter","ember-5.3.0-@ember/destroyable":"ember-5.3.0-@ember/destroyable","ember-5.3.0-@ember/engine":"ember-5.3.0-@ember/engine","ember-5.3.0-@ember/enumerable":"ember-5.3.0-@ember/enumerable","ember-5.3.0-@ember/helper":"ember-5.3.0-@ember/helper","ember-5.3.0-@ember/instrumentation":"ember-5.3.0-@ember/instrumentation","ember-5.3.0-@ember/object/core":"ember-5.3.0-@ember/object/core","ember-5.3.0-@ember/object/evented":"ember-5.3.0-@ember/object/evented","ember-5.3.0-@ember/object/mixin":"ember-5.3.0-@ember/object/mixin","ember-5.3.0-@ember/object/observable":"ember-5.3.0-@ember/object/observable","ember-5.3.0-@ember/object/promise-proxy-mixin":"ember-5.3.0-@ember/object/promise-proxy-mixin","ember-5.3.0-@ember/object/proxy":"ember-5.3.0-@ember/object/proxy","ember-5.3.0-@ember/renderer":"ember-5.3.0-@ember/renderer","ember-5.3.0-ember/routing":"ember-5.3.0-ember/routing","ember-5.3.0-@ember/routing/hash-location":"ember-5.3.0-@ember/routing/hash-location","ember-5.3.0-@ember/routing/history-location":"ember-5.3.0-@ember/routing/history-location","ember-5.3.0-@ember/routing/location":"ember-5.3.0-@ember/routing/location","ember-5.3.0-@ember/routing/none-location":"ember-5.3.0-@ember/routing/none-location","ember-5.3.0-@ember/routing/route-info":"ember-5.3.0-@ember/routing/route-info","ember-5.3.0-@ember/routing/route":"ember-5.3.0-@ember/routing/route","ember-5.3.0-@ember/routing/router-service":"ember-5.3.0-@ember/routing/router-service","ember-5.3.0-@ember/routing/router":"ember-5.3.0-@ember/routing/router","ember-5.3.0-@ember/routing/transition":"ember-5.3.0-@ember/routing/transition","ember-5.3.0-@ember/runloop":"ember-5.3.0-@ember/runloop","ember-5.3.0-@ember/service":"ember-5.3.0-@ember/service","ember-5.3.0-@ember/test":"ember-5.3.0-@ember/test"},"missing":{"Ember.Namespace":"Ember.Namespace"}}} \ No newline at end of file diff --git a/rev-index/ember-data-5.3.0.json b/rev-index/ember-data-5.3.0.json new file mode 100644 index 000000000..46c934b6c --- /dev/null +++ b/rev-index/ember-data-5.3.0.json @@ -0,0 +1 @@ +{"data":{"id":"ember-data-5.3.0","type":"project-version","attributes":{"version":"5.3.0"},"relationships":{"classes":{"data":[{"id":"ember-data-5.3.0- Cache","type":"class"},{"id":"ember-data-5.3.0-CacheCapabilitiesManager","type":"class"},{"id":"ember-data-5.3.0-StableRecordIdentifier","type":"class"},{"id":"ember-data-5.3.0- Adapter","type":"class"},{"id":"ember-data-5.3.0- Serializer","type":"class"},{"id":"ember-data-5.3.0-SchemaService","type":"class"},{"id":"ember-data-5.3.0-BuildURLMixin","type":"class"},{"id":"ember-data-5.3.0-AdapterError","type":"class"},{"id":"ember-data-5.3.0-InvalidError","type":"class"},{"id":"ember-data-5.3.0-TimeoutError","type":"class"},{"id":"ember-data-5.3.0-AbortError","type":"class"},{"id":"ember-data-5.3.0-UnauthorizedError","type":"class"},{"id":"ember-data-5.3.0-ForbiddenError","type":"class"},{"id":"ember-data-5.3.0-NotFoundError","type":"class"},{"id":"ember-data-5.3.0-ConflictError","type":"class"},{"id":"ember-data-5.3.0-ServerError","type":"class"},{"id":"ember-data-5.3.0-Adapter","type":"class"},{"id":"ember-data-5.3.0-JSONAPIAdapter","type":"class"},{"id":"ember-data-5.3.0-RESTAdapter","type":"class"},{"id":"ember-data-5.3.0-InspectorDataAdapter","type":"class"},{"id":"ember-data-5.3.0-Cache","type":"class"},{"id":"ember-data-5.3.0-SnapshotRecordArray","type":"class"},{"id":"ember-data-5.3.0-Snapshot","type":"class"},{"id":"ember-data-5.3.0-BelongsToReference","type":"class"},{"id":"ember-data-5.3.0-HasManyReference","type":"class"},{"id":"ember-data-5.3.0-Errors","type":"class"},{"id":"ember-data-5.3.0-ManyArray","type":"class"},{"id":"ember-data-5.3.0-Model","type":"class"},{"id":"ember-data-5.3.0-PromiseBelongsTo","type":"class"},{"id":"ember-data-5.3.0-PromiseManyArray","type":"class"},{"id":"ember-data-5.3.0-CanaryFeatureFlags","type":"class"},{"id":"ember-data-5.3.0-DebugLogging","type":"class"},{"id":"ember-data-5.3.0-CurrentDeprecations","type":"class"},{"id":"ember-data-5.3.0-LifetimesService","type":"class"},{"id":"ember-data-5.3.0-RequestManager","type":"class"},{"id":"ember-data-5.3.0-Future","type":"class"},{"id":"ember-data-5.3.0- Handler","type":"class"},{"id":"ember-data-5.3.0-Fetch","type":"class"},{"id":"ember-data-5.3.0-BooleanTransform","type":"class"},{"id":"ember-data-5.3.0-DateTransform","type":"class"},{"id":"ember-data-5.3.0-NumberTransform","type":"class"},{"id":"ember-data-5.3.0-StringTransform","type":"class"},{"id":"ember-data-5.3.0-Transform","type":"class"},{"id":"ember-data-5.3.0-EmbeddedRecordsMixin","type":"class"},{"id":"ember-data-5.3.0-Serializer","type":"class"},{"id":"ember-data-5.3.0-JSONAPISerializer","type":"class"},{"id":"ember-data-5.3.0-JSONSerializer","type":"class"},{"id":"ember-data-5.3.0-RESTSerializer","type":"class"},{"id":"ember-data-5.3.0-IdentifierCache","type":"class"},{"id":"ember-data-5.3.0-RecordReference","type":"class"},{"id":"ember-data-5.3.0-CacheManager","type":"class"},{"id":"ember-data-5.3.0-NotificationManager","type":"class"},{"id":"ember-data-5.3.0-RequestStateService","type":"class"},{"id":"ember-data-5.3.0-RecordArray","type":"class"},{"id":"ember-data-5.3.0-Store","type":"class"}]},"namespaces":{"data":[]},"modules":{"data":[{"id":"ember-data-5.3.0-@ember-data/experimental-preview-types","type":"module"},{"id":"ember-data-5.3.0-@ember-data/store","type":"module"},{"id":"ember-data-5.3.0-ember-data-overview","type":"module"},{"id":"ember-data-5.3.0-@ember-data/active-record/request","type":"module"},{"id":"ember-data-5.3.0-@ember-data/adapter","type":"module"},{"id":"ember-data-5.3.0-@ember-data/adapter/error","type":"module"},{"id":"ember-data-5.3.0-@ember-data/adapter/json-api","type":"module"},{"id":"ember-data-5.3.0-@ember-data/adapter/rest","type":"module"},{"id":"ember-data-5.3.0-@ember-data/debug","type":"module"},{"id":"ember-data-5.3.0-@ember-data/graph","type":"module"},{"id":"ember-data-5.3.0-@ember-data/json-api/request","type":"module"},{"id":"ember-data-5.3.0-@ember-data/json-api","type":"module"},{"id":"ember-data-5.3.0-@ember-data/legacy-compat","type":"module"},{"id":"ember-data-5.3.0-@ember-data/model","type":"module"},{"id":"ember-data-5.3.0-@ember-data/canary-features","type":"module"},{"id":"ember-data-5.3.0-@ember-data/deprecations","type":"module"},{"id":"ember-data-5.3.0-@ember-data/request-utils","type":"module"},{"id":"ember-data-5.3.0-@ember-data/request","type":"module"},{"id":"ember-data-5.3.0-@ember-data/request/fetch","type":"module"},{"id":"ember-data-5.3.0-@ember-data/rest/request","type":"module"},{"id":"ember-data-5.3.0-@ember-data/serializer","type":"module"},{"id":"ember-data-5.3.0-@ember-data/serializer/rest","type":"module"},{"id":"ember-data-5.3.0-@ember-data/serializer/json-api","type":"module"},{"id":"ember-data-5.3.0-@ember-data/serializer/json","type":"module"},{"id":"ember-data-5.3.0-@ember-data/tracking","type":"module"}]},"project":{"data":{"id":"ember-data","type":"project"}},"private-classes":{"data":[{"id":"ember-data-5.3.0-InspectorDataAdapter","type":"class"},{"id":"ember-data-5.3.0-PromiseBelongsTo","type":"class"}]},"public-classes":{"data":[{"id":"ember-data-5.3.0- Cache","type":"class"},{"id":"ember-data-5.3.0-CacheCapabilitiesManager","type":"class"},{"id":"ember-data-5.3.0-StableRecordIdentifier","type":"class"},{"id":"ember-data-5.3.0- Adapter","type":"class"},{"id":"ember-data-5.3.0- Serializer","type":"class"},{"id":"ember-data-5.3.0-SchemaService","type":"class"},{"id":"ember-data-5.3.0-BuildURLMixin","type":"class"},{"id":"ember-data-5.3.0-AdapterError","type":"class"},{"id":"ember-data-5.3.0-InvalidError","type":"class"},{"id":"ember-data-5.3.0-TimeoutError","type":"class"},{"id":"ember-data-5.3.0-AbortError","type":"class"},{"id":"ember-data-5.3.0-UnauthorizedError","type":"class"},{"id":"ember-data-5.3.0-ForbiddenError","type":"class"},{"id":"ember-data-5.3.0-NotFoundError","type":"class"},{"id":"ember-data-5.3.0-ConflictError","type":"class"},{"id":"ember-data-5.3.0-ServerError","type":"class"},{"id":"ember-data-5.3.0-Adapter","type":"class"},{"id":"ember-data-5.3.0-JSONAPIAdapter","type":"class"},{"id":"ember-data-5.3.0-RESTAdapter","type":"class"},{"id":"ember-data-5.3.0-Cache","type":"class"},{"id":"ember-data-5.3.0-SnapshotRecordArray","type":"class"},{"id":"ember-data-5.3.0-Snapshot","type":"class"},{"id":"ember-data-5.3.0-BelongsToReference","type":"class"},{"id":"ember-data-5.3.0-HasManyReference","type":"class"},{"id":"ember-data-5.3.0-Errors","type":"class"},{"id":"ember-data-5.3.0-ManyArray","type":"class"},{"id":"ember-data-5.3.0-Model","type":"class"},{"id":"ember-data-5.3.0-PromiseManyArray","type":"class"},{"id":"ember-data-5.3.0-CanaryFeatureFlags","type":"class"},{"id":"ember-data-5.3.0-DebugLogging","type":"class"},{"id":"ember-data-5.3.0-CurrentDeprecations","type":"class"},{"id":"ember-data-5.3.0-LifetimesService","type":"class"},{"id":"ember-data-5.3.0-RequestManager","type":"class"},{"id":"ember-data-5.3.0-Future","type":"class"},{"id":"ember-data-5.3.0- Handler","type":"class"},{"id":"ember-data-5.3.0-Fetch","type":"class"},{"id":"ember-data-5.3.0-BooleanTransform","type":"class"},{"id":"ember-data-5.3.0-DateTransform","type":"class"},{"id":"ember-data-5.3.0-NumberTransform","type":"class"},{"id":"ember-data-5.3.0-StringTransform","type":"class"},{"id":"ember-data-5.3.0-Transform","type":"class"},{"id":"ember-data-5.3.0-EmbeddedRecordsMixin","type":"class"},{"id":"ember-data-5.3.0-Serializer","type":"class"},{"id":"ember-data-5.3.0-JSONAPISerializer","type":"class"},{"id":"ember-data-5.3.0-JSONSerializer","type":"class"},{"id":"ember-data-5.3.0-RESTSerializer","type":"class"},{"id":"ember-data-5.3.0-IdentifierCache","type":"class"},{"id":"ember-data-5.3.0-RecordReference","type":"class"},{"id":"ember-data-5.3.0-CacheManager","type":"class"},{"id":"ember-data-5.3.0-NotificationManager","type":"class"},{"id":"ember-data-5.3.0-RequestStateService","type":"class"},{"id":"ember-data-5.3.0-RecordArray","type":"class"},{"id":"ember-data-5.3.0-Store","type":"class"}]},"private-namespaces":{"data":[]},"public-namespaces":{"data":[]},"private-modules":{"data":[]},"public-modules":{"data":[{"id":"ember-data-5.3.0-@ember-data/experimental-preview-types","type":"module"},{"id":"ember-data-5.3.0-@ember-data/store","type":"module"},{"id":"ember-data-5.3.0-ember-data-overview","type":"module"},{"id":"ember-data-5.3.0-@ember-data/active-record/request","type":"module"},{"id":"ember-data-5.3.0-@ember-data/adapter","type":"module"},{"id":"ember-data-5.3.0-@ember-data/adapter/error","type":"module"},{"id":"ember-data-5.3.0-@ember-data/adapter/json-api","type":"module"},{"id":"ember-data-5.3.0-@ember-data/adapter/rest","type":"module"},{"id":"ember-data-5.3.0-@ember-data/debug","type":"module"},{"id":"ember-data-5.3.0-@ember-data/graph","type":"module"},{"id":"ember-data-5.3.0-@ember-data/json-api/request","type":"module"},{"id":"ember-data-5.3.0-@ember-data/json-api","type":"module"},{"id":"ember-data-5.3.0-@ember-data/legacy-compat","type":"module"},{"id":"ember-data-5.3.0-@ember-data/model","type":"module"},{"id":"ember-data-5.3.0-@ember-data/canary-features","type":"module"},{"id":"ember-data-5.3.0-@ember-data/deprecations","type":"module"},{"id":"ember-data-5.3.0-@ember-data/request-utils","type":"module"},{"id":"ember-data-5.3.0-@ember-data/request","type":"module"},{"id":"ember-data-5.3.0-@ember-data/request/fetch","type":"module"},{"id":"ember-data-5.3.0-@ember-data/rest/request","type":"module"},{"id":"ember-data-5.3.0-@ember-data/serializer","type":"module"},{"id":"ember-data-5.3.0-@ember-data/serializer/rest","type":"module"},{"id":"ember-data-5.3.0-@ember-data/serializer/json-api","type":"module"},{"id":"ember-data-5.3.0-@ember-data/serializer/json","type":"module"},{"id":"ember-data-5.3.0-@ember-data/tracking","type":"module"}]}}},"meta":{"class":{"ember-data-5.3.0- Cache":"ember-data-5.3.0- Cache","ember-data-5.3.0-CacheCapabilitiesManager":"ember-data-5.3.0-CacheCapabilitiesManager","ember-data-5.3.0-StableRecordIdentifier":"ember-data-5.3.0-StableRecordIdentifier","ember-data-5.3.0- Adapter":"ember-data-5.3.0- Adapter","ember-data-5.3.0- Serializer":"ember-data-5.3.0- Serializer","ember-data-5.3.0-SchemaService":"ember-data-5.3.0-SchemaService","ember-data-5.3.0-BuildURLMixin":"ember-data-5.3.0-BuildURLMixin","ember-data-5.3.0-AdapterError":"ember-data-5.3.0-AdapterError","ember-data-5.3.0-InvalidError":"ember-data-5.3.0-InvalidError","ember-data-5.3.0-TimeoutError":"ember-data-5.3.0-TimeoutError","ember-data-5.3.0-AbortError":"ember-data-5.3.0-AbortError","ember-data-5.3.0-UnauthorizedError":"ember-data-5.3.0-UnauthorizedError","ember-data-5.3.0-ForbiddenError":"ember-data-5.3.0-ForbiddenError","ember-data-5.3.0-NotFoundError":"ember-data-5.3.0-NotFoundError","ember-data-5.3.0-ConflictError":"ember-data-5.3.0-ConflictError","ember-data-5.3.0-ServerError":"ember-data-5.3.0-ServerError","ember-data-5.3.0-Adapter":"ember-data-5.3.0-Adapter","ember-data-5.3.0-JSONAPIAdapter":"ember-data-5.3.0-JSONAPIAdapter","ember-data-5.3.0-RESTAdapter":"ember-data-5.3.0-RESTAdapter","ember-data-5.3.0-InspectorDataAdapter":"ember-data-5.3.0-InspectorDataAdapter","ember-data-5.3.0-Cache":"ember-data-5.3.0-Cache","ember-data-5.3.0-SnapshotRecordArray":"ember-data-5.3.0-SnapshotRecordArray","ember-data-5.3.0-Snapshot":"ember-data-5.3.0-Snapshot","ember-data-5.3.0-BelongsToReference":"ember-data-5.3.0-BelongsToReference","ember-data-5.3.0-HasManyReference":"ember-data-5.3.0-HasManyReference","ember-data-5.3.0-Errors":"ember-data-5.3.0-Errors","ember-data-5.3.0-ManyArray":"ember-data-5.3.0-ManyArray","ember-data-5.3.0-Model":"ember-data-5.3.0-Model","ember-data-5.3.0-PromiseBelongsTo":"ember-data-5.3.0-PromiseBelongsTo","ember-data-5.3.0-PromiseManyArray":"ember-data-5.3.0-PromiseManyArray","ember-data-5.3.0-CanaryFeatureFlags":"ember-data-5.3.0-CanaryFeatureFlags","ember-data-5.3.0-DebugLogging":"ember-data-5.3.0-DebugLogging","ember-data-5.3.0-CurrentDeprecations":"ember-data-5.3.0-CurrentDeprecations","ember-data-5.3.0-LifetimesService":"ember-data-5.3.0-LifetimesService","ember-data-5.3.0-RequestManager":"ember-data-5.3.0-RequestManager","ember-data-5.3.0-Future":"ember-data-5.3.0-Future","ember-data-5.3.0- Handler":"ember-data-5.3.0- Handler","ember-data-5.3.0-Fetch":"ember-data-5.3.0-Fetch","ember-data-5.3.0-BooleanTransform":"ember-data-5.3.0-BooleanTransform","ember-data-5.3.0-DateTransform":"ember-data-5.3.0-DateTransform","ember-data-5.3.0-NumberTransform":"ember-data-5.3.0-NumberTransform","ember-data-5.3.0-StringTransform":"ember-data-5.3.0-StringTransform","ember-data-5.3.0-Transform":"ember-data-5.3.0-Transform","ember-data-5.3.0-EmbeddedRecordsMixin":"ember-data-5.3.0-EmbeddedRecordsMixin","ember-data-5.3.0-Serializer":"ember-data-5.3.0-Serializer","ember-data-5.3.0-JSONAPISerializer":"ember-data-5.3.0-JSONAPISerializer","ember-data-5.3.0-JSONSerializer":"ember-data-5.3.0-JSONSerializer","ember-data-5.3.0-RESTSerializer":"ember-data-5.3.0-RESTSerializer","ember-data-5.3.0-IdentifierCache":"ember-data-5.3.0-IdentifierCache","ember-data-5.3.0-RecordReference":"ember-data-5.3.0-RecordReference","ember-data-5.3.0-CacheManager":"ember-data-5.3.0-CacheManager","ember-data-5.3.0-NotificationManager":"ember-data-5.3.0-NotificationManager","ember-data-5.3.0-RequestStateService":"ember-data-5.3.0-RequestStateService","ember-data-5.3.0-RecordArray":"ember-data-5.3.0-RecordArray","ember-data-5.3.0-Store":"ember-data-5.3.0-Store","ember-data-5.3.0-@ember-data/active-record/request":"ember-data-5.3.0-@ember-data/active-record/request","ember-data-5.3.0-@ember-data/adapter/rest":"ember-data-5.3.0-@ember-data/adapter/rest","ember-data-5.3.0-@ember-data/json-api/request":"ember-data-5.3.0-@ember-data/json-api/request","ember-data-5.3.0-@ember-data/model":"ember-data-5.3.0-@ember-data/model","ember-data-5.3.0-@ember-data/request-utils":"ember-data-5.3.0-@ember-data/request-utils","ember-data-5.3.0-@ember-data/rest/request":"ember-data-5.3.0-@ember-data/rest/request","ember-data-5.3.0-@ember-data/store":"ember-data-5.3.0-@ember-data/store","ember-data-5.3.0-@ember-data/tracking":"ember-data-5.3.0-@ember-data/tracking"},"module":{"ember-data-5.3.0-@ember-data/experimental-preview-types":"","ember-data-5.3.0-@ember-data/store":"ember-data-5.3.0-@ember-data/store","ember-data-5.3.0-ember-data-overview":"ember-data-5.3.0-ember-data-overview","ember-data-5.3.0-@ember-data/active-record/request":"ember-data-5.3.0-@ember-data/active-record/request","ember-data-5.3.0-@ember-data/adapter":"ember-data-5.3.0-@ember-data/adapter","ember-data-5.3.0-@ember-data/adapter/error":"ember-data-5.3.0-@ember-data/adapter/error","ember-data-5.3.0-@ember-data/adapter/json-api":"ember-data-5.3.0-@ember-data/adapter/json-api","ember-data-5.3.0-@ember-data/adapter/rest":"ember-data-5.3.0-@ember-data/adapter/rest","ember-data-5.3.0-@ember-data/debug":"ember-data-5.3.0-@ember-data/debug","ember-data-5.3.0-@ember-data/graph":"ember-data-5.3.0-@ember-data/graph","ember-data-5.3.0-@ember-data/json-api/request":"ember-data-5.3.0-@ember-data/json-api/request","ember-data-5.3.0-@ember-data/json-api":"ember-data-5.3.0-@ember-data/json-api","ember-data-5.3.0-@ember-data/legacy-compat":"ember-data-5.3.0-@ember-data/legacy-compat","ember-data-5.3.0-@ember-data/model":"ember-data-5.3.0-@ember-data/model","ember-data-5.3.0-@ember-data/canary-features":"ember-data-5.3.0-@ember-data/canary-features","ember-data-5.3.0-@ember-data/deprecations":"ember-data-5.3.0-@ember-data/deprecations","ember-data-5.3.0-@ember-data/request-utils":"ember-data-5.3.0-@ember-data/request-utils","ember-data-5.3.0-@ember-data/request":"ember-data-5.3.0-@ember-data/request","ember-data-5.3.0-@ember-data/request/fetch":"ember-data-5.3.0-@ember-data/request/fetch","ember-data-5.3.0-@ember-data/rest/request":"ember-data-5.3.0-@ember-data/rest/request","ember-data-5.3.0-@ember-data/serializer":"ember-data-5.3.0-@ember-data/serializer","ember-data-5.3.0-@ember-data/serializer/rest":"ember-data-5.3.0-@ember-data/serializer/rest","ember-data-5.3.0-@ember-data/serializer/json-api":"ember-data-5.3.0-@ember-data/serializer/json-api","ember-data-5.3.0-@ember-data/serializer/json":"ember-data-5.3.0-@ember-data/serializer/json","ember-data-5.3.0-@ember-data/tracking":"ember-data-5.3.0-@ember-data/tracking"},"missing":{"DataAdapter":"DataAdapter","Ember.ArrayProxy":"Ember.ArrayProxy","Ember.EmberObject":"Ember.EmberObject","Promise":"Promise","PromiseObject":"PromiseObject","Reference":"Reference"}}} \ No newline at end of file diff --git a/rev-index/ember-data.json b/rev-index/ember-data.json index 2e9e5b789..b63623d84 100644 --- a/rev-index/ember-data.json +++ b/rev-index/ember-data.json @@ -1 +1 @@ -{"data":{"id":"ember-data","type":"project","attributes":{"github-url":"https://github.com/emberjs/ember.js"},"relationships":{"project-versions":{"data":[{"id":"ember-data-5.2.0","type":"project-version"},{"id":"ember-data-5.1.2","type":"project-version"},{"id":"ember-data-1.13.13","type":"project-version"},{"id":"ember-data-1.13.14","type":"project-version"},{"id":"ember-data-1.13.15","type":"project-version"},{"id":"ember-data-1.13.16","type":"project-version"},{"id":"ember-data-2.0.1","type":"project-version"},{"id":"ember-data-2.1.0","type":"project-version"},{"id":"ember-data-2.2.1","type":"project-version"},{"id":"ember-data-2.3.3","type":"project-version"},{"id":"ember-data-2.4.3","type":"project-version"},{"id":"ember-data-2.5.5","type":"project-version"},{"id":"ember-data-2.6.2","type":"project-version"},{"id":"ember-data-2.7.0","type":"project-version"},{"id":"ember-data-2.8.1","type":"project-version"},{"id":"ember-data-2.9.0","type":"project-version"},{"id":"ember-data-2.10.0","type":"project-version"},{"id":"ember-data-2.11.3","type":"project-version"},{"id":"ember-data-2.12.2","type":"project-version"},{"id":"ember-data-2.13.2","type":"project-version"},{"id":"ember-data-2.14.10","type":"project-version"},{"id":"ember-data-2.15.4","type":"project-version"},{"id":"ember-data-2.16.0","type":"project-version"},{"id":"ember-data-2.17.0","type":"project-version"},{"id":"ember-data-2.18.0","type":"project-version"},{"id":"ember-data-3.0.3","type":"project-version"},{"id":"ember-data-3.1.1","type":"project-version"},{"id":"ember-data-3.2.2","type":"project-version"},{"id":"ember-data-3.3.2","type":"project-version"},{"id":"ember-data-3.4.4","type":"project-version"},{"id":"ember-data-3.5.2","type":"project-version"},{"id":"ember-data-3.6.0","type":"project-version"},{"id":"ember-data-3.7.0","type":"project-version"},{"id":"ember-data-3.8.1","type":"project-version"},{"id":"ember-data-3.9.3","type":"project-version"},{"id":"ember-data-3.10.0","type":"project-version"},{"id":"ember-data-3.11.5","type":"project-version"},{"id":"ember-data-3.12.6","type":"project-version"},{"id":"ember-data-3.13.3","type":"project-version"},{"id":"ember-data-3.14.1","type":"project-version"},{"id":"ember-data-3.15.1","type":"project-version"},{"id":"ember-data-3.16.9","type":"project-version"},{"id":"ember-data-3.17.1","type":"project-version"},{"id":"ember-data-3.18.0","type":"project-version"},{"id":"ember-data-3.19.0","type":"project-version"},{"id":"ember-data-3.20.5","type":"project-version"},{"id":"ember-data-3.21.2","type":"project-version"},{"id":"ember-data-3.22.1","type":"project-version"},{"id":"ember-data-3.23.0","type":"project-version"},{"id":"ember-data-3.24.2","type":"project-version"},{"id":"ember-data-3.25.0","type":"project-version"},{"id":"ember-data-3.26.0","type":"project-version"},{"id":"ember-data-3.27.1","type":"project-version"},{"id":"ember-data-3.28.13","type":"project-version"},{"id":"ember-data-4.0.2","type":"project-version"},{"id":"ember-data-4.1.0","type":"project-version"},{"id":"ember-data-4.2.0","type":"project-version"},{"id":"ember-data-4.3.0","type":"project-version"},{"id":"ember-data-4.4.1","type":"project-version"},{"id":"ember-data-4.5.0","type":"project-version"},{"id":"ember-data-4.6.4","type":"project-version"},{"id":"ember-data-4.7.3","type":"project-version"},{"id":"ember-data-4.8.8","type":"project-version"},{"id":"ember-data-4.9.1","type":"project-version"},{"id":"ember-data-4.10.0","type":"project-version"},{"id":"ember-data-4.11.3","type":"project-version"},{"id":"ember-data-4.12.0","type":"project-version"},{"id":"ember-data-5.0.0","type":"project-version"},{"id":"ember-data-2.0.0","type":"project-version"},{"id":"ember-data-2.3.2","type":"project-version"},{"id":"ember-data-2.4.1","type":"project-version"},{"id":"ember-data-2.5.4","type":"project-version"},{"id":"ember-data-2.6.1","type":"project-version"},{"id":"ember-data-2.8.0","type":"project-version"},{"id":"ember-data-2.11.2","type":"project-version"},{"id":"ember-data-2.12.1","type":"project-version"},{"id":"ember-data-2.13.1","type":"project-version"},{"id":"ember-data-2.14.9","type":"project-version"},{"id":"ember-data-2.15.3","type":"project-version"},{"id":"ember-data-3.0.0","type":"project-version"},{"id":"ember-data-3.1.0","type":"project-version"},{"id":"ember-data-3.2.0","type":"project-version"},{"id":"ember-data-3.3.1","type":"project-version"},{"id":"ember-data-3.4.3","type":"project-version"},{"id":"ember-data-3.5.1","type":"project-version"},{"id":"ember-data-3.8.0","type":"project-version"},{"id":"ember-data-3.9.2","type":"project-version"},{"id":"ember-data-3.11.4","type":"project-version"},{"id":"ember-data-3.12.5","type":"project-version"},{"id":"ember-data-3.13.2","type":"project-version"},{"id":"ember-data-3.14.0","type":"project-version"},{"id":"ember-data-3.15.0","type":"project-version"},{"id":"ember-data-3.16.8","type":"project-version"},{"id":"ember-data-3.17.0","type":"project-version"},{"id":"ember-data-3.20.4","type":"project-version"},{"id":"ember-data-3.21.1","type":"project-version"},{"id":"ember-data-3.22.0","type":"project-version"},{"id":"ember-data-3.24.1","type":"project-version"},{"id":"ember-data-3.27.0","type":"project-version"},{"id":"ember-data-3.28.12","type":"project-version"},{"id":"ember-data-4.0.1","type":"project-version"},{"id":"ember-data-4.4.0","type":"project-version"},{"id":"ember-data-4.6.3","type":"project-version"},{"id":"ember-data-4.7.2","type":"project-version"},{"id":"ember-data-4.8.7","type":"project-version"},{"id":"ember-data-4.9.0","type":"project-version"},{"id":"ember-data-4.11.2","type":"project-version"},{"id":"ember-data-2.3.0","type":"project-version"},{"id":"ember-data-2.4.0","type":"project-version"},{"id":"ember-data-2.5.3","type":"project-version"},{"id":"ember-data-2.6.0","type":"project-version"},{"id":"ember-data-2.11.1","type":"project-version"},{"id":"ember-data-2.13.0","type":"project-version"},{"id":"ember-data-2.14.8","type":"project-version"},{"id":"ember-data-2.15.2","type":"project-version"},{"id":"ember-data-3.3.0","type":"project-version"},{"id":"ember-data-3.4.2","type":"project-version"},{"id":"ember-data-3.5.0","type":"project-version"},{"id":"ember-data-3.9.1","type":"project-version"},{"id":"ember-data-3.11.3","type":"project-version"},{"id":"ember-data-3.12.4","type":"project-version"},{"id":"ember-data-3.13.1","type":"project-version"},{"id":"ember-data-3.16.7","type":"project-version"},{"id":"ember-data-3.20.3","type":"project-version"},{"id":"ember-data-3.21.0","type":"project-version"},{"id":"ember-data-3.24.0","type":"project-version"},{"id":"ember-data-3.28.11","type":"project-version"},{"id":"ember-data-4.0.0","type":"project-version"},{"id":"ember-data-4.6.2","type":"project-version"},{"id":"ember-data-4.7.1","type":"project-version"},{"id":"ember-data-4.8.6","type":"project-version"},{"id":"ember-data-4.11.1","type":"project-version"},{"id":"ember-data-2.5.2","type":"project-version"},{"id":"ember-data-2.11.0","type":"project-version"},{"id":"ember-data-2.14.7","type":"project-version"},{"id":"ember-data-2.15.1","type":"project-version"},{"id":"ember-data-3.4.1","type":"project-version"},{"id":"ember-data-3.11.2","type":"project-version"},{"id":"ember-data-3.12.3","type":"project-version"},{"id":"ember-data-3.13.0","type":"project-version"},{"id":"ember-data-3.16.6","type":"project-version"},{"id":"ember-data-3.20.2","type":"project-version"},{"id":"ember-data-3.28.10","type":"project-version"},{"id":"ember-data-4.6.1","type":"project-version"},{"id":"ember-data-4.7.0","type":"project-version"},{"id":"ember-data-4.8.4","type":"project-version"},{"id":"ember-data-4.11.0","type":"project-version"}]}}},"meta":{"availableVersions":["5.2.0","5.1.2","1.13.13","1.13.14","1.13.15","1.13.16","2.0.1","2.1.0","2.2.1","2.3.3","2.4.3","2.5.5","2.6.2","2.7.0","2.8.1","2.9.0","2.10.0","2.11.3","2.12.2","2.13.2","2.14.10","2.15.4","2.16.0","2.17.0","2.18.0","3.0.3","3.1.1","3.2.2","3.3.2","3.4.4","3.5.2","3.6.0","3.7.0","3.8.1","3.9.3","3.10.0","3.11.5","3.12.6","3.13.3","3.14.1","3.15.1","3.16.9","3.17.1","3.18.0","3.19.0","3.20.5","3.21.2","3.22.1","3.23.0","3.24.2","3.25.0","3.26.0","3.27.1","3.28.13","4.0.2","4.1.0","4.2.0","4.3.0","4.4.1","4.5.0","4.6.4","4.7.3","4.8.8","4.9.1","4.10.0","4.11.3","4.12.0","5.0.0","2.0.0","2.3.2","2.4.1","2.5.4","2.6.1","2.8.0","2.11.2","2.12.1","2.13.1","2.14.9","2.15.3","3.0.0","3.1.0","3.2.0","3.3.1","3.4.3","3.5.1","3.8.0","3.9.2","3.11.4","3.12.5","3.13.2","3.14.0","3.15.0","3.16.8","3.17.0","3.20.4","3.21.1","3.22.0","3.24.1","3.27.0","3.28.12","4.0.1","4.4.0","4.6.3","4.7.2","4.8.7","4.9.0","4.11.2","2.3.0","2.4.0","2.5.3","2.6.0","2.11.1","2.13.0","2.14.8","2.15.2","3.3.0","3.4.2","3.5.0","3.9.1","3.11.3","3.12.4","3.13.1","3.16.7","3.20.3","3.21.0","3.24.0","3.28.11","4.0.0","4.6.2","4.7.1","4.8.6","4.11.1","2.5.2","2.11.0","2.14.7","2.15.1","3.4.1","3.11.2","3.12.3","3.13.0","3.16.6","3.20.2","3.28.10","4.6.1","4.7.0","4.8.4","4.11.0"]}} +{"data":{"id":"ember-data","type":"project","attributes":{"github-url":"https://github.com/emberjs/ember.js"},"relationships":{"project-versions":{"data":[{"id":"ember-data-5.3.0","type":"project-version"},{"id":"ember-data-5.2.0","type":"project-version"},{"id":"ember-data-5.1.2","type":"project-version"},{"id":"ember-data-1.13.13","type":"project-version"},{"id":"ember-data-1.13.14","type":"project-version"},{"id":"ember-data-1.13.15","type":"project-version"},{"id":"ember-data-1.13.16","type":"project-version"},{"id":"ember-data-2.0.1","type":"project-version"},{"id":"ember-data-2.1.0","type":"project-version"},{"id":"ember-data-2.2.1","type":"project-version"},{"id":"ember-data-2.3.3","type":"project-version"},{"id":"ember-data-2.4.3","type":"project-version"},{"id":"ember-data-2.5.5","type":"project-version"},{"id":"ember-data-2.6.2","type":"project-version"},{"id":"ember-data-2.7.0","type":"project-version"},{"id":"ember-data-2.8.1","type":"project-version"},{"id":"ember-data-2.9.0","type":"project-version"},{"id":"ember-data-2.10.0","type":"project-version"},{"id":"ember-data-2.11.3","type":"project-version"},{"id":"ember-data-2.12.2","type":"project-version"},{"id":"ember-data-2.13.2","type":"project-version"},{"id":"ember-data-2.14.10","type":"project-version"},{"id":"ember-data-2.15.4","type":"project-version"},{"id":"ember-data-2.16.0","type":"project-version"},{"id":"ember-data-2.17.0","type":"project-version"},{"id":"ember-data-2.18.0","type":"project-version"},{"id":"ember-data-3.0.3","type":"project-version"},{"id":"ember-data-3.1.1","type":"project-version"},{"id":"ember-data-3.2.2","type":"project-version"},{"id":"ember-data-3.3.2","type":"project-version"},{"id":"ember-data-3.4.4","type":"project-version"},{"id":"ember-data-3.5.2","type":"project-version"},{"id":"ember-data-3.6.0","type":"project-version"},{"id":"ember-data-3.7.0","type":"project-version"},{"id":"ember-data-3.8.1","type":"project-version"},{"id":"ember-data-3.9.3","type":"project-version"},{"id":"ember-data-3.10.0","type":"project-version"},{"id":"ember-data-3.11.5","type":"project-version"},{"id":"ember-data-3.12.6","type":"project-version"},{"id":"ember-data-3.13.3","type":"project-version"},{"id":"ember-data-3.14.1","type":"project-version"},{"id":"ember-data-3.15.1","type":"project-version"},{"id":"ember-data-3.16.9","type":"project-version"},{"id":"ember-data-3.17.1","type":"project-version"},{"id":"ember-data-3.18.0","type":"project-version"},{"id":"ember-data-3.19.0","type":"project-version"},{"id":"ember-data-3.20.5","type":"project-version"},{"id":"ember-data-3.21.2","type":"project-version"},{"id":"ember-data-3.22.1","type":"project-version"},{"id":"ember-data-3.23.0","type":"project-version"},{"id":"ember-data-3.24.2","type":"project-version"},{"id":"ember-data-3.25.0","type":"project-version"},{"id":"ember-data-3.26.0","type":"project-version"},{"id":"ember-data-3.27.1","type":"project-version"},{"id":"ember-data-3.28.13","type":"project-version"},{"id":"ember-data-4.0.2","type":"project-version"},{"id":"ember-data-4.1.0","type":"project-version"},{"id":"ember-data-4.2.0","type":"project-version"},{"id":"ember-data-4.3.0","type":"project-version"},{"id":"ember-data-4.4.1","type":"project-version"},{"id":"ember-data-4.5.0","type":"project-version"},{"id":"ember-data-4.6.4","type":"project-version"},{"id":"ember-data-4.7.3","type":"project-version"},{"id":"ember-data-4.8.8","type":"project-version"},{"id":"ember-data-4.9.1","type":"project-version"},{"id":"ember-data-4.10.0","type":"project-version"},{"id":"ember-data-4.11.3","type":"project-version"},{"id":"ember-data-4.12.0","type":"project-version"},{"id":"ember-data-5.0.0","type":"project-version"},{"id":"ember-data-2.0.0","type":"project-version"},{"id":"ember-data-2.3.2","type":"project-version"},{"id":"ember-data-2.4.1","type":"project-version"},{"id":"ember-data-2.5.4","type":"project-version"},{"id":"ember-data-2.6.1","type":"project-version"},{"id":"ember-data-2.8.0","type":"project-version"},{"id":"ember-data-2.11.2","type":"project-version"},{"id":"ember-data-2.12.1","type":"project-version"},{"id":"ember-data-2.13.1","type":"project-version"},{"id":"ember-data-2.14.9","type":"project-version"},{"id":"ember-data-2.15.3","type":"project-version"},{"id":"ember-data-3.0.0","type":"project-version"},{"id":"ember-data-3.1.0","type":"project-version"},{"id":"ember-data-3.2.0","type":"project-version"},{"id":"ember-data-3.3.1","type":"project-version"},{"id":"ember-data-3.4.3","type":"project-version"},{"id":"ember-data-3.5.1","type":"project-version"},{"id":"ember-data-3.8.0","type":"project-version"},{"id":"ember-data-3.9.2","type":"project-version"},{"id":"ember-data-3.11.4","type":"project-version"},{"id":"ember-data-3.12.5","type":"project-version"},{"id":"ember-data-3.13.2","type":"project-version"},{"id":"ember-data-3.14.0","type":"project-version"},{"id":"ember-data-3.15.0","type":"project-version"},{"id":"ember-data-3.16.8","type":"project-version"},{"id":"ember-data-3.17.0","type":"project-version"},{"id":"ember-data-3.20.4","type":"project-version"},{"id":"ember-data-3.21.1","type":"project-version"},{"id":"ember-data-3.22.0","type":"project-version"},{"id":"ember-data-3.24.1","type":"project-version"},{"id":"ember-data-3.27.0","type":"project-version"},{"id":"ember-data-3.28.12","type":"project-version"},{"id":"ember-data-4.0.1","type":"project-version"},{"id":"ember-data-4.4.0","type":"project-version"},{"id":"ember-data-4.6.3","type":"project-version"},{"id":"ember-data-4.7.2","type":"project-version"},{"id":"ember-data-4.8.7","type":"project-version"},{"id":"ember-data-4.9.0","type":"project-version"},{"id":"ember-data-4.11.2","type":"project-version"},{"id":"ember-data-2.3.0","type":"project-version"},{"id":"ember-data-2.4.0","type":"project-version"},{"id":"ember-data-2.5.3","type":"project-version"},{"id":"ember-data-2.6.0","type":"project-version"},{"id":"ember-data-2.11.1","type":"project-version"},{"id":"ember-data-2.13.0","type":"project-version"},{"id":"ember-data-2.14.8","type":"project-version"},{"id":"ember-data-2.15.2","type":"project-version"},{"id":"ember-data-3.3.0","type":"project-version"},{"id":"ember-data-3.4.2","type":"project-version"},{"id":"ember-data-3.5.0","type":"project-version"},{"id":"ember-data-3.9.1","type":"project-version"},{"id":"ember-data-3.11.3","type":"project-version"},{"id":"ember-data-3.12.4","type":"project-version"},{"id":"ember-data-3.13.1","type":"project-version"},{"id":"ember-data-3.16.7","type":"project-version"},{"id":"ember-data-3.20.3","type":"project-version"},{"id":"ember-data-3.21.0","type":"project-version"},{"id":"ember-data-3.24.0","type":"project-version"},{"id":"ember-data-3.28.11","type":"project-version"},{"id":"ember-data-4.0.0","type":"project-version"},{"id":"ember-data-4.6.2","type":"project-version"},{"id":"ember-data-4.7.1","type":"project-version"},{"id":"ember-data-4.8.6","type":"project-version"},{"id":"ember-data-4.11.1","type":"project-version"},{"id":"ember-data-2.5.2","type":"project-version"},{"id":"ember-data-2.11.0","type":"project-version"},{"id":"ember-data-2.14.7","type":"project-version"},{"id":"ember-data-2.15.1","type":"project-version"},{"id":"ember-data-3.4.1","type":"project-version"},{"id":"ember-data-3.11.2","type":"project-version"},{"id":"ember-data-3.12.3","type":"project-version"},{"id":"ember-data-3.13.0","type":"project-version"},{"id":"ember-data-3.16.6","type":"project-version"},{"id":"ember-data-3.20.2","type":"project-version"},{"id":"ember-data-3.28.10","type":"project-version"},{"id":"ember-data-4.6.1","type":"project-version"},{"id":"ember-data-4.7.0","type":"project-version"},{"id":"ember-data-4.8.4","type":"project-version"},{"id":"ember-data-4.11.0","type":"project-version"}]}}},"meta":{"availableVersions":["5.3.0","5.2.0","5.1.2","1.13.13","1.13.14","1.13.15","1.13.16","2.0.1","2.1.0","2.2.1","2.3.3","2.4.3","2.5.5","2.6.2","2.7.0","2.8.1","2.9.0","2.10.0","2.11.3","2.12.2","2.13.2","2.14.10","2.15.4","2.16.0","2.17.0","2.18.0","3.0.3","3.1.1","3.2.2","3.3.2","3.4.4","3.5.2","3.6.0","3.7.0","3.8.1","3.9.3","3.10.0","3.11.5","3.12.6","3.13.3","3.14.1","3.15.1","3.16.9","3.17.1","3.18.0","3.19.0","3.20.5","3.21.2","3.22.1","3.23.0","3.24.2","3.25.0","3.26.0","3.27.1","3.28.13","4.0.2","4.1.0","4.2.0","4.3.0","4.4.1","4.5.0","4.6.4","4.7.3","4.8.8","4.9.1","4.10.0","4.11.3","4.12.0","5.0.0","2.0.0","2.3.2","2.4.1","2.5.4","2.6.1","2.8.0","2.11.2","2.12.1","2.13.1","2.14.9","2.15.3","3.0.0","3.1.0","3.2.0","3.3.1","3.4.3","3.5.1","3.8.0","3.9.2","3.11.4","3.12.5","3.13.2","3.14.0","3.15.0","3.16.8","3.17.0","3.20.4","3.21.1","3.22.0","3.24.1","3.27.0","3.28.12","4.0.1","4.4.0","4.6.3","4.7.2","4.8.7","4.9.0","4.11.2","2.3.0","2.4.0","2.5.3","2.6.0","2.11.1","2.13.0","2.14.8","2.15.2","3.3.0","3.4.2","3.5.0","3.9.1","3.11.3","3.12.4","3.13.1","3.16.7","3.20.3","3.21.0","3.24.0","3.28.11","4.0.0","4.6.2","4.7.1","4.8.6","4.11.1","2.5.2","2.11.0","2.14.7","2.15.1","3.4.1","3.11.2","3.12.3","3.13.0","3.16.6","3.20.2","3.28.10","4.6.1","4.7.0","4.8.4","4.11.0"]}} diff --git a/rev-index/ember.json b/rev-index/ember.json index ffaf32fc5..a9fdbf4f2 100644 --- a/rev-index/ember.json +++ b/rev-index/ember.json @@ -1 +1 @@ -{"data":{"id":"ember","type":"project","attributes":{"github-url":"https://github.com/emberjs/ember.js"},"relationships":{"project-versions":{"data":[{"id":"ember-5.2.0","type":"project-version"},{"id":"ember-5.1.2","type":"project-version"},{"id":"ember-1.11.1","type":"project-version"},{"id":"ember-1.1.0","type":"project-version"},{"id":"ember-1.1.1","type":"project-version"},{"id":"ember-1.0.0","type":"project-version"},{"id":"ember-1.1.2","type":"project-version"},{"id":"ember-1.2.2","type":"project-version"},{"id":"ember-1.3.2","type":"project-version"},{"id":"ember-1.4.0","type":"project-version"},{"id":"ember-1.5.1","type":"project-version"},{"id":"ember-1.6.1","type":"project-version"},{"id":"ember-1.7.1","type":"project-version"},{"id":"ember-1.8.1","type":"project-version"},{"id":"ember-1.9.1","type":"project-version"},{"id":"ember-1.10.1","type":"project-version"},{"id":"ember-1.11.4","type":"project-version"},{"id":"ember-1.12.2","type":"project-version"},{"id":"ember-1.13.13","type":"project-version"},{"id":"ember-2.0.3","type":"project-version"},{"id":"ember-2.1.2","type":"project-version"},{"id":"ember-2.2.2","type":"project-version"},{"id":"ember-2.3.2","type":"project-version"},{"id":"ember-2.4.6","type":"project-version"},{"id":"ember-2.5.1","type":"project-version"},{"id":"ember-2.6.2","type":"project-version"},{"id":"ember-2.7.3","type":"project-version"},{"id":"ember-2.8.3","type":"project-version"},{"id":"ember-2.9.1","type":"project-version"},{"id":"ember-2.10.2","type":"project-version"},{"id":"ember-2.11.3","type":"project-version"},{"id":"ember-2.12.2","type":"project-version"},{"id":"ember-2.13.4","type":"project-version"},{"id":"ember-2.14.1","type":"project-version"},{"id":"ember-2.15.3","type":"project-version"},{"id":"ember-2.16.4","type":"project-version"},{"id":"ember-2.17.2","type":"project-version"},{"id":"ember-2.18.2","type":"project-version"},{"id":"ember-3.0.0","type":"project-version"},{"id":"ember-3.1.4","type":"project-version"},{"id":"ember-3.2.2","type":"project-version"},{"id":"ember-3.3.2","type":"project-version"},{"id":"ember-3.4.8","type":"project-version"},{"id":"ember-3.5.1","type":"project-version"},{"id":"ember-3.6.1","type":"project-version"},{"id":"ember-3.7.3","type":"project-version"},{"id":"ember-3.8.3","type":"project-version"},{"id":"ember-3.9.1","type":"project-version"},{"id":"ember-3.10.2","type":"project-version"},{"id":"ember-3.11.1","type":"project-version"},{"id":"ember-3.12.4","type":"project-version"},{"id":"ember-3.13.4","type":"project-version"},{"id":"ember-3.14.3","type":"project-version"},{"id":"ember-3.15.0","type":"project-version"},{"id":"ember-3.16.10","type":"project-version"},{"id":"ember-3.17.3","type":"project-version"},{"id":"ember-3.18.1","type":"project-version"},{"id":"ember-3.19.0","type":"project-version"},{"id":"ember-3.20.7","type":"project-version"},{"id":"ember-3.21.3","type":"project-version"},{"id":"ember-3.22.2","type":"project-version"},{"id":"ember-3.23.1","type":"project-version"},{"id":"ember-3.24.7","type":"project-version"},{"id":"ember-3.25.4","type":"project-version"},{"id":"ember-3.26.2","type":"project-version"},{"id":"ember-3.27.5","type":"project-version"},{"id":"ember-3.28.12","type":"project-version"},{"id":"ember-4.0.1","type":"project-version"},{"id":"ember-4.1.0","type":"project-version"},{"id":"ember-4.2.0","type":"project-version"},{"id":"ember-4.3.0","type":"project-version"},{"id":"ember-4.4.5","type":"project-version"},{"id":"ember-4.5.1","type":"project-version"},{"id":"ember-4.6.0","type":"project-version"},{"id":"ember-4.7.1","type":"project-version"},{"id":"ember-4.8.6","type":"project-version"},{"id":"ember-4.9.3","type":"project-version"},{"id":"ember-4.10.0","type":"project-version"},{"id":"ember-4.11.0","type":"project-version"},{"id":"ember-4.12.1","type":"project-version"},{"id":"ember-5.0.0","type":"project-version"},{"id":"ember-1.2.0","type":"project-version"},{"id":"ember-1.3.0","type":"project-version"},{"id":"ember-1.5.0","type":"project-version"},{"id":"ember-1.6.0","type":"project-version"},{"id":"ember-1.7.0","type":"project-version"},{"id":"ember-1.8.0","type":"project-version"},{"id":"ember-1.9.0","type":"project-version"},{"id":"ember-1.10.0","type":"project-version"},{"id":"ember-1.11.3","type":"project-version"},{"id":"ember-1.12.1","type":"project-version"},{"id":"ember-1.13.12","type":"project-version"},{"id":"ember-2.0.2","type":"project-version"},{"id":"ember-2.1.1","type":"project-version"},{"id":"ember-2.2.1","type":"project-version"},{"id":"ember-2.3.1","type":"project-version"},{"id":"ember-2.4.5","type":"project-version"},{"id":"ember-2.5.0","type":"project-version"},{"id":"ember-2.6.1","type":"project-version"},{"id":"ember-2.7.2","type":"project-version"},{"id":"ember-2.8.2","type":"project-version"},{"id":"ember-2.9.0","type":"project-version"},{"id":"ember-2.10.1","type":"project-version"},{"id":"ember-2.11.2","type":"project-version"},{"id":"ember-2.12.1","type":"project-version"},{"id":"ember-2.13.3","type":"project-version"},{"id":"ember-2.14.0","type":"project-version"},{"id":"ember-2.15.2","type":"project-version"},{"id":"ember-2.16.3","type":"project-version"},{"id":"ember-2.17.1","type":"project-version"},{"id":"ember-2.18.1","type":"project-version"},{"id":"ember-3.1.3","type":"project-version"},{"id":"ember-3.2.1","type":"project-version"},{"id":"ember-3.3.1","type":"project-version"},{"id":"ember-3.4.7","type":"project-version"},{"id":"ember-3.5.0","type":"project-version"},{"id":"ember-3.6.0","type":"project-version"},{"id":"ember-3.7.2","type":"project-version"},{"id":"ember-3.8.2","type":"project-version"},{"id":"ember-3.9.0","type":"project-version"},{"id":"ember-3.10.1","type":"project-version"},{"id":"ember-3.11.0","type":"project-version"},{"id":"ember-3.12.3","type":"project-version"},{"id":"ember-3.13.3","type":"project-version"},{"id":"ember-3.14.2","type":"project-version"},{"id":"ember-3.16.9","type":"project-version"},{"id":"ember-3.17.2","type":"project-version"},{"id":"ember-3.18.0","type":"project-version"},{"id":"ember-3.20.6","type":"project-version"},{"id":"ember-3.21.2","type":"project-version"},{"id":"ember-3.22.1","type":"project-version"},{"id":"ember-3.23.0","type":"project-version"},{"id":"ember-3.24.6","type":"project-version"},{"id":"ember-3.25.3","type":"project-version"},{"id":"ember-3.26.1","type":"project-version"},{"id":"ember-3.27.4","type":"project-version"},{"id":"ember-3.28.11","type":"project-version"},{"id":"ember-4.0.0","type":"project-version"},{"id":"ember-4.4.4","type":"project-version"},{"id":"ember-4.5.0","type":"project-version"},{"id":"ember-4.7.0","type":"project-version"},{"id":"ember-4.8.5","type":"project-version"},{"id":"ember-4.9.2","type":"project-version"},{"id":"ember-4.12.0","type":"project-version"},{"id":"ember-1.11.2","type":"project-version"},{"id":"ember-1.12.0","type":"project-version"},{"id":"ember-1.13.11","type":"project-version"},{"id":"ember-2.0.1","type":"project-version"},{"id":"ember-2.1.0","type":"project-version"},{"id":"ember-2.2.0","type":"project-version"},{"id":"ember-2.3.0","type":"project-version"},{"id":"ember-2.4.4","type":"project-version"},{"id":"ember-2.6.0","type":"project-version"},{"id":"ember-2.7.1","type":"project-version"},{"id":"ember-2.8.1","type":"project-version"},{"id":"ember-2.10.0","type":"project-version"},{"id":"ember-2.11.1","type":"project-version"},{"id":"ember-2.12.0","type":"project-version"},{"id":"ember-2.13.2","type":"project-version"},{"id":"ember-2.15.1","type":"project-version"},{"id":"ember-2.16.2","type":"project-version"},{"id":"ember-2.17.0","type":"project-version"},{"id":"ember-2.18.0","type":"project-version"},{"id":"ember-3.1.2","type":"project-version"},{"id":"ember-3.2.0","type":"project-version"},{"id":"ember-3.3.0","type":"project-version"},{"id":"ember-3.4.6","type":"project-version"},{"id":"ember-3.7.1","type":"project-version"},{"id":"ember-3.8.1","type":"project-version"},{"id":"ember-3.10.0","type":"project-version"},{"id":"ember-3.12.2","type":"project-version"},{"id":"ember-3.13.2","type":"project-version"},{"id":"ember-3.14.1","type":"project-version"},{"id":"ember-3.16.8","type":"project-version"},{"id":"ember-3.17.1","type":"project-version"},{"id":"ember-3.20.5","type":"project-version"},{"id":"ember-3.21.1","type":"project-version"},{"id":"ember-3.22.0","type":"project-version"},{"id":"ember-3.24.5","type":"project-version"},{"id":"ember-3.25.2","type":"project-version"},{"id":"ember-3.26.0","type":"project-version"},{"id":"ember-3.27.3","type":"project-version"},{"id":"ember-3.28.10","type":"project-version"},{"id":"ember-4.4.3","type":"project-version"},{"id":"ember-4.8.4","type":"project-version"},{"id":"ember-4.9.1","type":"project-version"},{"id":"ember-1.13.10","type":"project-version"},{"id":"ember-2.0.0","type":"project-version"},{"id":"ember-2.4.3","type":"project-version"},{"id":"ember-2.7.0","type":"project-version"},{"id":"ember-2.8.0","type":"project-version"},{"id":"ember-2.11.0","type":"project-version"},{"id":"ember-2.13.1","type":"project-version"},{"id":"ember-2.15.0","type":"project-version"},{"id":"ember-2.16.1","type":"project-version"},{"id":"ember-3.1.1","type":"project-version"},{"id":"ember-3.4.5","type":"project-version"},{"id":"ember-3.7.0","type":"project-version"},{"id":"ember-3.8.0","type":"project-version"},{"id":"ember-3.12.1","type":"project-version"},{"id":"ember-3.13.1","type":"project-version"},{"id":"ember-3.14.0","type":"project-version"},{"id":"ember-3.16.7","type":"project-version"},{"id":"ember-3.17.0","type":"project-version"},{"id":"ember-3.20.4","type":"project-version"},{"id":"ember-3.21.0","type":"project-version"},{"id":"ember-3.24.4","type":"project-version"},{"id":"ember-3.25.1","type":"project-version"},{"id":"ember-3.27.2","type":"project-version"},{"id":"ember-3.28.9","type":"project-version"},{"id":"ember-4.4.2","type":"project-version"},{"id":"ember-4.8.3","type":"project-version"},{"id":"ember-4.9.0","type":"project-version"}]}}},"meta":{"availableVersions":["5.2.0","5.1.2","1.11.1","1.1.0","1.1.1","1.0.0","1.1.2","1.2.2","1.3.2","1.4.0","1.5.1","1.6.1","1.7.1","1.8.1","1.9.1","1.10.1","1.11.4","1.12.2","1.13.13","2.0.3","2.1.2","2.2.2","2.3.2","2.4.6","2.5.1","2.6.2","2.7.3","2.8.3","2.9.1","2.10.2","2.11.3","2.12.2","2.13.4","2.14.1","2.15.3","2.16.4","2.17.2","2.18.2","3.0.0","3.1.4","3.2.2","3.3.2","3.4.8","3.5.1","3.6.1","3.7.3","3.8.3","3.9.1","3.10.2","3.11.1","3.12.4","3.13.4","3.14.3","3.15.0","3.16.10","3.17.3","3.18.1","3.19.0","3.20.7","3.21.3","3.22.2","3.23.1","3.24.7","3.25.4","3.26.2","3.27.5","3.28.12","4.0.1","4.1.0","4.2.0","4.3.0","4.4.5","4.5.1","4.6.0","4.7.1","4.8.6","4.9.3","4.10.0","4.11.0","4.12.1","5.0.0","1.2.0","1.3.0","1.5.0","1.6.0","1.7.0","1.8.0","1.9.0","1.10.0","1.11.3","1.12.1","1.13.12","2.0.2","2.1.1","2.2.1","2.3.1","2.4.5","2.5.0","2.6.1","2.7.2","2.8.2","2.9.0","2.10.1","2.11.2","2.12.1","2.13.3","2.14.0","2.15.2","2.16.3","2.17.1","2.18.1","3.1.3","3.2.1","3.3.1","3.4.7","3.5.0","3.6.0","3.7.2","3.8.2","3.9.0","3.10.1","3.11.0","3.12.3","3.13.3","3.14.2","3.16.9","3.17.2","3.18.0","3.20.6","3.21.2","3.22.1","3.23.0","3.24.6","3.25.3","3.26.1","3.27.4","3.28.11","4.0.0","4.4.4","4.5.0","4.7.0","4.8.5","4.9.2","4.12.0","1.11.2","1.12.0","1.13.11","2.0.1","2.1.0","2.2.0","2.3.0","2.4.4","2.6.0","2.7.1","2.8.1","2.10.0","2.11.1","2.12.0","2.13.2","2.15.1","2.16.2","2.17.0","2.18.0","3.1.2","3.2.0","3.3.0","3.4.6","3.7.1","3.8.1","3.10.0","3.12.2","3.13.2","3.14.1","3.16.8","3.17.1","3.20.5","3.21.1","3.22.0","3.24.5","3.25.2","3.26.0","3.27.3","3.28.10","4.4.3","4.8.4","4.9.1","1.13.10","2.0.0","2.4.3","2.7.0","2.8.0","2.11.0","2.13.1","2.15.0","2.16.1","3.1.1","3.4.5","3.7.0","3.8.0","3.12.1","3.13.1","3.14.0","3.16.7","3.17.0","3.20.4","3.21.0","3.24.4","3.25.1","3.27.2","3.28.9","4.4.2","4.8.3","4.9.0"]}} +{"data":{"id":"ember","type":"project","attributes":{"github-url":"https://github.com/emberjs/ember.js"},"relationships":{"project-versions":{"data":[{"id":"ember-5.3.0","type":"project-version"},{"id":"ember-5.2.0","type":"project-version"},{"id":"ember-5.1.2","type":"project-version"},{"id":"ember-1.11.1","type":"project-version"},{"id":"ember-1.1.0","type":"project-version"},{"id":"ember-1.1.1","type":"project-version"},{"id":"ember-1.0.0","type":"project-version"},{"id":"ember-1.1.2","type":"project-version"},{"id":"ember-1.2.2","type":"project-version"},{"id":"ember-1.3.2","type":"project-version"},{"id":"ember-1.4.0","type":"project-version"},{"id":"ember-1.5.1","type":"project-version"},{"id":"ember-1.6.1","type":"project-version"},{"id":"ember-1.7.1","type":"project-version"},{"id":"ember-1.8.1","type":"project-version"},{"id":"ember-1.9.1","type":"project-version"},{"id":"ember-1.10.1","type":"project-version"},{"id":"ember-1.11.4","type":"project-version"},{"id":"ember-1.12.2","type":"project-version"},{"id":"ember-1.13.13","type":"project-version"},{"id":"ember-2.0.3","type":"project-version"},{"id":"ember-2.1.2","type":"project-version"},{"id":"ember-2.2.2","type":"project-version"},{"id":"ember-2.3.2","type":"project-version"},{"id":"ember-2.4.6","type":"project-version"},{"id":"ember-2.5.1","type":"project-version"},{"id":"ember-2.6.2","type":"project-version"},{"id":"ember-2.7.3","type":"project-version"},{"id":"ember-2.8.3","type":"project-version"},{"id":"ember-2.9.1","type":"project-version"},{"id":"ember-2.10.2","type":"project-version"},{"id":"ember-2.11.3","type":"project-version"},{"id":"ember-2.12.2","type":"project-version"},{"id":"ember-2.13.4","type":"project-version"},{"id":"ember-2.14.1","type":"project-version"},{"id":"ember-2.15.3","type":"project-version"},{"id":"ember-2.16.4","type":"project-version"},{"id":"ember-2.17.2","type":"project-version"},{"id":"ember-2.18.2","type":"project-version"},{"id":"ember-3.0.0","type":"project-version"},{"id":"ember-3.1.4","type":"project-version"},{"id":"ember-3.2.2","type":"project-version"},{"id":"ember-3.3.2","type":"project-version"},{"id":"ember-3.4.8","type":"project-version"},{"id":"ember-3.5.1","type":"project-version"},{"id":"ember-3.6.1","type":"project-version"},{"id":"ember-3.7.3","type":"project-version"},{"id":"ember-3.8.3","type":"project-version"},{"id":"ember-3.9.1","type":"project-version"},{"id":"ember-3.10.2","type":"project-version"},{"id":"ember-3.11.1","type":"project-version"},{"id":"ember-3.12.4","type":"project-version"},{"id":"ember-3.13.4","type":"project-version"},{"id":"ember-3.14.3","type":"project-version"},{"id":"ember-3.15.0","type":"project-version"},{"id":"ember-3.16.10","type":"project-version"},{"id":"ember-3.17.3","type":"project-version"},{"id":"ember-3.18.1","type":"project-version"},{"id":"ember-3.19.0","type":"project-version"},{"id":"ember-3.20.7","type":"project-version"},{"id":"ember-3.21.3","type":"project-version"},{"id":"ember-3.22.2","type":"project-version"},{"id":"ember-3.23.1","type":"project-version"},{"id":"ember-3.24.7","type":"project-version"},{"id":"ember-3.25.4","type":"project-version"},{"id":"ember-3.26.2","type":"project-version"},{"id":"ember-3.27.5","type":"project-version"},{"id":"ember-3.28.12","type":"project-version"},{"id":"ember-4.0.1","type":"project-version"},{"id":"ember-4.1.0","type":"project-version"},{"id":"ember-4.2.0","type":"project-version"},{"id":"ember-4.3.0","type":"project-version"},{"id":"ember-4.4.5","type":"project-version"},{"id":"ember-4.5.1","type":"project-version"},{"id":"ember-4.6.0","type":"project-version"},{"id":"ember-4.7.1","type":"project-version"},{"id":"ember-4.8.6","type":"project-version"},{"id":"ember-4.9.3","type":"project-version"},{"id":"ember-4.10.0","type":"project-version"},{"id":"ember-4.11.0","type":"project-version"},{"id":"ember-4.12.1","type":"project-version"},{"id":"ember-5.0.0","type":"project-version"},{"id":"ember-1.2.0","type":"project-version"},{"id":"ember-1.3.0","type":"project-version"},{"id":"ember-1.5.0","type":"project-version"},{"id":"ember-1.6.0","type":"project-version"},{"id":"ember-1.7.0","type":"project-version"},{"id":"ember-1.8.0","type":"project-version"},{"id":"ember-1.9.0","type":"project-version"},{"id":"ember-1.10.0","type":"project-version"},{"id":"ember-1.11.3","type":"project-version"},{"id":"ember-1.12.1","type":"project-version"},{"id":"ember-1.13.12","type":"project-version"},{"id":"ember-2.0.2","type":"project-version"},{"id":"ember-2.1.1","type":"project-version"},{"id":"ember-2.2.1","type":"project-version"},{"id":"ember-2.3.1","type":"project-version"},{"id":"ember-2.4.5","type":"project-version"},{"id":"ember-2.5.0","type":"project-version"},{"id":"ember-2.6.1","type":"project-version"},{"id":"ember-2.7.2","type":"project-version"},{"id":"ember-2.8.2","type":"project-version"},{"id":"ember-2.9.0","type":"project-version"},{"id":"ember-2.10.1","type":"project-version"},{"id":"ember-2.11.2","type":"project-version"},{"id":"ember-2.12.1","type":"project-version"},{"id":"ember-2.13.3","type":"project-version"},{"id":"ember-2.14.0","type":"project-version"},{"id":"ember-2.15.2","type":"project-version"},{"id":"ember-2.16.3","type":"project-version"},{"id":"ember-2.17.1","type":"project-version"},{"id":"ember-2.18.1","type":"project-version"},{"id":"ember-3.1.3","type":"project-version"},{"id":"ember-3.2.1","type":"project-version"},{"id":"ember-3.3.1","type":"project-version"},{"id":"ember-3.4.7","type":"project-version"},{"id":"ember-3.5.0","type":"project-version"},{"id":"ember-3.6.0","type":"project-version"},{"id":"ember-3.7.2","type":"project-version"},{"id":"ember-3.8.2","type":"project-version"},{"id":"ember-3.9.0","type":"project-version"},{"id":"ember-3.10.1","type":"project-version"},{"id":"ember-3.11.0","type":"project-version"},{"id":"ember-3.12.3","type":"project-version"},{"id":"ember-3.13.3","type":"project-version"},{"id":"ember-3.14.2","type":"project-version"},{"id":"ember-3.16.9","type":"project-version"},{"id":"ember-3.17.2","type":"project-version"},{"id":"ember-3.18.0","type":"project-version"},{"id":"ember-3.20.6","type":"project-version"},{"id":"ember-3.21.2","type":"project-version"},{"id":"ember-3.22.1","type":"project-version"},{"id":"ember-3.23.0","type":"project-version"},{"id":"ember-3.24.6","type":"project-version"},{"id":"ember-3.25.3","type":"project-version"},{"id":"ember-3.26.1","type":"project-version"},{"id":"ember-3.27.4","type":"project-version"},{"id":"ember-3.28.11","type":"project-version"},{"id":"ember-4.0.0","type":"project-version"},{"id":"ember-4.4.4","type":"project-version"},{"id":"ember-4.5.0","type":"project-version"},{"id":"ember-4.7.0","type":"project-version"},{"id":"ember-4.8.5","type":"project-version"},{"id":"ember-4.9.2","type":"project-version"},{"id":"ember-4.12.0","type":"project-version"},{"id":"ember-1.11.2","type":"project-version"},{"id":"ember-1.12.0","type":"project-version"},{"id":"ember-1.13.11","type":"project-version"},{"id":"ember-2.0.1","type":"project-version"},{"id":"ember-2.1.0","type":"project-version"},{"id":"ember-2.2.0","type":"project-version"},{"id":"ember-2.3.0","type":"project-version"},{"id":"ember-2.4.4","type":"project-version"},{"id":"ember-2.6.0","type":"project-version"},{"id":"ember-2.7.1","type":"project-version"},{"id":"ember-2.8.1","type":"project-version"},{"id":"ember-2.10.0","type":"project-version"},{"id":"ember-2.11.1","type":"project-version"},{"id":"ember-2.12.0","type":"project-version"},{"id":"ember-2.13.2","type":"project-version"},{"id":"ember-2.15.1","type":"project-version"},{"id":"ember-2.16.2","type":"project-version"},{"id":"ember-2.17.0","type":"project-version"},{"id":"ember-2.18.0","type":"project-version"},{"id":"ember-3.1.2","type":"project-version"},{"id":"ember-3.2.0","type":"project-version"},{"id":"ember-3.3.0","type":"project-version"},{"id":"ember-3.4.6","type":"project-version"},{"id":"ember-3.7.1","type":"project-version"},{"id":"ember-3.8.1","type":"project-version"},{"id":"ember-3.10.0","type":"project-version"},{"id":"ember-3.12.2","type":"project-version"},{"id":"ember-3.13.2","type":"project-version"},{"id":"ember-3.14.1","type":"project-version"},{"id":"ember-3.16.8","type":"project-version"},{"id":"ember-3.17.1","type":"project-version"},{"id":"ember-3.20.5","type":"project-version"},{"id":"ember-3.21.1","type":"project-version"},{"id":"ember-3.22.0","type":"project-version"},{"id":"ember-3.24.5","type":"project-version"},{"id":"ember-3.25.2","type":"project-version"},{"id":"ember-3.26.0","type":"project-version"},{"id":"ember-3.27.3","type":"project-version"},{"id":"ember-3.28.10","type":"project-version"},{"id":"ember-4.4.3","type":"project-version"},{"id":"ember-4.8.4","type":"project-version"},{"id":"ember-4.9.1","type":"project-version"},{"id":"ember-1.13.10","type":"project-version"},{"id":"ember-2.0.0","type":"project-version"},{"id":"ember-2.4.3","type":"project-version"},{"id":"ember-2.7.0","type":"project-version"},{"id":"ember-2.8.0","type":"project-version"},{"id":"ember-2.11.0","type":"project-version"},{"id":"ember-2.13.1","type":"project-version"},{"id":"ember-2.15.0","type":"project-version"},{"id":"ember-2.16.1","type":"project-version"},{"id":"ember-3.1.1","type":"project-version"},{"id":"ember-3.4.5","type":"project-version"},{"id":"ember-3.7.0","type":"project-version"},{"id":"ember-3.8.0","type":"project-version"},{"id":"ember-3.12.1","type":"project-version"},{"id":"ember-3.13.1","type":"project-version"},{"id":"ember-3.14.0","type":"project-version"},{"id":"ember-3.16.7","type":"project-version"},{"id":"ember-3.17.0","type":"project-version"},{"id":"ember-3.20.4","type":"project-version"},{"id":"ember-3.21.0","type":"project-version"},{"id":"ember-3.24.4","type":"project-version"},{"id":"ember-3.25.1","type":"project-version"},{"id":"ember-3.27.2","type":"project-version"},{"id":"ember-3.28.9","type":"project-version"},{"id":"ember-4.4.2","type":"project-version"},{"id":"ember-4.8.3","type":"project-version"},{"id":"ember-4.9.0","type":"project-version"}]}}},"meta":{"availableVersions":["5.3.0","5.2.0","5.1.2","1.11.1","1.1.0","1.1.1","1.0.0","1.1.2","1.2.2","1.3.2","1.4.0","1.5.1","1.6.1","1.7.1","1.8.1","1.9.1","1.10.1","1.11.4","1.12.2","1.13.13","2.0.3","2.1.2","2.2.2","2.3.2","2.4.6","2.5.1","2.6.2","2.7.3","2.8.3","2.9.1","2.10.2","2.11.3","2.12.2","2.13.4","2.14.1","2.15.3","2.16.4","2.17.2","2.18.2","3.0.0","3.1.4","3.2.2","3.3.2","3.4.8","3.5.1","3.6.1","3.7.3","3.8.3","3.9.1","3.10.2","3.11.1","3.12.4","3.13.4","3.14.3","3.15.0","3.16.10","3.17.3","3.18.1","3.19.0","3.20.7","3.21.3","3.22.2","3.23.1","3.24.7","3.25.4","3.26.2","3.27.5","3.28.12","4.0.1","4.1.0","4.2.0","4.3.0","4.4.5","4.5.1","4.6.0","4.7.1","4.8.6","4.9.3","4.10.0","4.11.0","4.12.1","5.0.0","1.2.0","1.3.0","1.5.0","1.6.0","1.7.0","1.8.0","1.9.0","1.10.0","1.11.3","1.12.1","1.13.12","2.0.2","2.1.1","2.2.1","2.3.1","2.4.5","2.5.0","2.6.1","2.7.2","2.8.2","2.9.0","2.10.1","2.11.2","2.12.1","2.13.3","2.14.0","2.15.2","2.16.3","2.17.1","2.18.1","3.1.3","3.2.1","3.3.1","3.4.7","3.5.0","3.6.0","3.7.2","3.8.2","3.9.0","3.10.1","3.11.0","3.12.3","3.13.3","3.14.2","3.16.9","3.17.2","3.18.0","3.20.6","3.21.2","3.22.1","3.23.0","3.24.6","3.25.3","3.26.1","3.27.4","3.28.11","4.0.0","4.4.4","4.5.0","4.7.0","4.8.5","4.9.2","4.12.0","1.11.2","1.12.0","1.13.11","2.0.1","2.1.0","2.2.0","2.3.0","2.4.4","2.6.0","2.7.1","2.8.1","2.10.0","2.11.1","2.12.0","2.13.2","2.15.1","2.16.2","2.17.0","2.18.0","3.1.2","3.2.0","3.3.0","3.4.6","3.7.1","3.8.1","3.10.0","3.12.2","3.13.2","3.14.1","3.16.8","3.17.1","3.20.5","3.21.1","3.22.0","3.24.5","3.25.2","3.26.0","3.27.3","3.28.10","4.4.3","4.8.4","4.9.1","1.13.10","2.0.0","2.4.3","2.7.0","2.8.0","2.11.0","2.13.1","2.15.0","2.16.1","3.1.1","3.4.5","3.7.0","3.8.0","3.12.1","3.13.1","3.14.0","3.16.7","3.17.0","3.20.4","3.21.0","3.24.4","3.25.1","3.27.2","3.28.9","4.4.2","4.8.3","4.9.0"]}} diff --git a/s3-docs/v5.3.0/ember-data-docs.json b/s3-docs/v5.3.0/ember-data-docs.json new file mode 100644 index 000000000..56a436ff4 --- /dev/null +++ b/s3-docs/v5.3.0/ember-data-docs.json @@ -0,0 +1,14948 @@ +{ + "project": { + "name": "EmberData Documentation", + "description": "Documentation for EmberData: a lightweight reactive data library for JavaScript applications.", + "url": "https://github.com/emberjs/data", + "version": "5.3.0+4badefdc" + }, + "files": { + "../../ember-data-types/cache/cache.ts": { + "name": "../../ember-data-types/cache/cache.ts", + "modules": {}, + "classes": { + " Cache": 1 + }, + "fors": {}, + "namespaces": {} + }, + "../../ember-data-types/q/cache-store-wrapper.ts": { + "name": "../../ember-data-types/q/cache-store-wrapper.ts", + "modules": {}, + "classes": { + "CacheCapabilitiesManager": 1 + }, + "fors": {}, + "namespaces": {} + }, + "../../ember-data-types/q/cache.ts": { + "name": "../../ember-data-types/q/cache.ts", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "../../ember-data-types/q/ember-data-json-api.ts": { + "name": "../../ember-data-types/q/ember-data-json-api.ts", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "../../ember-data-types/q/identifier.ts": { + "name": "../../ember-data-types/q/identifier.ts", + "modules": {}, + "classes": { + "StableRecordIdentifier": 1 + }, + "fors": { + "@ember-data/store": 1 + }, + "namespaces": {} + }, + "../../ember-data-types/q/minimum-adapter-interface.ts": { + "name": "../../ember-data-types/q/minimum-adapter-interface.ts", + "modules": {}, + "classes": { + " Adapter": 1 + }, + "fors": {}, + "namespaces": {} + }, + "../../ember-data-types/q/minimum-serializer-interface.ts": { + "name": "../../ember-data-types/q/minimum-serializer-interface.ts", + "modules": {}, + "classes": { + " Serializer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "../../ember-data-types/q/record-data-json-api.ts": { + "name": "../../ember-data-types/q/record-data-json-api.ts", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "../../ember-data-types/q/record-data-schemas.ts": { + "name": "../../ember-data-types/q/record-data-schemas.ts", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "../../ember-data-types/q/record-instance.ts": { + "name": "../../ember-data-types/q/record-instance.ts", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "../../ember-data-types/q/schema-service.ts": { + "name": "../../ember-data-types/q/schema-service.ts", + "modules": {}, + "classes": { + "SchemaService": 1 + }, + "fors": {}, + "namespaces": {} + }, + "../../ember-data-types/overview.ts": { + "name": "../../ember-data-types/overview.ts", + "modules": { + "@ember-data/experimental-preview-types": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "../-ember-data/addon/index.js": { + "name": "../-ember-data/addon/index.js", + "modules": { + "ember-data-overview": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "../active-record/src/-private/builders/find-record.ts": { + "name": "../active-record/src/-private/builders/find-record.ts", + "modules": {}, + "classes": {}, + "fors": { + "@ember-data/active-record/request": 1 + }, + "namespaces": {} + }, + "../active-record/src/-private/builders/query.ts": { + "name": "../active-record/src/-private/builders/query.ts", + "modules": {}, + "classes": {}, + "fors": { + "@ember-data/active-record/request": 1 + }, + "namespaces": {} + }, + "../active-record/src/-private/builders/save-record.ts": { + "name": "../active-record/src/-private/builders/save-record.ts", + "modules": {}, + "classes": {}, + "fors": { + "@ember-data/active-record/request": 1 + }, + "namespaces": {} + }, + "../active-record/src/request.ts": { + "name": "../active-record/src/request.ts", + "modules": { + "@ember-data/active-record/request": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "../adapter/src/-private/build-url-mixin.ts": { + "name": "../adapter/src/-private/build-url-mixin.ts", + "modules": {}, + "classes": { + "BuildURLMixin": 1 + }, + "fors": {}, + "namespaces": {} + }, + "../adapter/src/-private.ts": { + "name": "../adapter/src/-private.ts", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "../adapter/src/error.js": { + "name": "../adapter/src/error.js", + "modules": { + "@ember-data/adapter/error": 1 + }, + "classes": { + "AdapterError": 1, + "InvalidError": 1, + "TimeoutError": 1, + "AbortError": 1, + "UnauthorizedError": 1, + "ForbiddenError": 1, + "NotFoundError": 1, + "ConflictError": 1, + "ServerError": 1 + }, + "fors": {}, + "namespaces": {} + }, + "../adapter/src/index.ts": { + "name": "../adapter/src/index.ts", + "modules": { + "@ember-data/adapter": 1 + }, + "classes": { + "Adapter": 1 + }, + "fors": {}, + "namespaces": {} + }, + "../adapter/src/json-api.ts": { + "name": "../adapter/src/json-api.ts", + "modules": { + "@ember-data/adapter/json-api": 1 + }, + "classes": { + "JSONAPIAdapter": 1 + }, + "fors": {}, + "namespaces": {} + }, + "../adapter/src/rest.ts": { + "name": "../adapter/src/rest.ts", + "modules": { + "@ember-data/adapter/rest": 1 + }, + "classes": { + "RESTAdapter": 1 + }, + "fors": { + "@ember-data/adapter/rest": 1 + }, + "namespaces": {} + }, + "../debug/addon/index.js": { + "name": "../debug/addon/index.js", + "modules": { + "@ember-data/debug": 1 + }, + "classes": { + "InspectorDataAdapter": 1 + }, + "fors": {}, + "namespaces": {} + }, + "../graph/src/-private/-edge-definition.ts": { + "name": "../graph/src/-private/-edge-definition.ts", + "modules": {}, + "classes": { + "UpgradedMeta": 1 + }, + "fors": {}, + "namespaces": {} + }, + "../graph/src/-private.ts": { + "name": "../graph/src/-private.ts", + "modules": { + "@ember-data/graph": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "../json-api/src/-private/builders/find-record.ts": { + "name": "../json-api/src/-private/builders/find-record.ts", + "modules": {}, + "classes": {}, + "fors": { + "@ember-data/json-api/request": 1 + }, + "namespaces": {} + }, + "../json-api/src/-private/builders/query.ts": { + "name": "../json-api/src/-private/builders/query.ts", + "modules": {}, + "classes": {}, + "fors": { + "@ember-data/json-api/request": 1 + }, + "namespaces": {} + }, + "../json-api/src/-private/builders/save-record.ts": { + "name": "../json-api/src/-private/builders/save-record.ts", + "modules": {}, + "classes": {}, + "fors": { + "@ember-data/json-api/request": 1 + }, + "namespaces": {} + }, + "../json-api/src/-private/cache.ts": { + "name": "../json-api/src/-private/cache.ts", + "modules": {}, + "classes": { + "Cache": 1 + }, + "fors": {}, + "namespaces": {} + }, + "../json-api/src/-private/serialize.ts": { + "name": "../json-api/src/-private/serialize.ts", + "modules": {}, + "classes": {}, + "fors": { + "@ember-data/json-api/request": 1 + }, + "namespaces": {} + }, + "../json-api/src/index.ts": { + "name": "../json-api/src/index.ts", + "modules": { + "@ember-data/json-api": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "../json-api/src/request.ts": { + "name": "../json-api/src/request.ts", + "modules": { + "@ember-data/json-api/request": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "../legacy-compat/src/legacy-network-handler/fetch-manager.ts": { + "name": "../legacy-compat/src/legacy-network-handler/fetch-manager.ts", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "../legacy-compat/src/legacy-network-handler/serializer-response.ts": { + "name": "../legacy-compat/src/legacy-network-handler/serializer-response.ts", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "../legacy-compat/src/legacy-network-handler/snapshot-record-array.ts": { + "name": "../legacy-compat/src/legacy-network-handler/snapshot-record-array.ts", + "modules": {}, + "classes": { + "SnapshotRecordArray": 1 + }, + "fors": {}, + "namespaces": {} + }, + "../legacy-compat/src/legacy-network-handler/snapshot.ts": { + "name": "../legacy-compat/src/legacy-network-handler/snapshot.ts", + "modules": {}, + "classes": { + "Snapshot": 1 + }, + "fors": {}, + "namespaces": {} + }, + "../legacy-compat/src/index.ts": { + "name": "../legacy-compat/src/index.ts", + "modules": { + "@ember-data/legacy-compat": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "../model/src/-private/references/belongs-to.ts": { + "name": "../model/src/-private/references/belongs-to.ts", + "modules": {}, + "classes": { + "BelongsToReference": 1 + }, + "fors": {}, + "namespaces": {} + }, + "../model/src/-private/references/has-many.ts": { + "name": "../model/src/-private/references/has-many.ts", + "modules": {}, + "classes": { + "HasManyReference": 1 + }, + "fors": {}, + "namespaces": {} + }, + "../model/src/-private/attr.js": { + "name": "../model/src/-private/attr.js", + "modules": {}, + "classes": {}, + "fors": { + "@ember-data/model": 1 + }, + "namespaces": {} + }, + "../model/src/-private/belongs-to.js": { + "name": "../model/src/-private/belongs-to.js", + "modules": {}, + "classes": {}, + "fors": { + "@ember-data/model": 1 + }, + "namespaces": {} + }, + "../model/src/-private/errors.ts": { + "name": "../model/src/-private/errors.ts", + "modules": {}, + "classes": { + "Errors": 1 + }, + "fors": {}, + "namespaces": {} + }, + "../model/src/-private/has-many.js": { + "name": "../model/src/-private/has-many.js", + "modules": {}, + "classes": {}, + "fors": { + "@ember-data/model": 1 + }, + "namespaces": {} + }, + "../model/src/-private/many-array.ts": { + "name": "../model/src/-private/many-array.ts", + "modules": {}, + "classes": { + "ManyArray": 1 + }, + "fors": {}, + "namespaces": {} + }, + "../model/src/-private/model.js": { + "name": "../model/src/-private/model.js", + "modules": {}, + "classes": { + "Model": 1 + }, + "fors": { + "Model": 1 + }, + "namespaces": {} + }, + "../model/src/-private/promise-belongs-to.ts": { + "name": "../model/src/-private/promise-belongs-to.ts", + "modules": {}, + "classes": { + "PromiseBelongsTo": 1 + }, + "fors": {}, + "namespaces": {} + }, + "../model/src/-private/promise-many-array.ts": { + "name": "../model/src/-private/promise-many-array.ts", + "modules": {}, + "classes": { + "PromiseManyArray": 1 + }, + "fors": {}, + "namespaces": {} + }, + "../model/src/-private/record-state.ts": { + "name": "../model/src/-private/record-state.ts", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "../model/src/index.ts": { + "name": "../model/src/index.ts", + "modules": { + "@ember-data/model": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "../private-build-infra/virtual-packages/canary-features.js": { + "name": "../private-build-infra/virtual-packages/canary-features.js", + "modules": { + "@ember-data/canary-features": 1 + }, + "classes": { + "CanaryFeatureFlags": 1 + }, + "fors": {}, + "namespaces": {} + }, + "../private-build-infra/virtual-packages/debugging.js": { + "name": "../private-build-infra/virtual-packages/debugging.js", + "modules": {}, + "classes": { + "DebugLogging": 1 + }, + "fors": {}, + "namespaces": {} + }, + "../private-build-infra/virtual-packages/deprecations.js": { + "name": "../private-build-infra/virtual-packages/deprecations.js", + "modules": { + "@ember-data/deprecations": 1 + }, + "classes": { + "CurrentDeprecations": 1 + }, + "fors": {}, + "namespaces": {} + }, + "../request-utils/src/index.ts": { + "name": "../request-utils/src/index.ts", + "modules": { + "@ember-data/request-utils": 1 + }, + "classes": { + "LifetimesService": 1 + }, + "fors": { + "@ember-data/request-utils": 1 + }, + "namespaces": {} + }, + "../request/src/-private/manager.ts": { + "name": "../request/src/-private/manager.ts", + "modules": { + "@ember-data/request": 1 + }, + "classes": { + "RequestManager": 1 + }, + "fors": {}, + "namespaces": {} + }, + "../request/src/-private/types.ts": { + "name": "../request/src/-private/types.ts", + "modules": {}, + "classes": { + "Future": 1, + " Handler": 1 + }, + "fors": {}, + "namespaces": {} + }, + "../request/src/fetch.ts": { + "name": "../request/src/fetch.ts", + "modules": { + "@ember-data/request/fetch": 1 + }, + "classes": { + "Fetch": 1 + }, + "fors": {}, + "namespaces": {} + }, + "../rest/src/-private/builders/find-record.ts": { + "name": "../rest/src/-private/builders/find-record.ts", + "modules": {}, + "classes": {}, + "fors": { + "@ember-data/rest/request": 1 + }, + "namespaces": {} + }, + "../rest/src/-private/builders/query.ts": { + "name": "../rest/src/-private/builders/query.ts", + "modules": {}, + "classes": {}, + "fors": { + "@ember-data/rest/request": 1 + }, + "namespaces": {} + }, + "../rest/src/-private/builders/save-record.ts": { + "name": "../rest/src/-private/builders/save-record.ts", + "modules": {}, + "classes": {}, + "fors": { + "@ember-data/rest/request": 1 + }, + "namespaces": {} + }, + "../rest/src/request.ts": { + "name": "../rest/src/request.ts", + "modules": { + "@ember-data/rest/request": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "../serializer/src/-private/transforms/boolean.js": { + "name": "../serializer/src/-private/transforms/boolean.js", + "modules": {}, + "classes": { + "BooleanTransform": 1 + }, + "fors": {}, + "namespaces": {} + }, + "../serializer/src/-private/transforms/date.js": { + "name": "../serializer/src/-private/transforms/date.js", + "modules": {}, + "classes": { + "DateTransform": 1 + }, + "fors": {}, + "namespaces": {} + }, + "../serializer/src/-private/transforms/number.js": { + "name": "../serializer/src/-private/transforms/number.js", + "modules": {}, + "classes": { + "NumberTransform": 1 + }, + "fors": {}, + "namespaces": {} + }, + "../serializer/src/-private/transforms/string.js": { + "name": "../serializer/src/-private/transforms/string.js", + "modules": {}, + "classes": { + "StringTransform": 1 + }, + "fors": {}, + "namespaces": {} + }, + "../serializer/src/-private/transforms/transform.js": { + "name": "../serializer/src/-private/transforms/transform.js", + "modules": {}, + "classes": { + "Transform": 1 + }, + "fors": {}, + "namespaces": {} + }, + "../serializer/src/-private/embedded-records-mixin.js": { + "name": "../serializer/src/-private/embedded-records-mixin.js", + "modules": {}, + "classes": { + "EmbeddedRecordsMixin": 1 + }, + "fors": {}, + "namespaces": {} + }, + "../serializer/src/-private.ts": { + "name": "../serializer/src/-private.ts", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "../serializer/src/index.ts": { + "name": "../serializer/src/index.ts", + "modules": { + "@ember-data/serializer": 1 + }, + "classes": { + "Serializer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "../serializer/src/json-api.js": { + "name": "../serializer/src/json-api.js", + "modules": { + "@ember-data/serializer/json-api": 1 + }, + "classes": { + "JSONAPISerializer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "../serializer/src/json.js": { + "name": "../serializer/src/json.js", + "modules": { + "@ember-data/serializer/json": 1 + }, + "classes": { + "JSONSerializer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "../serializer/src/rest.js": { + "name": "../serializer/src/rest.js", + "modules": { + "@ember-data/serializer/rest": 1 + }, + "classes": { + "RESTSerializer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "../serializer/src/transform.ts": { + "name": "../serializer/src/transform.ts", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "../store/src/-private/caches/identifier-cache.ts": { + "name": "../store/src/-private/caches/identifier-cache.ts", + "modules": {}, + "classes": { + "IdentifierCache": 1 + }, + "fors": {}, + "namespaces": {} + }, + "../store/src/-private/caches/instance-cache.ts": { + "name": "../store/src/-private/caches/instance-cache.ts", + "modules": {}, + "classes": {}, + "fors": { + "@ember-data/store": 1 + }, + "namespaces": {} + }, + "../store/src/-private/legacy-model-support/record-reference.ts": { + "name": "../store/src/-private/legacy-model-support/record-reference.ts", + "modules": {}, + "classes": { + "RecordReference": 1 + }, + "fors": {}, + "namespaces": {} + }, + "../store/src/-private/managers/cache-capabilities-manager.ts": { + "name": "../store/src/-private/managers/cache-capabilities-manager.ts", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "../store/src/-private/managers/cache-manager.ts": { + "name": "../store/src/-private/managers/cache-manager.ts", + "modules": {}, + "classes": { + "CacheManager": 1 + }, + "fors": {}, + "namespaces": {} + }, + "../store/src/-private/managers/notification-manager.ts": { + "name": "../store/src/-private/managers/notification-manager.ts", + "modules": {}, + "classes": { + "NotificationManager": 1 + }, + "fors": {}, + "namespaces": {} + }, + "../store/src/-private/managers/record-array-manager.ts": { + "name": "../store/src/-private/managers/record-array-manager.ts", + "modules": {}, + "classes": { + "RecordArrayManager": 1 + }, + "fors": {}, + "namespaces": {} + }, + "../store/src/-private/network/request-cache.ts": { + "name": "../store/src/-private/network/request-cache.ts", + "modules": {}, + "classes": { + "RequestStateService": 1 + }, + "fors": {}, + "namespaces": {} + }, + "../store/src/-private/record-arrays/identifier-array.ts": { + "name": "../store/src/-private/record-arrays/identifier-array.ts", + "modules": {}, + "classes": { + "RecordArray": 1 + }, + "fors": {}, + "namespaces": {} + }, + "../store/src/-private/utils/coerce-id.ts": { + "name": "../store/src/-private/utils/coerce-id.ts", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "../store/src/-private/utils/uuid-polyfill.ts": { + "name": "../store/src/-private/utils/uuid-polyfill.ts", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "../store/src/-private/index.ts": { + "name": "../store/src/-private/index.ts", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "../store/src/-private/store-service.ts": { + "name": "../store/src/-private/store-service.ts", + "modules": {}, + "classes": { + "Store": 1 + }, + "fors": {}, + "namespaces": {} + }, + "../store/src/index.ts": { + "name": "../store/src/index.ts", + "modules": { + "@ember-data/store": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "../tracking/src/-private.ts": { + "name": "../tracking/src/-private.ts", + "modules": { + "@ember-data/tracking": 1 + }, + "classes": {}, + "fors": { + "@ember-data/tracking": 1 + }, + "namespaces": {} + } + }, + "modules": { + "@ember-data/experimental-preview-types": { + "name": "@ember-data/experimental-preview-types", + "submodules": {}, + "elements": {}, + "classes": { + " Cache": 1, + " Adapter": 1, + " Serializer": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "main", + "file": "../../ember-data-types/q/minimum-serializer-interface.ts", + "line": 26, + "description": "Many parts of EmberData are interface-driven,\nmeaning that no specific base-class is necessary\nto implement an interopable module of your own\nutilizing only public APIs.\n\nExamples of primitives in EmberData that are interface-driven\ninclude Adapters, Serializers, Request Handlers, and the Cache.\n\nThese **Not Yet Installable** Typescript Types\nDocument key interfaces that libraries and\napplications interfacing with EmberData would need\nto conform to.", + "itemtype": "main" + }, + "@ember-data/store": { + "name": "@ember-data/store", + "submodules": {}, + "elements": {}, + "classes": { + "CacheCapabilitiesManager": 1, + "StableRecordIdentifier": 1, + "@ember-data/store": 1, + "SchemaService": 1, + "Snapshot": 1, + "ManyArray": 1, + "IdentifierCache": 1, + "RecordReference": 1, + "CacheManager": 1, + "NotificationManager": 1, + "RequestStateService": 1, + "RecordArray": 1, + "Store": 1 + }, + "fors": { + "@ember-data/store": 1 + }, + "namespaces": {}, + "tag": "main", + "file": "../store/src/-private/store-service.ts", + "line": 71, + "description": "

\n \n

\n\nThis package provides [*Ember***Data**](https://github.com/emberjs/data/)'s `Store` class.\n\nA [Store](https://api.emberjs.com/ember-data/release/classes/Store) coordinates interaction between your application, a [Cache](https://api.emberjs.com/ember-data/release/classes/%3CInterface%3E%20Cache),\nand sources of data (such as your API or a local persistence layer) accessed via a [RequestManager](https://github.com/emberjs/data/tree/main/packages/request).\n\nOptionally, a Store can be configured to hydrate the response data into rich presentation classes.\n\n## Installation\n\nIf you have installed `ember-data` then you already have this package installed.\nOtherwise you can install it using your javascript package manager of choice.\nFor instance with [pnpm](https://pnpm.io/)\n\n```\npnpm add @ember-data/store\n```\n\nAfter installing you will want to configure your first `Store`. Read more below\nfor how to create and configure stores for your application.\n\n\n## 🔨 Creating A Store\n\nTo use a `Store` we will need to do few things: add a [Cache](https://api.emberjs.com/ember-data/release/classes/%3CInterface%3E%20Cache)\nto store data **in-memory**, add a [Handler](https://api.emberjs.com/ember-data/release/classes/%3CInterface%3E%20Cache) to fetch data from a source,\nand implement `instantiateRecord` to tell the store how to display the data for individual resources.\n\n> **Note** If you are using the package `ember-data` then a JSON:API cache, RequestManager, LegacyNetworkHandler,\n> and `instantiateRecord` are configured for you by default.\n\n### Configuring A Cache\n\nTo start, let's install a [JSON:API](https://jsonapi.org/) cache. If your app uses `GraphQL` or `REST` other\ncaches may better fit your data. You can author your own cache by creating one that\nconforms to the [spec](https://api.emberjs.com/ember-data/release/classes/%3CInterface%3E%20Cache).\n\nThe package `@ember-data/json-api` provides a [JSON:API](https://jsonapi.org/) cache we can use.\nAfter installing it, we can configure the store to use this cache.\n\n```js\nimport Store from '@ember-data/store';\nimport Cache from '@ember-data/json-api';\n\nclass extends Store {\n createCache(storeWrapper) {\n return new Cache(storeWrapper);\n }\n}\n```\n\nNow that we have a `cache` let's setup something to handle fetching\nand saving data via our API.\n\n> **Note** The `ember-data` package automatically includes and configures\n> the `@ember-data/json-api` cache for you.\n\n### Handling Requests\n\nWhen *Ember***Data** needs to fetch or save data it will pass that request to your application's `RequestManager` for fulfillment. How this fulfillment occurs (in-memory, device storage, via single or multiple API requests, etc.) is then up to the registered request handlers.\n\nTo start, let's install the `RequestManager` from `@ember-data/request` and the basic `Fetch` handler from ``@ember-data/request/fetch`.\n\n> **Note** If your app uses `GraphQL`, `REST` or different conventions for `JSON:API` than your cache expects, other handlers may better fit your data. You can author your own handler by creating one that conforms to the [handler interface](https://github.com/emberjs/data/tree/main/packages/request#handling-requests).\n\n```ts\nimport Store from '@ember-data/store';\nimport RequestManager from '@ember-data/request';\nimport Fetch from '@ember-data/request/fetch';\n\nexport default class extends Store {\n constructor() {\n super(...arguments);\n this.requestManager = new RequestManager();\n this.requestManager.use([Fetch]);\n }\n}\n```\n\n**Using RequestManager as a Service**\n\nAlternatively if you have configured the `RequestManager` to be a service you may re-use it.\n\n*app/services/request.js*\n```ts\nimport RequestManager from '@ember-data/request';\nimport Fetch from '@ember-data/request/fetch';\n\nexport default class extends RequestManager {\n constructor(createArgs) {\n super(createArgs);\n this.use([Fetch]);\n }\n}\n```\n\n*app/services/store.js*\n```ts\nimport Store from '@ember-data/store';\nimport { service } from '@ember/service';\n\nexport default class extends Store {", + "service": "('request') requestManager\n}\n```\n\n\n### Presenting Data from the Cache\n\nNow that we have a source and a cach for our data, we need to configure how\nthe Store delivers that data back to our application. We do this via the hook\n[instantiateRecord](https://api.emberjs.com/ember-data/release/classes/Store/methods/instantiateRecord%20(hook)?anchor=instantiateRecord%20(hook)),\nwhich allows us to transform the data for a resource before handing it to the application.\n\nA naive way to present the data would be to return it as JSON. Typically instead\nthis hook will be used to add reactivity and make each unique resource a singleton,\nensuring that if the cache updates our presented data will reflect the new state.\n\nBelow is an example of using the hooks `instantiateRecord` and a `teardownRecord`\nto provide minimal read-only reactive state for simple resources.\n\n```ts\nimport Store, { recordIdentifierFor } from '@ember-data/store';\nimport { TrackedObject } from 'tracked-built-ins';\n\nclass extends Store {\n instantiateRecord(identifier) {\n const { cache, notifications } = this;\n\n // create a TrackedObject with our attributes, id and type\n const record = new TrackedObject(Object.assign({}, cache.peek(identifier)));\n record.type = identifier.type;\n record.id = identifier.id;\n\n notifications.subscribe(identifier, (_, change) => {\n if (change === 'attributes') {\n Object.assign(record, cache.peek(identifier));\n }\n });\n\n return record;\n }\n}\n```\n\nBecause `instantiateRecord` is opaque to the nature of the record, an implementation\ncan be anything from a fairly simple object to a robust proxy that intelligently links\ntogether associated records through relationships.\n\nThis also enables creating a record that separates `edit` flows from `create` flows\nentirely. A record class might choose to implement a `checkout`method that gives access\nto an editable instance while the primary record continues to be read-only and reflect\nonly persisted (non-mutated) state.\n\nTypically you will choose an existing record implementation such as `@ember-data/model`\nfor your application.\n\nBecause of the boundaries around instantiation and the cache, record implementations\nshould be capable of interop both with each other and with any `Cache`. Due to this,\nif needed an application can utilize multiple record implementations and multiple cache\nimplementations either to support enhanced features for only a subset of records or to\nbe able to incrementally migrate from one record/cache to another record or cache.\n\n> **Note:** The `ember-data` package automatically includes the `@ember-data/model`\n> package and configures it for you.", + "itemtype": "main" + }, + "ember-data-overview": { + "name": "ember-data-overview", + "submodules": {}, + "elements": {}, + "classes": {}, + "fors": {}, + "namespaces": {}, + "tag": "main", + "file": "../-ember-data/addon/index.js", + "line": 1, + "description": "

\n \n

\n\n

The lightweight reactive data library for JavaScript applications

\n\n---\n\nWrangle your application's data management with scalable patterns for developer productivity.\n\n- ⚡️ Committed to Best-In-Class Performance\n- 🌲 Focused on being as svelte as possible\n- 🚀 SSR Ready\n- 🔜 Typescript Support\n- 🐹 Built with ♥️ by [Ember](https://emberjs.com)\n- ⚛️ Supports any API: `GraphQL` `JSON:API` `REST` `tRPC` ...bespoke or a mix\n\n### 📖 On This Page\n\n- [Overview](./#overview)\n - [Architecture](#🪜-architecture)\n - [Basic Installation](#basic-installation)\n - [Advanced Installation](#advanced-installation)\n- [Configuration](#configuration)\n - [Deprecation Stripping](#deprecation-stripping)\n - [randomUUID polyfill](#randomuuid-polyfill)\n - [Removing inspector support in production](#removing-inspector-support-in-production)\n - [Debugging](#debugging)\n\n\n# Overview\n\n*Ember*‍**Data** is a lightweight reactive data library for JavaScript applications that provides composable primitives for ordering query/mutation/peek flows, managing network and cache, and reducing data for presentation.\n\n## 🪜 Architecture\n\nThe core of *Ember*‍**Data** is the `Store`, which coordinates interaction between your application, the `Cache`, and sources of data (such as your `API` or a local persistence layer).\nOptionally, the Store can be configured to hydrate the response data into rich presentation classes.\n\n*Ember*‍**Data** is both resource centric and document centric in it's approach to caching, requesting and presenting data. Your application's configuration and usage drives which is important and when.\n\nThe `Store` is a **coordinator**. When using a `Store` you configure what cache to use, how cache data should be presented to the UI, and where it should look for requested data when it is not available in the cache.\n\nThis coordination is handled opaquely to the nature of the requests issued and the format of the data being handled. This approach gives applications broad flexibility to configure *Ember*‍**Data** to best suite their needs. This makes *Ember*‍**Data** a powerful solution for applications regardless of their size and complexity.\n\n*Ember*‍**Data** is designed to scale, with a religious focus on performance and asset-size to keep its footprint small but speedy while still being able to handle large complex APIs in huge data-driven applications with no additional code and no added application complexity. It's goal is to prevent applications from writing code to manage data that is difficult to maintain or reason about.\n\n*Ember*‍**Data**'s power comes not from specific features, data formats, or adherence to specific API specs such as `JSON:API` `trpc` or `GraphQL`, but from solid conventions around requesting and mutating data developed over decades of experience scaling developer productivity.\n\n## Basic Installation\n\nInstall using your javascript package manager of choice. For instance with [pnpm](https://pnpm.io/)\n\n```no-highlight\npnpm add ember-data\n```\n\n`ember-data` is installed by default for new applications generated with `ember-cli`. You can check what version is installed by looking in the `devDependencies` hash of your project's [package.json](https://docs.npmjs.com/cli/v8/configuring-npm/package-json) file.\n\nIf you have generated a new `Ember` application using `ember-cli` but do\nnot wish to use `ember-data`, remove `ember-data` from your project's `package.json` file and run your package manager's install command to update your lockfile.\n\n## Advanced Installation\n\n*Ember*‍**Data** is organized into primitives that compose together via public APIs.\n\n- [@ember-data/store](/ember-data/release/modules/@ember-data%2Fstore) is the core and handles coordination\n- [@ember-data/json-api](/ember-data/release/modules/@ember-data%2Fjson-api) provides a resource cache for JSON:API structured data. It integrates with the store via the hook `createCache`\n- [@ember-data/model](/ember-data/release/modules/@ember-data%2Fmodel) is a presentation layer, it integrates with the store via the hooks `instantiateRecord` and `teardownRecord`.\n- [@ember-data/adapter](/ember-data/release/modules/@ember-data%2Fadapter) provides various network API integrations for APIS built over specific REST or JSON:API conventions.\n- [@ember-data/serializer](/ember-data/release/modules/@ember-data%2Fserializer) pairs with `@ember-data/adapter` to normalize and serialize data to and from an API format into the `JSON:API` format understood by `@ember-data/json-api`.\n- [@ember-data/debug](/ember-data/release/modules/@ember-data%2Fdebug) provides debugging support for the `ember-inspector`.\n- **ember-data** is a \"meta\" package which bundles all of these together for convenience\n\nThe packages interop with each other through well defined public API boundaries. The core\nof the library is the store provided by `@ember-data/store`, while each of the other libraries plugs into the store when installed. Because these packages interop via fully\npublic APIs, other libraries or applications may provide their own implementations. For instance, [ember-m3](https://github.com/hjdivad/ember-m3) is a commonly used presentation and cache implementation suitable for complex resource objects and graphs.\n\n## Configuration\n\n### Deprecation Stripping\n\n*Ember*‍**Data** allows users to opt-in and remove code that exists to support deprecated behaviors.\n\nIf your app has resolved all deprecations present in a given version, you may specify that version as your \"compatibility\" version to remove the code that supported the deprecated behavior from your app.\n\n```ts\nlet app = new EmberApp(defaults, {\n emberData: {\n compatWith: '4.8',\n },\n});\n```\n\n- [Full Documentation](https://api.emberjs.com/ember-data/release/modules/@ember-data%2Fdeprecations)\n\n### randomUUID polyfill\n\n*Ember*‍**Data** uses `UUID V4` by default to generate identifiers for new data created on the client. Identifier generation is configurable, but we also for convenience will polyfill\nthe necessary feature if your browser support or deployment environment demands it. To\nactivate this polyfill:\n\n```ts\nlet app = new EmberApp(defaults, {\n '@embroider/macros': {\n setConfig: {\n '@ember-data/store': {\n polyfillUUID: true\n },\n },\n },\n});\n```\n\n### removing inspector support in production\n\nIf you do not with to ship inspector support in your production application, you can specify\nthat all support for it should be stripped from the build.\n\n```ts\nlet app = new EmberApp(defaults, {\n emberData: {\n includeDataAdapterInProduction: false\n }\n});\n```\n\n- [Full Documentation](https://api.emberjs.com/ember-data/release/modules/@ember-data%2Fdebug)\n\n### Debugging\n\nMany portions of the internals are helpfully instrumented with logging that can be activated\nat build time. This instrumentation is always removed from production builds or any builds\nthat has not explicitly activated it. To activate it set the appropriate flag to `true`.\n\n```ts\n let app = new EmberApp(defaults, {\n emberData: {\n debug: {\n LOG_PAYLOADS: false, // data store received to update cache with\n LOG_OPERATIONS: false, // updates to cache remote state\n LOG_MUTATIONS: false, // updates to cache local state\n LOG_NOTIFICATIONS: false,\n LOG_REQUESTS: false, // log Requests issued via the request manager\n LOG_REQUEST_STATUS: false,\n LOG_IDENTIFIERS: false,\n LOG_GRAPH: false,\n LOG_INSTANCE_CACHE: false,\n }\n }\n });\n ```", + "itemtype": "main" + }, + "@ember-data/active-record/request": { + "name": "@ember-data/active-record/request", + "submodules": {}, + "elements": {}, + "classes": { + "@ember-data/active-record/request": 1 + }, + "fors": { + "@ember-data/active-record/request": 1 + }, + "namespaces": {}, + "tag": "main", + "file": "../active-record/src/request.ts", + "line": 1, + "description": "

\n \n

\n\nThis package provides utilities for working with [ActiveRecord](https://guides.rubyonrails.org/active_record_basics.html#convention-over-configuration-in-active-record) APIs with [*Ember***Data**](https://github.com/emberjs/data/).\n\n## Installation\n\nInstall using your javascript package manager of choice. For instance with [pnpm](https://pnpm.io/)\n\n```no-highlight\npnpm add @ember-data/active-record\n```\n\n## Usage\n\nRequest builders are functions that produce [Fetch Options](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API).\nThey take a few contextual inputs about the request you want to make, abstracting away the gnarlier details.\n\nFor instance, to fetch a resource from your API\n\n```ts\nimport { findRecord } from '@ember-data/active-record/request';\n\nconst options = findRecord('ember-developer', '1', { include: ['pets', 'friends'] });\n\n/\\*\n => {\n url: 'https://api.example.com/v1/ember_developers/1?include=friends,pets',\n method: 'GET',\n headers: , // 'Content-Type': 'application/json; charset=utf-8'\n op: 'findRecord';\n records: [{ type: 'ember-developer', id: '1' }]\n }\n\\/\n```\n\nRequest builder output may be used with either `requestManager.request` or `store.request`.\n\nURLs are stable. The same query will produce the same URL every time, even if the order of keys in\nthe query or values in an array changes.\n\nURLs follow the most common ActiveRecord format (underscored pluralized resource types).\n\n### Available Builders\n\n- [createRecord](https://api.emberjs.com/ember-data/release/functions/@ember-data%2Factive-record/createRecord)\n- [deleteRecord](https://api.emberjs.com/ember-data/release/functions/@ember-data%2Factive-record/deleteRecord)\n- [findRecord](https://api.emberjs.com/ember-data/release/functions/@ember-data%2Factive-record/findRecord)\n- [query](https://api.emberjs.com/ember-data/release/functions/@ember-data%2Factive-record/query)\n- [updateRecord](https://api.emberjs.com/ember-data/release/functions/@ember-data%2Factive-record/updateRecord)", + "itemtype": "main" + }, + "@ember-data/adapter": { + "name": "@ember-data/adapter", + "submodules": {}, + "elements": {}, + "classes": { + "BuildURLMixin": 1, + "Adapter": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "main", + "file": "../adapter/src/index.ts", + "line": 197, + "description": "## Overview\n\n
\n

\n ⚠️ This is LEGACY documentation for a feature that is no longer encouraged to be used.\n If starting a new app or thinking of implementing a new adapter, consider writing a\n Handler instead to be used with the RequestManager\n

\n
\n\nIn order to properly fetch and update data, EmberData\nneeds to understand how to connect to your API.\n\n`Adapters` accept various kinds of requests from the store\nand manage fulfillment of the request from your API.\n\n### Request Flow\n\nWhen the store decides it needs to issue a request it uses the\nfollowing flow to manage the request and process the data.\n\n- find the appropriate adapter\n- issue the request to the adapter\n- await the adapter's response\n - if an error occurs reject with the error\n - if no error\n - if there is response data\n - pass the response data to the appropriate serializer\n - update the cache using the JSON:API formatted data from the serializer's response\n - return the primary record(s) associated with the request\n\n### Request Errors\n\nWhen a request errors and your adapter does not have the ability to recover from the error,\nyou may either reject the promise returned by your adapter method with the error or simply\nthrow the error.\n\nIf the request was for a `createRecord` `updateRecord` or `deleteRecord` special rules\napply to how this error will affect the state of the store and additional properties on\nthe `Error` class may be used. See the documentation for these methods in\n[ Adapter](/ember-data/release/classes/%3CInterface%3E%20Adapter) for more information.\n\n### Implementing an Adapter\n\nThere are seven required adapter methods, one for each of\nthe primary request types that EmberData issues.\n\nThey are:\n\n- findRecord\n- findAll\n- queryRecord\n- query\n- createRecord\n- updateRecord\n- deleteRecord\n\nEach of these request types has a matching store method that triggers it\nand matching `requestType` that is passed to the serializer's\n`normalizeResponse` method.\n\nIf your app only reads data but never writes data, it is not necessary\nto implement the methods for create, update, and delete. This extends to\nall of the store's find methods with the exception of `findRecord` (`findAll`,\n`query`, `queryRecord`): if you do not use the store method in your app then\nyour Adapter does not need the method.\n\n```ts\nimport EmberObject from '@ember/object';\n\nasync function fetchData(url, options = {}) {\n let response = await fetch(url, options);\n return response.toJSON();\n}\n\nexport default class ApplicationAdapter extends EmberObject {\n findRecord(_, { modelName }, id) {\n return fetchData(`./${modelName}s/${id}`);\n }\n}\n```\n\n### Adapter Resolution\n\n`store.adapterFor(name)` will lookup adapters defined in `app/adapters/` and\nreturn an instance.\n\n`adapterFor` first attempts to find an adapter with an exact match on `name`,\nthen falls back to checking for the presence of an adapter named `application`.\n\nIf no adapter is found, an error will be thrown.\n\n```ts\nstore.adapterFor('author');\n\n// lookup paths (in order) =>\n// app/adapters/author.js\n// app/adapters/application.js\n```\n\nMost requests in EmberData are made with respect to a particular `type` (or `modelName`)\n(e.g., \"get me the full collection of **books**\" or \"get me the **employee** whose id is 37\"). We\nrefer to this as the **primary** resource `type`.\n\n`adapterFor` is used by the store to find an adapter with a name matching that of the primary\nresource `type` for the request, which then falls back to the `application` adapter.\n\nIt is recommended that applications define only a single `application` adapter and serializer\nwhere possible, only implementing an adapter specific to the `type` when absolutely necessary.\n\nIf you need to support multiple API versions for the same type, the per-type strategy for\ndefining adapters might not be adequate.\n\nIf you have multiple APIs or multiple API versions and the single application adapter and per-type\nstrategy does not suite your needs, one strategy is to write an `application` adapter and serializer\nthat make use of `options` to specify the desired format when making a request, then forwards to the\nrequest to the desired adapter or serializer as needed.\n\n```app/adapters/application.js\nexport default class Adapter extends EmberObject {\n findRecord(store, schema, id, snapshot) {\n let { apiVersion } = snapshot.adapterOptions;\n return this.adapterFor(`-api-${apiVersion}`).findRecord(store, schema, id, snapshot);\n }\n}\n```\n\n### Overriding `Store.adapterFor`\n\n```js\nimport Store from '@ember-data/store';\nimport Adapter from '@ember-data/adapter/json-api';\n\nclass extends Store {\n #adapter = new Adapter();\n\n adapterFor() {\n return this.#adapter;\n }\n}\n```\n\n\nNote: If you are using Ember and would like to make use of `service` injections in your adapter, you will want to additionally `setOwner` for the Adapter.\n\n```js\nimport Store from '@ember-data/store';\nimport Adapter from '@ember-data/adapter/json-api';\nimport { getOwner, setOwner } from '@ember/application';\n\nclass extends Store {\n #adapter = null;\n\n adapterFor() {\n let adapter = this.#adapter;\n if (!adapter) {\n const owner = getOwner(this);\n adapter = new Adapter();\n setOwner(adapter, owner);\n this.#adapter = adapter;\n }\n\n return adapter;\n }\n}\n```\n\nBy default when using with Ember you only need to implement this hook if you want your adapter usage to be statically analyzeable. *Ember***Data** will attempt to resolve adapters using Ember's resolver. To provide a single Adapter for your application like the above you would provide it as the default export of the file `app/adapters/application.{js/ts}`\n\n### Using an Adapter\n\nAny adapter in `app/adapters/` can be looked up by `name` using `store.adapterFor(name)`.\n\n### Default Adapters\n\nApplications whose API's structure endpoint URLs *very close to* or *exactly* the **REST**\nor **JSON:API** convention, the `@ember-data/adapter` package contains implementations\nthese applications can extend.\n\nMany applications will find writing their own adapter to be allow greater flexibility,\ncustomization, and maintenance than attempting to override methods in these adapters.", + "itemtype": "main" + }, + "@ember-data/adapter/error": { + "name": "@ember-data/adapter/error", + "submodules": {}, + "elements": {}, + "classes": { + "AdapterError": 1, + "InvalidError": 1, + "TimeoutError": 1, + "AbortError": 1, + "UnauthorizedError": 1, + "ForbiddenError": 1, + "NotFoundError": 1, + "ConflictError": 1, + "ServerError": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "main", + "file": "../adapter/src/error.js", + "line": 332, + "description": "## Overview\n\n
\n

\n ⚠️ This is LEGACY documentation for a feature that is no longer encouraged to be used.\n If starting a new app or thinking of implementing a new adapter, consider writing a\n Handler instead to be used with the RequestManager\n

\n
\n\nAn `AdapterError` is used by an adapter to signal that an error occurred\nduring a request to an external API. It indicates a generic error, and\nsubclasses are used to indicate specific error states.\n\nTo create a custom error to signal a specific error state in communicating\nwith an external API, extend the `AdapterError`. For example, if the\nexternal API exclusively used HTTP `503 Service Unavailable` to indicate\nit was closed for maintenance:\n\n```app/adapters/maintenance-error.js\nimport AdapterError from '@ember-data/adapter/error';\n\nexport default AdapterError.extend({ message: \"Down for maintenance.\" });\n```\n\nThis error would then be returned by an adapter's `handleResponse` method:\n\n```app/adapters/application.js\nimport JSONAPIAdapter from '@ember-data/adapter/json-api';\nimport MaintenanceError from './maintenance-error';\n\nexport default class ApplicationAdapter extends JSONAPIAdapter {\n handleResponse(status) {\n if (503 === status) {\n return new MaintenanceError();\n }\n\n return super.handleResponse(...arguments);\n }\n}\n```\n\nAnd can then be detected in an application and used to send the user to an\n`under-maintenance` route:\n\n```app/routes/application.js\nimport Route from '@ember/routing/route';\nimport MaintenanceError from '../adapters/maintenance-error';\n\nexport default class ApplicationRoute extends Route {\n actions: {\n error(error, transition) {\n if (error instanceof MaintenanceError) {\n this.transitionTo('under-maintenance');\n return;\n }\n\n // ...other error handling logic\n }\n }\n}\n```", + "itemtype": "main" + }, + "@ember-data/adapter/json-api": { + "name": "@ember-data/adapter/json-api", + "submodules": {}, + "elements": {}, + "classes": { + "JSONAPIAdapter": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "main", + "file": "../adapter/src/json-api.ts", + "line": 19, + "description": "## Overview\n\n
\n

\n ⚠️ This is LEGACY documentation for a feature that is no longer encouraged to be used.\n If starting a new app or thinking of implementing a new adapter, consider writing a\n Handler instead to be used with the RequestManager\n

\n
\n\nThe `JSONAPIAdapter` is an adapter whichtransforms the store's\nrequests into HTTP requests that follow the [JSON API format](http://jsonapi.org/format/).\n\n## JSON API Conventions\n\nThe JSONAPIAdapter uses JSON API conventions for building the URL\nfor a record and selecting the HTTP verb to use with a request. The\nactions you can take on a record map onto the following URLs in the\nJSON API adapter:\n\n\n\n \n \n \n\n\n \n \n \n\n\n \n \n \n\n\n \n \n \n\n\n \n \n \n\n\n \n \n \n\n
\n Action\n \n HTTP Verb\n \n URL\n
\n `store.findRecord('post', 123)`\n \n GET\n \n /posts/123\n
\n `store.findAll('post')`\n \n GET\n \n /posts\n
\n Update `postRecord.save()`\n \n PATCH\n \n /posts/123\n
\n Create `store.createRecord('post').save()`\n \n POST\n \n /posts\n
\n Delete `postRecord.destroyRecord()`\n \n DELETE\n \n /posts/123\n
\n\n## Success and failure\n\nThe JSONAPIAdapter will consider a success any response with a\nstatus code of the 2xx family (\"Success\"), as well as 304 (\"Not\nModified\"). Any other status code will be considered a failure.\n\nOn success, the request promise will be resolved with the full\nresponse payload.\n\nFailed responses with status code 422 (\"Unprocessable Entity\") will\nbe considered \"invalid\". The response will be discarded, except for\nthe `errors` key. The request promise will be rejected with a\n`InvalidError`. This error object will encapsulate the saved\n`errors` value.\n\nAny other status codes will be treated as an adapter error. The\nrequest promise will be rejected, similarly to the invalid case,\nbut with an instance of `AdapterError` instead.\n\n### Endpoint path customization\n\nEndpoint paths can be prefixed with a `namespace` by setting the\nnamespace property on the adapter:\n\n```app/adapters/application.js\nimport JSONAPIAdapter from '@ember-data/adapter/json-api';\n\nexport default class ApplicationAdapter extends JSONAPIAdapter {\n namespace = 'api/1';\n}\n```\nRequests for the `person` model would now target `/api/1/people/1`.\n\n### Host customization\n\nAn adapter can target other hosts by setting the `host` property.\n\n```app/adapters/application.js\nimport JSONAPIAdapter from '@ember-data/adapter/json-api';\n\nexport default class ApplicationAdapter extends JSONAPIAdapter {\n host = 'https://api.example.com';\n}\n```\n\nRequests for the `person` model would now target\n`https://api.example.com/people/1`.", + "since": "1.13.0", + "itemtype": "main" + }, + "@ember-data/adapter/rest": { + "name": "@ember-data/adapter/rest", + "submodules": {}, + "elements": {}, + "classes": { + "RESTAdapter": 1, + "@ember-data/adapter/rest": 1 + }, + "fors": { + "@ember-data/adapter/rest": 1 + }, + "namespaces": {}, + "tag": "main", + "file": "../adapter/src/rest.ts", + "line": 69, + "description": "
\n

\n ⚠️ This is LEGACY documentation for a feature that is no longer encouraged to be used.\n If starting a new app or thinking of implementing a new adapter, consider writing a\n Handler instead to be used with the RequestManager\n

\n
\n\n The REST adapter allows your store to communicate with an HTTP server by\n transmitting JSON via XHR.\n\n This adapter is designed around the idea that the JSON exchanged with\n the server should be conventional. It builds URLs in a manner that follows\n the structure of most common REST-style web services.\n\n ## Success and failure\n\n The REST adapter will consider a success any response with a status code\n of the 2xx family (\"Success\"), as well as 304 (\"Not Modified\"). Any other\n status code will be considered a failure.\n\n On success, the request promise will be resolved with the full response\n payload.\n\n Failed responses with status code 422 (\"Unprocessable Entity\") will be\n considered \"invalid\". The response will be discarded, except for the\n `errors` key. The request promise will be rejected with a `InvalidError`.\n This error object will encapsulate the saved `errors` value.\n\n Any other status codes will be treated as an \"adapter error\". The request\n promise will be rejected, similarly to the \"invalid\" case, but with\n an instance of `AdapterError` instead.\n\n ## JSON Structure\n\n The REST adapter expects the JSON returned from your server to follow\n these conventions.\n\n ### Object Root\n\n The JSON payload should be an object that contains the record inside a\n root property. For example, in response to a `GET` request for\n `/posts/1`, the JSON should look like this:\n\n ```js\n {\n \"posts\": {\n \"id\": 1,\n \"title\": \"I'm Running to Reform the W3C's Tag\",\n \"author\": \"Yehuda Katz\"\n }\n }\n ```\n\n Similarly, in response to a `GET` request for `/posts`, the JSON should\n look like this:\n\n ```js\n {\n \"posts\": [\n {\n \"id\": 1,\n \"title\": \"I'm Running to Reform the W3C's Tag\",\n \"author\": \"Yehuda Katz\"\n },\n {\n \"id\": 2,\n \"title\": \"Rails is omakase\",\n \"author\": \"D2H\"\n }\n ]\n }\n ```\n\n Note that the object root can be pluralized for both a single-object response\n and an array response: the REST adapter is not strict on this. Further, if the\n HTTP server responds to a `GET` request to `/posts/1` (e.g. the response to a\n `findRecord` query) with more than one object in the array, Ember Data will\n only display the object with the matching ID.\n\n ### Conventional Names\n\n Attribute names in your JSON payload should be the camelCased versions of\n the attributes in your Ember.js models.\n\n For example, if you have a `Person` model:\n\n ```app/models/person.js\n import Model, { attr } from '@ember-data/model';\n\n export default Model.extend({\n firstName: attr('string'),\n lastName: attr('string'),\n occupation: attr('string')\n });\n ```\n\n The JSON returned should look like this:\n\n ```js\n {\n \"people\": {\n \"id\": 5,\n \"firstName\": \"Zaphod\",\n \"lastName\": \"Beeblebrox\",\n \"occupation\": \"President\"\n }\n }\n ```\n\n #### Relationships\n\n Relationships are usually represented by ids to the record in the\n relationship. The related records can then be sideloaded in the\n response under a key for the type.\n\n ```js\n {\n \"posts\": {\n \"id\": 5,\n \"title\": \"I'm Running to Reform the W3C's Tag\",\n \"author\": \"Yehuda Katz\",\n \"comments\": [1, 2]\n },\n \"comments\": [{\n \"id\": 1,\n \"author\": \"User 1\",\n \"message\": \"First!\",\n }, {\n \"id\": 2,\n \"author\": \"User 2\",\n \"message\": \"Good Luck!\",\n }]\n }\n ```\n\n If the records in the relationship are not known when the response\n is serialized it's also possible to represent the relationship as a\n URL using the `links` key in the response. Ember Data will fetch\n this URL to resolve the relationship when it is accessed for the\n first time.\n\n ```js\n {\n \"posts\": {\n \"id\": 5,\n \"title\": \"I'm Running to Reform the W3C's Tag\",\n \"author\": \"Yehuda Katz\",\n \"links\": {\n \"comments\": \"/posts/5/comments\"\n }\n }\n }\n ```\n\n ### Errors\n\n If a response is considered a failure, the JSON payload is expected to include\n a top-level key `errors`, detailing any specific issues. For example:\n\n ```js\n {\n \"errors\": {\n \"msg\": \"Something went wrong\"\n }\n }\n ```\n\n This adapter does not make any assumptions as to the format of the `errors`\n object. It will simply be passed along as is, wrapped in an instance\n of `InvalidError` or `AdapterError`. The serializer can interpret it\n afterwards.\n\n ## Customization\n\n ### Endpoint path customization\n\n Endpoint paths can be prefixed with a `namespace` by setting the namespace\n property on the adapter:\n\n ```app/adapters/application.js\n import RESTAdapter from '@ember-data/adapter/rest';\n\n export default class ApplicationAdapter extends RESTAdapter {\n namespace = 'api/1';\n }\n ```\n Requests for the `Person` model would now target `/api/1/people/1`.\n\n ### Host customization\n\n An adapter can target other hosts by setting the `host` property.\n\n ```app/adapters/application.js\n import RESTAdapter from '@ember-data/adapter/rest';\n\n export default class ApplicationAdapter extends RESTAdapter {\n host = 'https://api.example.com';\n }\n ```\n\n ### Headers customization\n\n Some APIs require HTTP headers, e.g. to provide an API key. Arbitrary\n headers can be set as key/value pairs on the `RESTAdapter`'s `headers`\n object and Ember Data will send them along with each ajax request.\n\n\n ```app/adapters/application.js\n import RESTAdapter from '@ember-data/adapter/rest';\n import { computed } from '@ember/object';\n\n export default class ApplicationAdapter extends RESTAdapter {\n headers: computed(function() {\n return {\n 'API_KEY': 'secret key',\n 'ANOTHER_HEADER': 'Some header value'\n };\n }\n }\n ```\n\n `headers` can also be used as a computed property to support dynamic\n headers. In the example below, the `session` object has been\n injected into an adapter by Ember's container.\n\n ```app/adapters/application.js\n import RESTAdapter from '@ember-data/adapter/rest';\n import { computed } from '@ember/object';\n\n export default class ApplicationAdapter extends RESTAdapter {\n headers: computed('session.authToken', function() {\n return {\n 'API_KEY': this.session.authToken,\n 'ANOTHER_HEADER': 'Some header value'\n };\n })\n }\n ```\n\n In some cases, your dynamic headers may require data from some\n object outside of Ember's observer system (for example\n `document.cookie`). You can use the\n [volatile](/api/classes/Ember.ComputedProperty.html?anchor=volatile)\n function to set the property into a non-cached mode causing the headers to\n be recomputed with every request.\n\n ```app/adapters/application.js\n import RESTAdapter from '@ember-data/adapter/rest';\n import { computed } from '@ember/object';\n\n export default class ApplicationAdapter extends RESTAdapter {\n headers: computed(function() {\n return {\n 'API_KEY': document.cookie.match(/apiKey\\=([^;]*)/)['1'],\n 'ANOTHER_HEADER': 'Some header value'\n };\n }).volatile()\n }\n ```", + "itemtype": "main" + }, + "@ember-data/debug": { + "name": "@ember-data/debug", + "submodules": {}, + "elements": {}, + "classes": { + "InspectorDataAdapter": 1, + "DebugLogging": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "main", + "file": "../private-build-infra/virtual-packages/debugging.js", + "line": 4, + "description": "# Overview\n\nThis package provides the `DataAdapter` which the [Ember Inspector](https://github.com/emberjs/ember-inspector)\nuses to subscribe and retrieve information for the `data` tab in the inspector.\n\nThis package adds roughly .6 KB when minified and compressed to your application in production; however,\nyou can opt out of shipping this addon in production via options in `ember-cli-build.js`\n\n```js\nlet app = new EmberApp(defaults, {\n emberData: {\n includeDataAdapterInProduction: false\n }\n});\n```\n\nWhen using `ember-data` as a dependency of your app, the default is to ship the inspector support to production.\n\nWhen not using `ember-data` as a dependency but instead using EmberData via declaring specific `@ember-data/`\ndependencies the default is to not ship to production.", + "itemtype": "main" + }, + "@ember-data/graph": { + "name": "@ember-data/graph", + "submodules": {}, + "elements": {}, + "classes": {}, + "fors": {}, + "namespaces": {}, + "tag": "main", + "file": "../graph/src/-private.ts", + "line": 3, + "description": "

\n \n

\n\n

Provides a performance tuned normalized graph for intelligently managing relationships between resources based on identity

\n\nWhile this Graph is abstract, it currently is a private implementation required as a peer-dependency by the [JSON:API Cache Implementation](https://github.com/emberjs/data/tree/main/packages/json-api).\n\nWe intend to make this Graph public API after some additional iteration during the 5.x timeframe, until then all APIs should be considered experimental and unstable, not fit for direct application or 3rd party library usage.\n\n## Installation\n\nInstall using your javascript package manager of choice. For instance with [pnpm](https://pnpm.io/)\n\n```no-highlight\npnpm add @ember-data/graph\n```", + "itemtype": "main" + }, + "@ember-data/json-api/request": { + "name": "@ember-data/json-api/request", + "submodules": {}, + "elements": {}, + "classes": { + "@ember-data/json-api/request": 1 + }, + "fors": { + "@ember-data/json-api/request": 1 + }, + "namespaces": {}, + "tag": "main", + "file": "../json-api/src/request.ts", + "line": 1, + "description": "

\n \n

\n\nThis package provides utilities for working with [JSON:API](https://json-api.org) APIs with [*Ember***Data**](https://github.com/emberjs/data/).\n\n## Installation\n\nInstall using your javascript package manager of choice. For instance with [pnpm](https://pnpm.io/)\n\n```no-highlight\npnpm add @ember-data/json-api\n```\n\n## Usage\n\nRequest builders are functions that produce [Fetch Options](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API).\nThey take a few contextual inputs about the request you want to make, abstracting away the gnarlier details.\n\nFor instance, to fetch a resource from your API\n\n```ts\nimport { findRecord } from '@ember-data/json-api/request';\n\nconst options = findRecord('ember-developer', '1', { include: ['pets', 'friends'] });\n\n/\\*\n => {\n url: 'https://api.example.com/v1/ember-developers/1?include=friends,pets',\n method: 'GET',\n headers: ,\n // => 'Accept': 'application/vnd.api+json'\n // => 'Content-Type': 'application/vnd.api+json'\n op: 'findRecord';\n records: [{ type: 'ember-developer', id: '1' }]\n }\n\\/\n```\n\nRequest builder output may be used with either `requestManager.request` or `store.request`.\n\nURLs are stable. The same query will produce the same URL every time, even if the order of keys in\nthe query or values in an array changes.\n\nURLs follow the most common JSON:API format (dasherized pluralized resource types).\n\n### Available Builders\n\n- [createRecord](https://api.emberjs.com/ember-data/release/functions/@ember-data%2Fjson-api/createRecord)\n- [deleteRecord](https://api.emberjs.com/ember-data/release/functions/@ember-data%2Fjson-api/deleteRecord)\n- [findRecord](https://api.emberjs.com/ember-data/release/functions/@ember-data%2Fjson-api/findRecord)\n- [query](https://api.emberjs.com/ember-data/release/functions/@ember-data%2Fjson-api/query)\n- [updateRecord](https://api.emberjs.com/ember-data/release/functions/@ember-data%2Fjson-api/updateRecord)", + "itemtype": "main" + }, + "@ember-data/json-api": { + "name": "@ember-data/json-api", + "submodules": {}, + "elements": {}, + "classes": { + "Cache": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "main", + "file": "../json-api/src/-private/cache.ts", + "line": 84, + "description": "

\n \n

\n\nThis package provides an in-memory [JSON:API](https://jsonapi.org/) document and resource [*Ember***Data** Cache](https://github.com/emberjs/data/blob/main/ember-data-types/cache/cache.ts) implementation.\n\n## Installation\n\nInstall using your javascript package manager of choice. For instance with [pnpm](https://pnpm.io/)\n\n```no-highlight\npnpm add @ember-data/json-api\n```\n\n## 🚀 Setup\n\n> **Note** When using [ember-data](https://github.com/emberjs/data/blob/main/packages/-ember-data) the below\n> configuration is handled for you automatically.\n\n```ts\nimport Store from '@ember-data/store';\nimport Cache from '@ember-data/json-api';\n\nexport default class extends Store {\n createCache(wrapper) {\n return new Cache(wrapper);\n }\n}\n```\n\n\n## Usage\n\nUsually you will directly interact with the cache only if implementing a presentation class. Below we\ngive an example of a read-only record (mutations never written back to the cache). More typically cache\ninteractions are something that the `Store` coordinates as part of the `request/response` lifecycle.\n\n```ts\nimport Store, { recordIdentifierFor } from '@ember-data/store';\nimport Cache from '@ember-data/json-api';\nimport { TrackedObject } from 'tracked-built-ins';\n\nclass extends Store {\n createCache(wrapper) {\n return new Cache(wrapper);\n }\n\n instantiateRecord(identifier) {\n const { cache, notifications } = this;\n const { type, id } = identifier;\n\n // create a TrackedObject with our attributes, id and type\n const attrs = cache.peek(identifier).attributes;\n const data = Object.assign({}, attrs, { type, id });\n const record = new TrackedObject(data);\n\n // update the TrackedObject whenever attributes change\n const token = notifications.subscribe(identifier, (_, change) => {\n if (change === 'attributes') {\n Object.assign(record, cache.peek(identifier).attributes);\n }\n });\n\n // setup the ability to teardown the subscription when the\n // record is no longer needed\n record.destroy = () => {\n this.notifications.unsubscribe(token);\n };\n\n return record;\n }\n\n teardownRecord(record: FakeRecord) {\n record.destroy();\n }\n}\n```\n\nFor the full list of APIs available read the code documentation for [*Ember***Data** Cache](https://github.com/emberjs/data/blob/main/ember-data-types/cache/cache.ts)", + "itemtype": "main" + }, + "@ember-data/legacy-compat": { + "name": "@ember-data/legacy-compat", + "submodules": {}, + "elements": {}, + "classes": { + "SnapshotRecordArray": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "main", + "file": "../legacy-compat/src/legacy-network-handler/snapshot-record-array.ts", + "line": 12, + "description": "Utilities - often temporary - for maintaining backwards compatibility with\nolder parts of EmberData.", + "itemtype": "main" + }, + "@ember-data/model": { + "name": "@ember-data/model", + "submodules": {}, + "elements": {}, + "classes": { + "BelongsToReference": 1, + "HasManyReference": 1, + "@ember-data/model": 1, + "Errors": 1, + "Model": 1, + "PromiseBelongsTo": 1, + "PromiseManyArray": 1 + }, + "fors": { + "@ember-data/model": 1, + "Model": 1 + }, + "namespaces": {}, + "tag": "main", + "file": "../model/src/-private/promise-many-array.ts", + "line": 20, + "description": "This package provides a Presentation Model for resource data in an EmberData Cache.\n\nModels are defined as classes extending from `import Model from '@ember-data/model';` and the\nattributes and relationships on these classes are parsed at runtime to supply static \"schema\"\nto EmberData's SchemaService.\n\nResource data for individual resources fetched from your API is presented to the UI via instances\nof the `Model`s you define. An instantiated `Model` is referred to as a `record`.\n\n When we refer to the `ModelClass` as opposed to a `Model` or `Record` we are referring\n specifically to the class definition and the static schema methods present on it.\n\n When we refer to a `record` we refer to a specific class instance presenting\n the resource data for a given `type` and `id`.\n\n ### Defining a Model\n\n ```app/models/person.js\n import Model, { attr, belongsTo, hasMany } from '@ember-data/model';\n\n export default class PersonModel extends Model {", + "attr": "name;", + "belongsto": "('pet', { inverse: 'owners', async: false }) dog;", + "hasmany": "('person', { inverse: 'friends', async: true }) friends;\n }\n ```\n\n ### modelName convention\n\n By convention, the name of a given model (its `type`) matches the name\n of the file in the `app/models` folder and should be lowercase, singular\n and dasherized.", + "itemtype": "main" + }, + "@ember-data/canary-features": { + "name": "@ember-data/canary-features", + "submodules": {}, + "elements": {}, + "classes": { + "CanaryFeatureFlags": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "main", + "file": "../private-build-infra/virtual-packages/canary-features.js", + "line": 76, + "description": "## Canary Features\n\nEmberData allows users to test features that are implemented but not yet\navailable even in canary.\n\nTypically these features represent work that might introduce a new concept,\nnew API, change an API, or risk an unintended change in behavior to consuming\napplications.\n\nSuch features have their implementations guarded by a \"feature flag\", and the\nflag is only activated once the core-data team is prepared to ship the work\nin a canary release.\n\n### Installing Canary\n\nTo test a feature you MUST be using a canary build. Canary builds are published\nto `npm` and can be installed using a precise tag (such as `ember-data@3.16.0-alpha.1`)\nor by installing the latest dist-tag published to the `canary` channel using your javascript\npackage manager of choice. For instance with [pnpm](https://pnpm.io/)\n\n ```cli\n pnpm add ember-data@canary\n ```\n\n### Activating a Canary Feature\n\nOnce you have installed canary, feature-flags can be activated at build-time\n\nby setting an environment variable:\n\n```cli\n# Activate a single flag\nEMBER_DATA_FEATURE_OVERRIDE=SOME_FLAG ember build\n\n# Activate multiple flags by separating with commas\nEMBER_DATA_FEATURE_OVERRIDE=SOME_FLAG,OTHER_FLAG ember build\n\n# Activate all flags\nEMBER_DATA_FEATURE_OVERRIDE=ENABLE_ALL_OPTIONAL ember build\n```\n\nor by setting the appropriate flag in your `ember-cli-build` file:\n\n```ts\nlet app = new EmberApp(defaults, {\n emberData: {\n features: {\n SAMPLE_FEATURE_FLAG: false // utliize existing behavior, strip code for the new feature\n OTHER_FEATURE_FLAG: true // utilize this new feature, strip code for the older behavior\n }\n }\n})\n```\n\n**The \"off\" branch of feature-flagged code is always stripped from production builds.**\n\nThe list of available feature-flags is located [here](https://github.com/emberjs/data/tree/main/packages/private-build-infra/virtual-packages/canary-features.js \"List of EmberData FeatureFlags\")\n\n\n### Preparing a Project to use a Canary Feature\n\nFor most projects, simple version detection should be enough.\nUsing the provided version compatibility helpers from [embroider-macros](https://github.com/embroider-build/embroider/tree/main/packages/macros#readme)\nthe following can be done:\n\n```js\nif (macroCondition(dependencySatisfies('@ember-data/store', '5.0'))) {\n // do thing\n}\n```", + "itemtype": "main" + }, + "@ember-data/deprecations": { + "name": "@ember-data/deprecations", + "submodules": {}, + "elements": {}, + "classes": { + "CurrentDeprecations": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "main", + "file": "../private-build-infra/virtual-packages/deprecations.js", + "line": 79, + "description": "## Deprecations\n\nEmberData allows users to opt-in and remove code that exists to support deprecated\nbehaviors.\n\nIf your app has resolved all deprecations present in a given version,\nyou may specify that version as your \"compatibility\" version to remove\nthe code that supported the deprecated behavior from your app.\n\nFor instance, if a deprecation was introduced in 3.13, and the app specifies\n3.13 as its minimum version compatibility, any deprecations introduced before\nor during 3.13 would be stripped away.\n\nAn app can use a different version than what it specifies as it's compatibility\nversion. For instance, an App could be using `3.16` while specifying compatibility\nwith `3.12`. This would remove any deprecations that were present in or before `3.12`\nbut keep support for anything deprecated in or above `3.13`.\n\n### Configuring Compatibility\n\nTo configure your compatibility version, set the `compatWith` to the version you\nare compatible with on the `emberData` config in your `ember-cli-build.js` file.\n\n```js\nlet app = new EmberApp(defaults, {\n emberData: {\n compatWith: '3.12',\n },\n});\n```\n\nAlternatively, individual deprecations can be resolved (and thus have its support stripped)\nvia one of the flag names listed below. For instance, given a flag named `DEPRECATE_FOO_BEHAVIOR`.\n\nThis capability is interopable with `compatWith`. You may set `compatWith` and then selectively resolve\nadditional deprecations, or set compatWith and selectively un-resolve specific deprecations.\n\nNote: EmberData does not test against permutations of deprecations being stripped, our tests run against\n\"all deprecated code included\" and \"all deprecated code removed\". Unspecified behavior may sometimes occur\nwhen removing code for only some deprecations associated to a version number.\n\n```js\nlet app = new EmberApp(defaults, {\n emberData: {\n deprecations: {\n DEPRECATE_FOO_BEHAVIOR: false // set to false to strip this code\n DEPRECATE_BAR_BEHAVIOR: true // force to true to not strip this code\n }\n }\n})\n```\n\nThe complete list of which versions specific deprecations will be removed in\ncan be found [here](https://github.com/emberjs/data/blob/main/packages/private-build-infra/virtual-packages/deprecations.js \"List of EmberData Deprecations\")", + "itemtype": "main" + }, + "@ember-data/request-utils": { + "name": "@ember-data/request-utils", + "submodules": {}, + "elements": {}, + "classes": { + "@ember-data/request-utils": 1, + "LifetimesService": 1 + }, + "fors": { + "@ember-data/request-utils": 1 + }, + "namespaces": {}, + "tag": "main", + "file": "../request-utils/src/index.ts", + "line": 582, + "description": "Simple utility function to assist in url building,\nquery params, and other common request operations.\n\nThese primitives may be used directly or composed\nby request builders to provide a consistent interface\nfor building requests.\n\nFor instance:\n\n```ts\nimport { buildBaseURL, buildQueryParams } from '@ember-data/request-utils';\n\nconst baseURL = buildBaseURL({\n host: 'https://api.example.com',\n namespace: 'api/v1',\n resourcePath: 'emberDevelopers',\n op: 'query',\n identifier: { type: 'ember-developer' }\n});\nconst url = `${baseURL}?${buildQueryParams({ name: 'Chris', include:['pets'] })}`;\n// => 'https://api.example.com/api/v1/emberDevelopers?include=pets&name=Chris'\n```\n\nThis is useful, but not as useful as the REST request builder for query which is sugar\nover this (and more!):\n\n```ts\nimport { query } from '@ember-data/rest/request';\n\nconst options = query('ember-developer', { name: 'Chris', include:['pets'] });\n// => { url: 'https://api.example.com/api/v1/emberDevelopers?include=pets&name=Chris' }\n// Note: options will also include other request options like headers, method, etc.\n```", + "itemtype": "main" + }, + "@ember-data/request": { + "name": "@ember-data/request", + "submodules": {}, + "elements": {}, + "classes": { + "RequestManager": 1, + "Future": 1, + " Handler": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "main", + "file": "../request/src/-private/types.ts", + "line": 205, + "description": "

\n \n

\n\n

⚡️ a simple abstraction over fetch to enable easy management of request/response flows

\n\nThis package provides [*Ember*‍**Data**](https://github.com/emberjs/data/)'s `RequestManager`, a framework agnostic library that can be integrated with any Javascript application to make [fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) happen.\n\n## Installation\n\nInstall using your javascript package manager of choice. For instance with [pnpm](https://pnpm.io/)\n\n```no-highlight\npnpm add @ember-data/request\n```\n\n## 🚀 Basic Usage\n\nA `RequestManager` provides a request/response flow in which configured handlers are successively given the opportunity to handle, modify, or pass-along a request.\n\nThe RequestManager on its own does not know how to fulfill requests. For this we must register at least one handler. A basic `Fetch` handler is provided that will take the request options provided and execute `fetch`.\n\n```ts\nimport RequestManager from '@ember-data/request';\nimport Fetch from '@ember-data/request/fetch';\nimport { apiUrl } from './config';\n\n// ... create manager and add our Fetch handler\nconst manager = new RequestManager();\nmanager.use([Fetch]);\n\n// ... execute a request\nconst response = await manager.request({\n url: `${apiUrl}/users`\n});\n```\n\n\n## 🪜 Architecture\n\nA `RequestManager` receives a request and manages fulfillment via configured handlers. It may be used standalone from the rest of *Ember*‍**Data** and is not specific to any library or framework.\n\nEach handler may choose to fulfill the request using some source of data or to pass the request along to other handlers.\n\nThe same or a separate instance of a `RequestManager` may also be used to fulfill requests issued by [*Ember*‍**Data**{Store}](https://github.com/emberjs/data/tree/main/packages/store)\n\nWhen the same instance is used by both this allows for simple coordination throughout the application. Requests issued by the Store will use the in-memory cache\nand return hydrated responses, requests issued directly to the RequestManager\nwill skip the in-memory cache and return raw responses.\n\n## Usage\n\n```ts\nconst userList = await manager.request({\n url: `/api/v1/users.list`\n});\n\nconst users = userList.content;\n```\n\n
\n Making Requests\n\n`RequestManager` has a single asyncronous method as it's API: `request`\n\n```ts\nclass RequestManager {\n request(req: RequestInfo): Future;\n}\n```\n\n`manager.request()` accepts an object containing the information\nnecessary for the request to be handled successfully.\n\nThese options extend the [options](https://developer.mozilla.org/en-US/docs/Web/API/fetch#parameters) provided to `fetch`, and can accept a [`Request`](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request). All properties accepted by Request options and fetch options are valid.\n\n```ts\ninterface RequestInfo extends FetchOptions {\n op?: string;\n store?: Store;\nurl: string;\n // data that a handler should convert into\n // the query (GET) or body (POST)\n data?: Record;\n// options specifically intended for handlers\n // to utilize to process the request\n options?: Record;\n}\n```\n\n> **note:** providing a `signal` is unnecessary as an `AbortController` is automatically provided if none is present.\n\n
\n
\n Using the Response
\n\n`manager.request` returns a `Future`, which allows access to limited information about the request while it is still pending and fulfills with the final state when the request completes and the response has been read.\n\n```ts\nconst usersFuture = manager.request({\n url: `/api/v1/users.list`\n});\n```\n\nA `Future` is cancellable via `abort`.\n\n```ts\nusersFuture.abort();\n```\n\nHandlers may *optionally* expose a ReadableStream to the `Future` for streaming data; however, when doing so the handler should not resolve until it has fully read the response stream itself.\n\n```ts\ninterface Future extends Promise> {\n abort(): void;\nasync getStream(): ReadableStream | null;\n}\n```\n\nA Future resolves or rejects with a `StructuredDocument`.\n\n```ts\ninterface StructuredDocument {\n request: RequestInfo;\n response: ResponseInfo | null;\n content?: T;\n error?: Error;\n}\n```\n\nThe `RequestInfo` specified by `document.request` is the same as originally provided to `manager.request`. If any handler fulfilled this request using different request info it is not represented here. This contract helps to ensure that `retry` and `caching` are possible since the original arguments are correctly preserved. This also allows handlers to \"fork\" the request or fulfill from multiple sources without the details of fulfillment muddying the original request.\n\nThe `ResponseInfo` is a serializable fulfilled subset of a [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) if set via `setResponse`. If no response was ever set this will be `null`.\n\n```ts\ninterface ResponseInfo {\n headers?: Record;\n ok?: boolean;\n redirected?: boolean;\n status?: HTTPStatusCode;\n statusText?: string;\n type?: 'basic' | 'cors';\n url?: string;\n}\n```\n\n
\n\n

Handling Requests

\n
\n { request(context, next): Promise | Future; }
\n\nRequests are fulfilled by handlers. A handler receives the request context\nas well as a `next` function with which to pass along a request to the next\nhandler if it so chooses.\n\nA handler may be any object with a `request` method. This allows both stateful and non-stateful\nhandlers to be utilized.\n\nIf a handler calls `next`, it receives a `Future` which resolves to a `StructuredDocument`\nthat it can then compose how it sees fit with its own response.\n\n```ts\n\ntype NextFn

= (req: RequestInfo) => Future

;\n\ninterface Handler {\n async request(context: RequestContext, next: NextFn

): T;\n}\n```\n\n`RequestContext` contains a readonly version of the RequestInfo as well as a few methods for building up the `StructuredDocument` and `Future` that will be part of the response.\n\n```ts\ninterface RequestContext {\n readonly request: RequestInfo;\nsetStream(stream: ReadableStream | Promise): void;\n setResponse(response: Response | ResponseInfo): void;\n}\n```\n\nA basic `fetch` handler with support for streaming content updates while\nthe download is still underway might look like the following, where we use\n[`response.clone()`](https://developer.mozilla.org/en-US/docs/Web/API/Response/clone) to `tee` the `ReadableStream` into two streams.\n\nA more efficient handler might read from the response stream, building up the\nresponse content before passing along the chunk downstream.\n\n```ts\nconst FetchHandler = {\n async request(context) {\n const response = await fetch(context.request);\n context.setResponse(reponse);\n context.setStream(response.clone().body);\n return response.json();\n }\n}\n```\n\nRequest handlers are registered by configuring the manager via `use`\n\n```ts\nmanager.use([Handler1, Handler2])\n```\n\nHandlers will be invoked in the order they are registered (\"fifo\", first-in first-out), and may only be registered up until the first request is made. It is recommended but not required to register all handlers at one time in order to ensure explicitly visible handler ordering.\n\n

\n\n\n
\n Error Handling
\nEach handler in the chain can catch errors from upstream and choose to\n either handle the error, re-throw the error, or throw a new error.\n```ts\n const MAX_RETRIES = 5;\nconst Handler = {\n async request(context, next) {\n let attempts = 0;\n while (attempts < MAX_RETRIES) {\n attempts++;\n try {\n const response = await next(context.request);\n return response;\n } catch (e) {\n if (isTimeoutError(e) && attempts < MAX_RETRIES) {\n // retry request\n continue;\n }\n // rethrow if it is not a timeout error\n throw e;\n }\n }\n }\n }\n ```\n
\n\n
\n Handling Abort
\nAborting a request will reject the current handler in the chain. However,\n every handler can potentially catch this error. If your handler needs to\n separate AbortError from other Error types, it is recommended to check\n `context.request.signal.aborted` (or if a custom controller was supplied `controller.signal.aborted`).\nIn this manner it is possible for a request to recover from an abort and\n still proceed; however, as a best practice this should be used for necessary\n cleanup only and the original AbortError rethrown if the abort signal comes\n from the root controller.\n\n*AbortControllers are Always Present and Always Entangled**\nIf the initial request does not supply an [AbortController](https://developer.mozilla.org/en-US/docs/Web/API/AbortController), one will be generated.\nThe [signal](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) for this controller is automatically added to the request passed into the first handler.\nEach handler has the option to supply a new controller to the request when calling `next`. If a new controller is provided it will be automatically\n entangled with the root controller. If the root controller aborts, so will\n any entangled controllers.\nIf an entangled controller aborts, the root controller will not abort. This\n allows for advanced request-flow scenarios to abort subsections of the request tree without aborting the entire request.\n\n
\n\n\n
\n Stream Currying
\n\n`RequestManager.request` and `next` differ from `fetch` in one **crucial detail** in that the outer Promise resolves only once the response stream has been processed.\n\nFor context, it helps to understand a few of the use-cases that RequestManager\nis intended to allow.\n\n- to manage and return streaming content (such as video files)\n- to fulfill a request from multiple sources or by splitting one request into multiple requests\n - for instance one API call for a user and another for the user's friends\n - or e.g. fulfilling part of the request from one source (one API, in-memory, localStorage, IndexedDB\n etc.) and the rest from another source (a different API, a WebWorker, etc.)\n- to coalesce multiple requests\n- to decorate a request with additional info\n - e.g. an Auth handler that ensures the correct tokens or headers or cookies are attached.\n\n\n`await fetch()` resolves at the moment headers are received. This allows for the body of the request to be processed as a stream by application\ncode *while chunks are still being received by the browser*.\n\nWhen an app chooses to `await response.json()` what occurs is the browser reads the stream to completion and then returns the result. Additionally, this stream may only be read **once**.\n\nThe `RequestManager` preserves this ability to subscribe to and utilize the stream by either the application or the handler – thereby delivering the full power and flexibility of native APIs – without restricting developers in ways that lead to complicated workarounds.\n\nEach handler may call `setStream` only once, but may do so *at any time* until the promise that the handler returns has resolved. The associated promise returned by calling `future.getStream` will resolve with the stream set by `setStream` if that method is called, or `null` if that method\nhas not been called by the time that the handler's request method has resolved.\n\nHandlers that do not create a stream of their own, but which call `next`, should defensively pipe the stream forward. While this is not required (see automatic currying below) it is better to do so in most cases as otherwise the stream may not become available to downstream handlers or the application until the upstream handler has fully read it.\n\n```ts\ncontext.setStream(future.getStream());\n```\n\nHandlers that either call `next` multiple times or otherwise have reason to create multiple fetch requests should either choose to return no stream, meaningfully combine the streams, or select a single prioritized stream.\n\nOf course, any handler may choose to read and handle the stream, and return either no stream or a different stream in the process.\n\n
\n\n
\n Automatic Currying of Stream and Response
\n\nIn order to simplify the common case for handlers which decorate a request, if `next` is called only a single time and `setResponse` was never called by the handler, the response set by the next handler in the chain will be applied to that handler's outcome. For instance, this makes the following pattern possible `return (await next()).content;`.\n\nSimilarly, if `next` is called only a single time and neither `setStream` nor `getStream` was called, we automatically curry the stream from the future returned by `next` onto the future returned by the handler.\n\nFinally, if the return value of a handler is a `Future`, we curry `content` and `errors` as well, thus enabling the simplest form `return next()`.\n\nIn the case of the `Future` being returned, `Stream` proxying is automatic and immediate and does not wait for the `Future` to resolve.\n\n
\n\n### Using as a Service\n\nMost applications will desire to have a single `RequestManager` instance, which can be achieved using module-state patterns for singletons, or for [Ember](https://emberjs.com) applications by exporting the manager as a [service](https://guides.emberjs.com/release/services/).\n\nservices/request.ts*\n```ts\nimport RequestManager from '@ember-data/request';\nimport Fetch from '@ember-data/request/fetch';\nimport Auth from 'ember-simple-auth/ember-data-handler';\n\nexport default class extends RequestManager {\n constructor(createArgs) {\n super(createArgs);\n this.use([Auth, Fetch]);\n }\n}\n```\n\n### Using with `@ember-data/store`\n\nTo have a request service unique to a Store:\n\n```ts\nimport Store, { CacheHandler } from '@ember-data/store';\nimport RequestManager from '@ember-data/request';\nimport Fetch from '@ember-data/request/fetch';\n\nclass extends Store {\n requestManager = new RequestManager();\nconstructor(args) {\n super(args);\n this.requestManager.use([Fetch]);\n this.requestManager.useCache(CacheHandler);\n }\n}\n```\n\n### Using with `ember-data`\n\nIf using the package [ember-data](https://github.com/emberjs/data/tree/main/packages/-ember-data), the following configuration will automatically be done in order to preserve the legacy [Adapter](https://github.com/emberjs/data/tree/main/packages/adapter) and [Serializer](https://github.com/emberjs/data/tree/main/packages/serializer) behavior. Additional handlers or a service injection like the above would need to be done by the consuming application in order to make broader use of `RequestManager`.\n\n```ts\nimport Store, { CacheHandler } from '@ember-data/store';\nimport RequestManager from '@ember-data/request';\nimport { LegacyNetworkHandler } from '@ember-data/legacy-compat';\n\nexport default class extends Store {\n requestManager = new RequestManager();\nconstructor(args) {\n super(args);\n this.requestManager.use([LegacyNetworkHandler]);\n this.requestManager.useCache(CacheHandler);\n }\n}\n```\n\nBecause the application's store service (if present) will override the store supplied by `ember-data`, all that is required to define your own ordering and handlers is to supply a store service extending from `@ember-data/store` and configure as shown above.\n\nFor usage of the store's `requestManager` via `store.request()` see the [Store](https://api.emberjs.com/ember-data/release/modules/@ember-data%2Fstore) documentation.", + "itemtype": "main" + }, + "@ember-data/request/fetch": { + "name": "@ember-data/request/fetch", + "submodules": {}, + "elements": {}, + "classes": { + "Fetch": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "main", + "file": "../request/src/fetch.ts", + "line": 35, + "description": "A basic Fetch Handler which converts a request into a\n`fetch` call presuming the response to be `json`.\n\n```ts\nimport Fetch from '@ember-data/request/fetch';\n\nmanager.use([Fetch]);\n```", + "itemtype": "main" + }, + "@ember-data/rest/request": { + "name": "@ember-data/rest/request", + "submodules": {}, + "elements": {}, + "classes": { + "@ember-data/rest/request": 1 + }, + "fors": { + "@ember-data/rest/request": 1 + }, + "namespaces": {}, + "tag": "main", + "file": "../rest/src/request.ts", + "line": 1, + "description": "

\n \n

\n\nThis package provides utilities for working with **REST**ful APIs with [*Ember***Data**](https://github.com/emberjs/data/).\n\n## Installation\n\nInstall using your javascript package manager of choice. For instance with [pnpm](https://pnpm.io/)\n\n```no-highlight\npnpm add @ember-data/json-api\n```\n\n## Usage\n\nRequest builders are functions that produce [Fetch Options](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API).\nThey take a few contextual inputs about the request you want to make, abstracting away the gnarlier details.\n\nFor instance, to fetch a resource from your API\n\n```ts\nimport { findRecord } from '@ember-data/rest/request';\n\nconst options = findRecord('ember-developer', '1', { include: ['pets', 'friends'] });\n\n/*\n => {\n url: 'https://api.example.com/v1/emberDevelopers/1?include=friends,pets',\n method: 'GET',\n headers: , // 'Content-Type': 'application/json; charset=utf-8'\n op: 'findRecord';\n records: [{ type: 'ember-developer', id: '1' }]\n }\n/\n```\n\nRequest builder output is ready to go for use with [store.request](https://api.emberjs.com/ember-data/release/classes/Store/methods/request?anchor=request),\n[manager.request](https://api.emberjs.com/ember-data/release/classes/RequestManager/methods/request?anchor=request) and most conventional REST APIs.\n\nResource types are pluralized and camelized for the url.\n\nURLs are stable. The same query will produce the same URL every time, even if the order of keys in\nthe query or values in an array changes.\n\nURLs follow the most common REST format (camelCase pluralized resource types).\n\n### Available Builders\n\n- [createRecord](https://api.emberjs.com/ember-data/release/functions/@ember-data%2Frest/createRecord)\n- [deleteRecord](https://api.emberjs.com/ember-data/release/functions/@ember-data%2Frest/deleteRecord)\n- [findRecord](https://api.emberjs.com/ember-data/release/functions/@ember-data%2Frest/findRecord)\n- [query](https://api.emberjs.com/ember-data/release/functions/@ember-data%2Frest/query)\n- [updateRecord](https://api.emberjs.com/ember-data/release/functions/@ember-data%2Frest/updateRecord)", + "itemtype": "main" + }, + "@ember-data/serializer": { + "name": "@ember-data/serializer", + "submodules": {}, + "elements": {}, + "classes": { + "BooleanTransform": 1, + "DateTransform": 1, + "NumberTransform": 1, + "StringTransform": 1, + "Transform": 1, + "Serializer": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "main", + "file": "../serializer/src/index.ts", + "line": 116, + "description": "## Overview\n\n
\n

\n ⚠️ This is LEGACY documentation for a feature that is no longer encouraged to be used.\n If starting a new app or thinking of implementing a new serializer, consider writing a\n Handler instead to be used with the RequestManager\n

\n
\n\nIn order to properly manage and present your data, EmberData\nneeds to understand the structure of data it receives.\n\n`Serializers` convert data between the server's API format and\nthe format EmberData understands.\n\nData received from an API response is **normalized** into\n[JSON:API](https://jsonapi.org/) (the format used internally\nby EmberData), while data sent to an API is **serialized**\ninto the format the API expects.\n\n### Implementing a Serializer\n\nThere are only two required serializer methods, one for\nnormalizing data from the server API format into JSON:API, and\nanother for serializing records via `Snapshots` into the expected\nserver API format.\n\nTo implement a serializer, export a class that conforms to the structure\ndescribed by [ Serializer](/ember-data/release/classes/%3CInterface%3E%20Serializer)\nfrom the `app/serializers/` directory. An example is below.\n\n```ts\nimport EmberObject from '@ember/object';\n\nexport default class ApplicationSerializer extends EmberObject {\n normalizeResponse(store, schema, rawPayload) {\n return rawPayload;\n }\n\n serialize(snapshot, options) {\n const serializedResource = {\n id: snapshot.id,\n type: snapshot.modelName,\n attributes: snapshot.attributes()\n };\n\n return serializedResource;\n }\n}\n ```\n\n\n### Serializer Resolution\n\n`store.serializerFor(name)` will lookup serializers defined in\n`app/serializers/` and return an instance. If no serializer is found, an\nerror will be thrown.\n\n`serializerFor` first attempts to find a serializer with an exact match on `name`,\nthen falls back to checking for the presence of a serializer named `application`.\n\n```ts\nstore.serializerFor('author');\n\n// lookup paths (in order) =>\n// app/serializers/author.js\n// app/serializers/application.js\n```\n\nMost requests in EmberData are made with respect to a particular `type` (or `modelName`)\n(e.g., \"get me the full collection of **books**\" or \"get me the **employee** whose id is 37\"). We\nrefer to this as the **primary** resource `type`.\n\nTypically `serializerFor` will be used to find a serializer with a name matching that of the primary\nresource `type` for the request, falling back to the `application` serializer for those types that\ndo not have a defined serializer. This is often described as a `per-model` or `per-type` strategy\nfor defining serializers. However, because APIs rarely format payloads per-type but rather\nper-API-version, this may not be a desired strategy.\n\nIt is recommended that applications define only a single `application` adapter and serializer\nwhere possible.\n\nIf you have multiple API formats and the per-type strategy is not viable, one strategy is to\nwrite an `application` adapter and serializer that make use of `options` to specify the desired\nformat when making a request.\n\n### Using a Serializer\n\nAny serializer in `app/serializers/` can be looked up by `name` using `store.serializerFor(name)`.\n\n### Default Serializers\n\nFor applications whose APIs are *very close to* or *exactly* the **REST** format or **JSON:API**\nformat the `@ember-data/serializer` package contains implementations these applications can\nextend. It also contains a simple `JSONSerializer` for serializing to/from very basic JSON objects.\n\nMany applications will find writing their own serializer to be more performant and less\ncomplex than extending these classes even when their API format is very close to that expected\nby these serializers.\n\nIt is recommended that apps write their own serializer to best suit the needs of their API and\napplication.", + "itemtype": "main" + }, + "@ember-data/serializer/rest": { + "name": "@ember-data/serializer/rest", + "submodules": {}, + "elements": {}, + "classes": { + "EmbeddedRecordsMixin": 1, + "RESTSerializer": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "main", + "file": "../serializer/src/rest.js", + "line": 18, + "description": "
\n

\n ⚠️ This is LEGACY documentation for a feature that is no longer encouraged to be used.\n If starting a new app or thinking of implementing a new adapter, consider writing a\n Handler instead to be used with the RequestManager\n

\n
\n\n Normally, applications will use the `RESTSerializer` by implementing\n the `normalize` method.\n\n This allows you to do whatever kind of munging you need and is\n especially useful if your server is inconsistent and you need to\n do munging differently for many different kinds of responses.\n\n See the `normalize` documentation for more information.\n\n ## Across the Board Normalization\n\n There are also a number of hooks that you might find useful to define\n across-the-board rules for your payload. These rules will be useful\n if your server is consistent, or if you're building an adapter for\n an infrastructure service, like Firebase, and want to encode service\n conventions.\n\n For example, if all of your keys are underscored and all-caps, but\n otherwise consistent with the names you use in your models, you\n can implement across-the-board rules for how to convert an attribute\n name in your model to a key in your JSON.\n\n ```app/serializers/application.js\n import RESTSerializer from '@ember-data/serializer/rest';\n import { underscore } from '/utils/string-utils';\n\n export default class ApplicationSerializer extends RESTSerializer {\n keyForAttribute(attr, method) {\n return underscore(attr).toUpperCase();\n }\n }\n ```\n\n You can also implement `keyForRelationship`, which takes the name\n of the relationship as the first parameter, the kind of\n relationship (`hasMany` or `belongsTo`) as the second parameter, and\n the method (`serialize` or `deserialize`) as the third parameter.", + "itemtype": "main" + }, + "@ember-data/serializer/json-api": { + "name": "@ember-data/serializer/json-api", + "submodules": {}, + "elements": {}, + "classes": { + "JSONAPISerializer": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "main", + "file": "../serializer/src/json-api.js", + "line": 13, + "description": "
\n

\n ⚠️ This is LEGACY documentation for a feature that is no longer encouraged to be used.\n If starting a new app or thinking of implementing a new adapter, consider writing a\n Handler instead to be used with the RequestManager\n

\n
\n\n In EmberData a Serializer is used to serialize and deserialize\n records when they are transferred in and out of an external source.\n This process involves normalizing property names, transforming\n attribute values and serializing relationships.\n\n `JSONAPISerializer` supports the http://jsonapi.org/ spec and is the\n serializer recommended by Ember Data.\n\n This serializer normalizes a JSON API payload that looks like:\n\n ```app/models/player.js\n import Model, { attr, belongsTo } from '@ember-data/model';\n\n export default class Player extends Model {", + "attr": "('string') location;", + "belongsto": "('club') club;\n }\n ```\n\n ```app/models/club.js\n import Model, { attr, hasMany } from '@ember-data/model';\n\n export default class Club extends Model {", + "hasmany": "('player') players;\n }\n ```\n\n ```js\n {\n \"data\": [\n {\n \"attributes\": {\n \"name\": \"Benfica\",\n \"location\": \"Portugal\"\n },\n \"id\": \"1\",\n \"relationships\": {\n \"players\": {\n \"data\": [\n {\n \"id\": \"3\",\n \"type\": \"players\"\n }\n ]\n }\n },\n \"type\": \"clubs\"\n }\n ],\n \"included\": [\n {\n \"attributes\": {\n \"name\": \"Eusebio Silva Ferreira\",\n \"skill\": \"Rocket shot\",\n \"games-played\": 431\n },\n \"id\": \"3\",\n \"relationships\": {\n \"club\": {\n \"data\": {\n \"id\": \"1\",\n \"type\": \"clubs\"\n }\n }\n },\n \"type\": \"players\"\n }\n ]\n }\n ```\n\n to the format that the Ember Data store expects.\n\n ### Customizing meta\n\n Since a JSON API Document can have meta defined in multiple locations you can\n use the specific serializer hooks if you need to customize the meta.\n\n One scenario would be to camelCase the meta keys of your payload. The example\n below shows how this could be done using `normalizeArrayResponse` and\n `extractRelationship`.\n\n ```app/serializers/application.js\n import JSONAPISerializer from '@ember-data/serializer/json-api';\n\n export default class ApplicationSerializer extends JSONAPISerializer {\n normalizeArrayResponse(store, primaryModelClass, payload, id, requestType) {\n let normalizedDocument = super.normalizeArrayResponse(...arguments);\n\n // Customize document meta\n normalizedDocument.meta = camelCaseKeys(normalizedDocument.meta);\n\n return normalizedDocument;\n }\n\n extractRelationship(relationshipHash) {\n let normalizedRelationship = super.extractRelationship(...arguments);\n\n // Customize relationship meta\n normalizedRelationship.meta = camelCaseKeys(normalizedRelationship.meta);\n\n return normalizedRelationship;\n }\n }\n ```", + "itemtype": "main" + }, + "@ember-data/serializer/json": { + "name": "@ember-data/serializer/json", + "submodules": {}, + "elements": {}, + "classes": { + "JSONSerializer": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "main", + "file": "../serializer/src/json.js", + "line": 17, + "description": "
\n

\n ⚠️ This is LEGACY documentation for a feature that is no longer encouraged to be used.\n If starting a new app or thinking of implementing a new adapter, consider writing a\n Handler instead to be used with the RequestManager\n

\n
\n\n In EmberData a Serializer is used to serialize and deserialize\n records when they are transferred in and out of an external source.\n This process involves normalizing property names, transforming\n attribute values and serializing relationships.\n\n By default, EmberData uses and recommends the `JSONAPISerializer`.\n\n `JSONSerializer` is useful for simpler or legacy backends that may\n not support the http://jsonapi.org/ spec.\n\n For example, given the following `User` model and JSON payload:\n\n ```app/models/user.js\n import Model, { attr, belongsTo, hasMany } from '@ember-data/model';\n\n export default class UserModel extends Model {", + "hasmany": "('user') friends;", + "belongsto": "('location') house;", + "attr": "('string') name;\n }\n ```\n\n ```js\n {\n id: 1,\n name: 'Sebastian',\n friends: [3, 4],\n links: {\n house: '/houses/lefkada'\n }\n }\n ```\n\n `JSONSerializer` will normalize the JSON payload to the JSON API format that the\n Ember Data store expects.\n\n You can customize how JSONSerializer processes its payload by passing options in\n the `attrs` hash or by subclassing the `JSONSerializer` and overriding hooks:\n\n - To customize how a single record is normalized, use the `normalize` hook.\n - To customize how `JSONSerializer` normalizes the whole server response, use the\n `normalizeResponse` hook.\n - To customize how `JSONSerializer` normalizes a specific response from the server,\n use one of the many specific `normalizeResponse` hooks.\n - To customize how `JSONSerializer` normalizes your id, attributes or relationships,\n use the `extractId`, `extractAttributes` and `extractRelationships` hooks.\n\n The `JSONSerializer` normalization process follows these steps:\n\n 1. `normalizeResponse`\n - entry method to the serializer.\n 2. `normalizeCreateRecordResponse`\n - a `normalizeResponse` for a specific operation is called.\n 3. `normalizeSingleResponse`|`normalizeArrayResponse`\n - for methods like `createRecord` we expect a single record back, while for methods like `findAll` we expect multiple records back.\n 4. `normalize`\n - `normalizeArrayResponse` iterates and calls `normalize` for each of its records while `normalizeSingle`\n calls it once. This is the method you most likely want to subclass.\n 5. `extractId` | `extractAttributes` | `extractRelationships`\n - `normalize` delegates to these methods to\n turn the record payload into the JSON API format.", + "itemtype": "main" + }, + "@ember-data/tracking": { + "name": "@ember-data/tracking", + "submodules": {}, + "elements": {}, + "classes": { + "@ember-data/tracking": 1 + }, + "fors": { + "@ember-data/tracking": 1 + }, + "namespaces": {}, + "tag": "main", + "file": "../tracking/src/-private.ts", + "line": 3, + "description": "This package provides primitives that allow powerful low-level\nadjustments to change tracking notification behaviors.\n\nTypically you want to use these primitives when you want to divorce\nproperty accesses on EmberData provided objects from the current\ntracking context. Typically this sort of thing occurs when serializing\ntracked data to send in a request: the data itself is often ancillary\nto the thing which triggered the request in the first place and you\nwould not want to re-trigger the request for any update to the data.", + "itemtype": "main" + } + }, + "classes": { + " Cache": { + "name": " Cache", + "shortname": " Cache", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/experimental-preview-types", + "namespace": "", + "file": "../../ember-data-types/cache/cache.ts", + "line": 31, + "description": "The interface for EmberData Caches.\n\nA Cache handles in-memory storage of Document and Resource\ndata.", + "access": "public", + "tagname": "" + }, + "CacheCapabilitiesManager": { + "name": "CacheCapabilitiesManager", + "shortname": "CacheCapabilitiesManager", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/store", + "namespace": "", + "file": "../../ember-data-types/q/cache-store-wrapper.ts", + "line": 12, + "description": "CacheCapabilitiesManager provides encapsulated API access to the minimal\nsubset of the Store's functionality that Cache implementations\nshould interact with. It is provided to the Store's `createRecordDataFor`\nand `createCache` hooks.\n\nCache implementations should not need more than this API provides.\n\nThis class cannot be directly instantiated.", + "access": "public", + "tagname": "" + }, + "StableRecordIdentifier": { + "name": "StableRecordIdentifier", + "shortname": "StableRecordIdentifier", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/store", + "namespace": "", + "file": "../../ember-data-types/q/identifier.ts", + "line": 91, + "description": "A referentially stable object with a unique string (lid) that can be used\nas a reference to data in the cache.\n\nEvery record instance has a unique identifier, and identifiers may refer\nto data that has never been loaded (for instance, in an async relationship).", + "access": "public", + "tagname": "" + }, + "@ember-data/store": { + "name": "@ember-data/store", + "shortname": "@ember-data/store", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/store", + "namespace": "" + }, + " Adapter": { + "name": " Adapter", + "shortname": " Adapter", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/experimental-preview-types", + "namespace": "", + "file": "../../ember-data-types/q/minimum-adapter-interface.ts", + "line": 19, + "description": "
\n

\n ⚠️ This is LEGACY documentation for a feature that is no longer encouraged to be used.\n If starting a new app or thinking of implementing a new adapter, consider writing a\n Handler instead to be used with the RequestManager\n

\n
\n\n The following documentation describes the methods an\n adapter should implement with descriptions around when an\n application might expect these methods to be called.\n\n Methods that are not required are marked as **optional**.", + "access": "public", + "tagname": "" + }, + " Serializer": { + "name": " Serializer", + "shortname": " Serializer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/experimental-preview-types", + "namespace": "", + "file": "../../ember-data-types/q/minimum-serializer-interface.ts", + "line": 26, + "description": "
\n

\n ⚠️ This is LEGACY documentation for a feature that is no longer encouraged to be used.\n If starting a new app or thinking of implementing a new adapter, consider writing a\n Handler instead to be used with the RequestManager\n

\n
\n\n The following documentation describes the methods an application\n serializer should implement with descriptions around when an\n application might expect these methods to be called.\n\n Methods that are not required are marked as **optional**.", + "access": "public", + "tagname": "" + }, + "SchemaService": { + "name": "SchemaService", + "shortname": "SchemaService", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/store", + "namespace": "", + "file": "../../ember-data-types/q/schema-service.ts", + "line": 8, + "access": "public", + "description": "A SchemaDefinitionService implementation provides the ability\nto query for various information about a resource in an abstract manner.\n\nHow an implementation determines this information is left up to the implementation,\nthis means that schema information could be lazily populated, derived-on-demand,\nor progressively enhanced during the course of an application's runtime.\n\nThe implementation provided to work with `@ember-data/model` makes use of the\nstatic schema properties on those classes to respond to these queries; however,\nthat is not a necessary approach. For instance, Schema information could be sideloaded\nor pre-flighted for API calls, resulting in no need to bundle and ship potentially\nlarge and expensive JSON or JS schemas to pull information from.\n\nTo register a custom schema implementation, extend the store service or\nlookup and register the schema service first thing on app-boot. Example below\nshows extending the service.\n\n```ts\nimport Store from '@ember-data/store';\nimport CustomSchemas from './custom-schemas';\n\nexport default class extends Store {\n constructor(...args) {\n super(...args);\n this.registerSchemaDefinitionService(new CustomSchemas());\n }\n}\n```\n\nAt runtime, both the `Store` and the `StoreWrapper` provide\naccess to this service via the `getSchemaDefinitionService()` method.\n\n```ts\nexport default class extends Component {\n @service store;\n\n get attributes() {\n return this.store\n .getSchemaDefinitionService()\n .attributesDefinitionFor(this.args.dataType);\n }\n}\n```\n\nThis is not a class and cannot be instantiated.\n", + "tagname": "" + }, + "@ember-data/active-record/request": { + "name": "@ember-data/active-record/request", + "shortname": "@ember-data/active-record/request", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/active-record/request", + "namespace": "" + }, + "BuildURLMixin": { + "name": "BuildURLMixin", + "shortname": "BuildURLMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "RESTAdapter" + ], + "module": "@ember-data/adapter", + "namespace": "", + "file": "../adapter/src/-private/build-url-mixin.ts", + "line": 119, + "description": "## Using BuildURLMixin\n\nTo use URL building, include the mixin when extending an adapter, and call `buildURL` where needed.\nThe default behaviour is designed for RESTAdapter.\n\n### Example\n\n```javascript\nimport Adapter, { BuildURLMixin } from '@ember-data/adapter';\n\nexport default class ApplicationAdapter extends Adapter.extend(BuildURLMixin) {\n findRecord(store, type, id, snapshot) {\n var url = this.buildURL(type.modelName, id, snapshot, 'findRecord');\n return this.ajax(url, 'GET');\n }\n}\n```\n\n### Attributes\n\nThe `host` and `namespace` attributes will be used if defined, and are optional.", + "access": "public", + "tagname": "" + }, + "AdapterError": { + "name": "AdapterError", + "shortname": "AdapterError", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/adapter/error", + "namespace": "", + "file": "../adapter/src/error.js", + "line": 6, + "itemtype": "main", + "description": "## Overview\n\n
\n

\n ⚠️ This is LEGACY documentation for a feature that is no longer encouraged to be used.\n If starting a new app or thinking of implementing a new adapter, consider writing a\n Handler instead to be used with the RequestManager\n

\n
\n\nAn `AdapterError` is used by an adapter to signal that an error occurred\nduring a request to an external API. It indicates a generic error, and\nsubclasses are used to indicate specific error states.\n\nTo create a custom error to signal a specific error state in communicating\nwith an external API, extend the `AdapterError`. For example, if the\nexternal API exclusively used HTTP `503 Service Unavailable` to indicate\nit was closed for maintenance:\n\n```app/adapters/maintenance-error.js\nimport AdapterError from '@ember-data/adapter/error';\n\nexport default AdapterError.extend({ message: \"Down for maintenance.\" });\n```\n\nThis error would then be returned by an adapter's `handleResponse` method:\n\n```app/adapters/application.js\nimport JSONAPIAdapter from '@ember-data/adapter/json-api';\nimport MaintenanceError from './maintenance-error';\n\nexport default class ApplicationAdapter extends JSONAPIAdapter {\n handleResponse(status) {\n if (503 === status) {\n return new MaintenanceError();\n }\n\n return super.handleResponse(...arguments);\n }\n}\n```\n\nAnd can then be detected in an application and used to send the user to an\n`under-maintenance` route:\n\n```app/routes/application.js\nimport Route from '@ember/routing/route';\nimport MaintenanceError from '../adapters/maintenance-error';\n\nexport default class ApplicationRoute extends Route {\n actions: {\n error(error, transition) {\n if (error instanceof MaintenanceError) {\n this.transitionTo('under-maintenance');\n return;\n }\n\n // ...other error handling logic\n }\n }\n}\n```\n @mainName @ember-data/adapter/error\n @tag main\n", + "_main": true, + "access": "public", + "tagname": "" + }, + "InvalidError": { + "name": "InvalidError", + "shortname": "InvalidError", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/adapter/error", + "namespace": "", + "file": "../adapter/src/error.js", + "line": 119, + "access": "public", + "description": "A `InvalidError` is used by an adapter to signal the external API\nwas unable to process a request because the content was not\nsemantically correct or meaningful per the API. Usually, this means a\nrecord failed some form of server-side validation. When a promise\nfrom an adapter is rejected with a `InvalidError` the record will\ntransition to the `invalid` state and the errors will be set to the\n`errors` property on the record.\n\nFor Ember Data to correctly map errors to their corresponding\nproperties on the model, Ember Data expects each error to be\na valid JSON-API error object with a `source/pointer` that matches\nthe property name. For example, if you had a Post model that\nlooked like this.\n\n```app/models/post.js\nimport Model, { attr } from '@ember-data/model';\n\nexport default class PostModel extends Model {\n @attr('string') content;\n}\n```\n\nTo show an error from the server related to the `title` and\n`content` properties your adapter could return a promise that\nrejects with a `InvalidError` object that looks like this:\n\n```app/adapters/post.js\nimport RSVP from 'RSVP';\nimport RESTAdapter from '@ember-data/adapter/rest';\nimport { InvalidError } from '@ember-data/adapter/error';\n\nexport default class ApplicationAdapter extends RESTAdapter {\n updateRecord() {\n // Fictional adapter that always rejects\n return RSVP.reject(new InvalidError([\n {\n detail: 'Must be unique',\n source: { pointer: '/data/attributes/title' }\n },\n {\n detail: 'Must not be blank',\n source: { pointer: '/data/attributes/content'}\n }\n ]));\n }\n}\n```\n\nYour backend may use different property names for your records the\nstore will attempt to extract and normalize the errors using the\nserializer's `extractErrors` method before the errors get added to\nthe model. As a result, it is safe for the `InvalidError` to\nwrap the error payload unaltered.\n", + "tagname": "", + "extends": "AdapterError" + }, + "TimeoutError": { + "name": "TimeoutError", + "shortname": "TimeoutError", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/adapter/error", + "namespace": "", + "file": "../adapter/src/error.js", + "line": 183, + "access": "public", + "description": "A `TimeoutError` is used by an adapter to signal that a request\nto the external API has timed out. I.e. no response was received from\nthe external API within an allowed time period.\n\nAn example use case would be to warn the user to check their internet\nconnection if an adapter operation has timed out:\n\n```app/routes/application.js\nimport Route from '@ember/routing/route';\nimport { TimeoutError } from '@ember-data/adapter/error';\nimport { action } from '@ember/object';\n\nexport default class ApplicationRoute extends Route {\n @action error(error, transition) {\n if (error instanceof TimeoutError) {\n // alert the user\n alert('Are you still connected to the Internet?');\n return;\n }\n\n // ...other error handling logic\n }\n}\n```\n", + "tagname": "", + "extends": "AdapterError" + }, + "AbortError": { + "name": "AbortError", + "shortname": "AbortError", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/adapter/error", + "namespace": "", + "file": "../adapter/src/error.js", + "line": 217, + "description": "A `AbortError` is used by an adapter to signal that a request to\nthe external API was aborted. For example, this can occur if the user\nnavigates away from the current page after a request to the external API\nhas been initiated but before a response has been received.", + "access": "public", + "tagname": "", + "extends": "AdapterError" + }, + "UnauthorizedError": { + "name": "UnauthorizedError", + "shortname": "UnauthorizedError", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/adapter/error", + "namespace": "", + "file": "../adapter/src/error.js", + "line": 230, + "access": "public", + "description": "A `UnauthorizedError` equates to a HTTP `401 Unauthorized` response\nstatus. It is used by an adapter to signal that a request to the external\nAPI was rejected because authorization is required and has failed or has not\nyet been provided.\n\nAn example use case would be to redirect the user to a login route if a\nrequest is unauthorized:\n\n```app/routes/application.js\nimport Route from '@ember/routing/route';\nimport { UnauthorizedError } from '@ember-data/adapter/error';\nimport { action } from '@ember/object';\n\nexport default class ApplicationRoute extends Route {\n @action error(error, transition) {\n if (error instanceof UnauthorizedError) {\n // go to the login route\n this.transitionTo('login');\n return;\n }\n\n // ...other error handling logic\n }\n}\n```\n", + "tagname": "", + "extends": "AdapterError" + }, + "ForbiddenError": { + "name": "ForbiddenError", + "shortname": "ForbiddenError", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/adapter/error", + "namespace": "", + "file": "../adapter/src/error.js", + "line": 265, + "description": "A `ForbiddenError` equates to a HTTP `403 Forbidden` response status.\nIt is used by an adapter to signal that a request to the external API was\nvalid but the server is refusing to respond to it. If authorization was\nprovided and is valid, then the authenticated user does not have the\nnecessary permissions for the request.", + "access": "public", + "tagname": "", + "extends": "AdapterError" + }, + "NotFoundError": { + "name": "NotFoundError", + "shortname": "NotFoundError", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/adapter/error", + "namespace": "", + "file": "../adapter/src/error.js", + "line": 279, + "access": "public", + "description": "A `NotFoundError` equates to a HTTP `404 Not Found` response status.\nIt is used by an adapter to signal that a request to the external API\nwas rejected because the resource could not be found on the API.\n\nAn example use case would be to detect if the user has entered a route\nfor a specific model that does not exist. For example:\n\n```app/routes/post.js\nimport Route from '@ember/routing/route';\nimport { NotFoundError } from '@ember-data/adapter/error';\nimport { inject as service } from '@ember/service';\nimport { action } from '@ember/object';\n\nexport default class PostRoute extends Route {\n @service store;\n model(params) {\n return this.store.findRecord('post', params.post_id);\n }\n @action error(error, transition) {\n if (error instanceof NotFoundError) {\n // redirect to a list of all posts instead\n this.transitionTo('posts');\n } else {\n // otherwise let the error bubble\n return true;\n }\n }\n}\n```\n", + "tagname": "", + "extends": "AdapterError" + }, + "ConflictError": { + "name": "ConflictError", + "shortname": "ConflictError", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/adapter/error", + "namespace": "", + "file": "../adapter/src/error.js", + "line": 318, + "description": "A `ConflictError` equates to a HTTP `409 Conflict` response status.\nIt is used by an adapter to indicate that the request could not be processed\nbecause of a conflict in the request. An example scenario would be when\ncreating a record with a client-generated ID but that ID is already known\nto the external API.", + "access": "public", + "tagname": "", + "extends": "AdapterError" + }, + "ServerError": { + "name": "ServerError", + "shortname": "ServerError", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/adapter/error", + "namespace": "", + "file": "../adapter/src/error.js", + "line": 332, + "description": "A `ServerError` equates to a HTTP `500 Internal Server Error` response\nstatus. It is used by the adapter to indicate that a request has failed\nbecause of an error in the external API.", + "access": "public", + "tagname": "", + "extends": "AdapterError" + }, + "Adapter": { + "name": "Adapter", + "shortname": "Adapter", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/adapter", + "namespace": "", + "file": "../adapter/src/index.ts", + "line": 197, + "description": "An adapter is an object that receives requests from a store and\ntranslates them into the appropriate action to take against your\npersistence layer. The persistence layer is usually an HTTP API but\nmay be anything, such as the browser's local storage. Typically the\nadapter is not invoked directly instead its functionality is accessed\nthrough the `store`.\n\n> ⚠️ CAUTION you likely want the docs for [ Adapter](/ember-data/release/classes/%3CInterface%3E%20Adapter)\n> as extending this abstract class is unnecessary.\n\n### Creating an Adapter\n\nCreate a new subclass of `Adapter` in the `app/adapters` folder:\n\n```app/adapters/application.js\nimport Adapter from '@ember-data/adapter';\n\nexport default Adapter.extend({\n // ...your code here\n});\n```\n\nModel-specific adapters can be created by putting your adapter\nclass in an `app/adapters/` + `model-name` + `.js` file of the application.\n\n```app/adapters/post.js\nimport Adapter from '@ember-data/adapter';\n\nexport default Adapter.extend({\n // ...Post-specific adapter code goes here\n});\n```\n\n`Adapter` is an abstract base class that you should override in your\napplication to customize it for your backend. The minimum set of methods\nthat you should implement is:\n\n * `findRecord()`\n * `createRecord()`\n * `updateRecord()`\n * `deleteRecord()`\n * `findAll()`\n * `query()`\n\nTo improve the network performance of your application, you can optimize\nyour adapter by overriding these lower-level methods:\n\n * `findMany()`\n\n\nFor an example of the implementation, see `RESTAdapter`, the\nincluded REST adapter.", + "access": "public", + "tagname": "", + "extends": "Ember.EmberObject" + }, + "JSONAPIAdapter": { + "name": "JSONAPIAdapter", + "shortname": "JSONAPIAdapter", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/adapter/json-api", + "namespace": "", + "file": "../adapter/src/json-api.ts", + "line": 19, + "description": "## Overview\n\n
\n

\n ⚠️ This is LEGACY documentation for a feature that is no longer encouraged to be used.\n If starting a new app or thinking of implementing a new adapter, consider writing a\n Handler instead to be used with the RequestManager\n

\n
\n\nThe `JSONAPIAdapter` is an adapter whichtransforms the store's\nrequests into HTTP requests that follow the [JSON API format](http://jsonapi.org/format/).\n\n## JSON API Conventions\n\nThe JSONAPIAdapter uses JSON API conventions for building the URL\nfor a record and selecting the HTTP verb to use with a request. The\nactions you can take on a record map onto the following URLs in the\nJSON API adapter:\n\n\n\n \n \n \n\n\n \n \n \n\n\n \n \n \n\n\n \n \n \n\n\n \n \n \n\n\n \n \n \n\n
\n Action\n \n HTTP Verb\n \n URL\n
\n `store.findRecord('post', 123)`\n \n GET\n \n /posts/123\n
\n `store.findAll('post')`\n \n GET\n \n /posts\n
\n Update `postRecord.save()`\n \n PATCH\n \n /posts/123\n
\n Create `store.createRecord('post').save()`\n \n POST\n \n /posts\n
\n Delete `postRecord.destroyRecord()`\n \n DELETE\n \n /posts/123\n
\n\n## Success and failure\n\nThe JSONAPIAdapter will consider a success any response with a\nstatus code of the 2xx family (\"Success\"), as well as 304 (\"Not\nModified\"). Any other status code will be considered a failure.\n\nOn success, the request promise will be resolved with the full\nresponse payload.\n\nFailed responses with status code 422 (\"Unprocessable Entity\") will\nbe considered \"invalid\". The response will be discarded, except for\nthe `errors` key. The request promise will be rejected with a\n`InvalidError`. This error object will encapsulate the saved\n`errors` value.\n\nAny other status codes will be treated as an adapter error. The\nrequest promise will be rejected, similarly to the invalid case,\nbut with an instance of `AdapterError` instead.\n\n### Endpoint path customization\n\nEndpoint paths can be prefixed with a `namespace` by setting the\nnamespace property on the adapter:\n\n```app/adapters/application.js\nimport JSONAPIAdapter from '@ember-data/adapter/json-api';\n\nexport default class ApplicationAdapter extends JSONAPIAdapter {\n namespace = 'api/1';\n}\n```\nRequests for the `person` model would now target `/api/1/people/1`.\n\n### Host customization\n\nAn adapter can target other hosts by setting the `host` property.\n\n```app/adapters/application.js\nimport JSONAPIAdapter from '@ember-data/adapter/json-api';\n\nexport default class ApplicationAdapter extends JSONAPIAdapter {\n host = 'https://api.example.com';\n}\n```\n\nRequests for the `person` model would now target\n`https://api.example.com/people/1`.", + "since": "1.13.0", + "mainName": "@ember-data/adapter/json-api", + "tag": "main", + "itemtype": "main", + "_main": true, + "access": "public", + "tagname": "", + "is_constructor": 1, + "extends": "RESTAdapter" + }, + "RESTAdapter": { + "name": "RESTAdapter", + "shortname": "RESTAdapter", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/adapter/rest", + "namespace": "", + "file": "../adapter/src/rest.ts", + "line": 69, + "itemtype": "main", + "description": "
\n

\n ⚠️ This is LEGACY documentation for a feature that is no longer encouraged to be used.\n If starting a new app or thinking of implementing a new adapter, consider writing a\n Handler instead to be used with the RequestManager\n

\n
\n\n The REST adapter allows your store to communicate with an HTTP server by\n transmitting JSON via XHR.\n\n This adapter is designed around the idea that the JSON exchanged with\n the server should be conventional. It builds URLs in a manner that follows\n the structure of most common REST-style web services.\n\n ## Success and failure\n\n The REST adapter will consider a success any response with a status code\n of the 2xx family (\"Success\"), as well as 304 (\"Not Modified\"). Any other\n status code will be considered a failure.\n\n On success, the request promise will be resolved with the full response\n payload.\n\n Failed responses with status code 422 (\"Unprocessable Entity\") will be\n considered \"invalid\". The response will be discarded, except for the\n `errors` key. The request promise will be rejected with a `InvalidError`.\n This error object will encapsulate the saved `errors` value.\n\n Any other status codes will be treated as an \"adapter error\". The request\n promise will be rejected, similarly to the \"invalid\" case, but with\n an instance of `AdapterError` instead.\n\n ## JSON Structure\n\n The REST adapter expects the JSON returned from your server to follow\n these conventions.\n\n ### Object Root\n\n The JSON payload should be an object that contains the record inside a\n root property. For example, in response to a `GET` request for\n `/posts/1`, the JSON should look like this:\n\n ```js\n {\n \"posts\": {\n \"id\": 1,\n \"title\": \"I'm Running to Reform the W3C's Tag\",\n \"author\": \"Yehuda Katz\"\n }\n }\n ```\n\n Similarly, in response to a `GET` request for `/posts`, the JSON should\n look like this:\n\n ```js\n {\n \"posts\": [\n {\n \"id\": 1,\n \"title\": \"I'm Running to Reform the W3C's Tag\",\n \"author\": \"Yehuda Katz\"\n },\n {\n \"id\": 2,\n \"title\": \"Rails is omakase\",\n \"author\": \"D2H\"\n }\n ]\n }\n ```\n\n Note that the object root can be pluralized for both a single-object response\n and an array response: the REST adapter is not strict on this. Further, if the\n HTTP server responds to a `GET` request to `/posts/1` (e.g. the response to a\n `findRecord` query) with more than one object in the array, Ember Data will\n only display the object with the matching ID.\n\n ### Conventional Names\n\n Attribute names in your JSON payload should be the camelCased versions of\n the attributes in your Ember.js models.\n\n For example, if you have a `Person` model:\n\n ```app/models/person.js\n import Model, { attr } from '@ember-data/model';\n\n export default Model.extend({\n firstName: attr('string'),\n lastName: attr('string'),\n occupation: attr('string')\n });\n ```\n\n The JSON returned should look like this:\n\n ```js\n {\n \"people\": {\n \"id\": 5,\n \"firstName\": \"Zaphod\",\n \"lastName\": \"Beeblebrox\",\n \"occupation\": \"President\"\n }\n }\n ```\n\n #### Relationships\n\n Relationships are usually represented by ids to the record in the\n relationship. The related records can then be sideloaded in the\n response under a key for the type.\n\n ```js\n {\n \"posts\": {\n \"id\": 5,\n \"title\": \"I'm Running to Reform the W3C's Tag\",\n \"author\": \"Yehuda Katz\",\n \"comments\": [1, 2]\n },\n \"comments\": [{\n \"id\": 1,\n \"author\": \"User 1\",\n \"message\": \"First!\",\n }, {\n \"id\": 2,\n \"author\": \"User 2\",\n \"message\": \"Good Luck!\",\n }]\n }\n ```\n\n If the records in the relationship are not known when the response\n is serialized it's also possible to represent the relationship as a\n URL using the `links` key in the response. Ember Data will fetch\n this URL to resolve the relationship when it is accessed for the\n first time.\n\n ```js\n {\n \"posts\": {\n \"id\": 5,\n \"title\": \"I'm Running to Reform the W3C's Tag\",\n \"author\": \"Yehuda Katz\",\n \"links\": {\n \"comments\": \"/posts/5/comments\"\n }\n }\n }\n ```\n\n ### Errors\n\n If a response is considered a failure, the JSON payload is expected to include\n a top-level key `errors`, detailing any specific issues. For example:\n\n ```js\n {\n \"errors\": {\n \"msg\": \"Something went wrong\"\n }\n }\n ```\n\n This adapter does not make any assumptions as to the format of the `errors`\n object. It will simply be passed along as is, wrapped in an instance\n of `InvalidError` or `AdapterError`. The serializer can interpret it\n afterwards.\n\n ## Customization\n\n ### Endpoint path customization\n\n Endpoint paths can be prefixed with a `namespace` by setting the namespace\n property on the adapter:\n\n ```app/adapters/application.js\n import RESTAdapter from '@ember-data/adapter/rest';\n\n export default class ApplicationAdapter extends RESTAdapter {\n namespace = 'api/1';\n }\n ```\n Requests for the `Person` model would now target `/api/1/people/1`.\n\n ### Host customization\n\n An adapter can target other hosts by setting the `host` property.\n\n ```app/adapters/application.js\n import RESTAdapter from '@ember-data/adapter/rest';\n\n export default class ApplicationAdapter extends RESTAdapter {\n host = 'https://api.example.com';\n }\n ```\n\n ### Headers customization\n\n Some APIs require HTTP headers, e.g. to provide an API key. Arbitrary\n headers can be set as key/value pairs on the `RESTAdapter`'s `headers`\n object and Ember Data will send them along with each ajax request.\n\n\n ```app/adapters/application.js\n import RESTAdapter from '@ember-data/adapter/rest';\n import { computed } from '@ember/object';\n\n export default class ApplicationAdapter extends RESTAdapter {\n headers: computed(function() {\n return {\n 'API_KEY': 'secret key',\n 'ANOTHER_HEADER': 'Some header value'\n };\n }\n }\n ```\n\n `headers` can also be used as a computed property to support dynamic\n headers. In the example below, the `session` object has been\n injected into an adapter by Ember's container.\n\n ```app/adapters/application.js\n import RESTAdapter from '@ember-data/adapter/rest';\n import { computed } from '@ember/object';\n\n export default class ApplicationAdapter extends RESTAdapter {\n headers: computed('session.authToken', function() {\n return {\n 'API_KEY': this.session.authToken,\n 'ANOTHER_HEADER': 'Some header value'\n };\n })\n }\n ```\n\n In some cases, your dynamic headers may require data from some\n object outside of Ember's observer system (for example\n `document.cookie`). You can use the\n [volatile](/api/classes/Ember.ComputedProperty.html?anchor=volatile)\n function to set the property into a non-cached mode causing the headers to\n be recomputed with every request.\n\n ```app/adapters/application.js\n import RESTAdapter from '@ember-data/adapter/rest';\n import { computed } from '@ember/object';\n\n export default class ApplicationAdapter extends RESTAdapter {\n headers: computed(function() {\n return {\n 'API_KEY': document.cookie.match(/apiKey\\=([^;]*)/)['1'],\n 'ANOTHER_HEADER': 'Some header value'\n };\n }).volatile()\n }\n ```\n @mainName @ember-data/adapter/rest\n @tag main\n", + "_main": true, + "access": "public", + "tagname": "", + "is_constructor": 1, + "extends": "Adapter", + "uses": [ + "BuildURLMixin" + ] + }, + "@ember-data/adapter/rest": { + "name": "@ember-data/adapter/rest", + "shortname": "@ember-data/adapter/rest", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/adapter/rest", + "namespace": "" + }, + "InspectorDataAdapter": { + "name": "InspectorDataAdapter", + "shortname": "InspectorDataAdapter", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/debug", + "namespace": "", + "file": "../debug/addon/index.js", + "line": 46, + "description": "Implements `@ember/debug/data-adapter` with for EmberData\nintegration with the ember-inspector.", + "extends": "DataAdapter", + "access": "private", + "tagname": "" + }, + "@ember-data/json-api/request": { + "name": "@ember-data/json-api/request", + "shortname": "@ember-data/json-api/request", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/json-api/request", + "namespace": "" + }, + "Cache": { + "name": "Cache", + "shortname": "Cache", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/json-api", + "namespace": "", + "file": "../json-api/src/-private/cache.ts", + "line": 84, + "description": "A JSON:API Cache implementation.\n\nWhat cache the store uses is configurable. Using a different\nimplementation can be achieved by implementing the store's\ncreateCache hook.\n\nThis is the cache implementation used by `ember-data`.\n\n```js\nimport Cache from '@ember-data/json-api';\nimport Store from '@ember-data/store';\n\nexport default class extends Store {\n createCache(wrapper) {\n return new Cache(wrapper);\n }\n}\n```", + "access": "public", + "tagname": "" + }, + "SnapshotRecordArray": { + "name": "SnapshotRecordArray", + "shortname": "SnapshotRecordArray", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/legacy-compat", + "namespace": "", + "file": "../legacy-compat/src/legacy-network-handler/snapshot-record-array.ts", + "line": 12, + "description": "SnapshotRecordArray is not directly instantiable.\nInstances are provided to consuming application's\nadapters for certain requests.", + "access": "public", + "tagname": "" + }, + "Snapshot": { + "name": "Snapshot", + "shortname": "Snapshot", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/store", + "namespace": "", + "file": "../legacy-compat/src/legacy-network-handler/snapshot.ts", + "line": 23, + "description": "Snapshot is not directly instantiable.\nInstances are provided to a consuming application's\nadapters and serializers for certain requests.\n\nSnapshots are only available when using `@ember-data/legacy-compat`\nfor legacy compatibility with adapters and serializers.", + "access": "public", + "tagname": "" + }, + "BelongsToReference": { + "name": "BelongsToReference", + "shortname": "BelongsToReference", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/model", + "namespace": "", + "file": "../model/src/-private/references/belongs-to.ts", + "line": 42, + "description": "A `BelongsToReference` is a low-level API that allows users and\naddon authors to perform meta-operations on a belongs-to\nrelationship.", + "access": "public", + "tagname": "" + }, + "HasManyReference": { + "name": "HasManyReference", + "shortname": "HasManyReference", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/model", + "namespace": "", + "file": "../model/src/-private/references/has-many.ts", + "line": 46, + "description": "A `HasManyReference` is a low-level API that allows users and addon\nauthors to perform meta-operations on a has-many relationship.", + "access": "public", + "tagname": "", + "extends": "Reference" + }, + "@ember-data/model": { + "name": "@ember-data/model", + "shortname": "@ember-data/model", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/model", + "namespace": "" + }, + "Errors": { + "name": "Errors", + "shortname": "Errors", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/model", + "namespace": "", + "file": "../model/src/-private/errors.ts", + "line": 29, + "access": "public", + "description": "Holds validation errors for a given record, organized by attribute names.\n\nThis class is not directly instantiable.\n\nEvery `Model` has an `errors` property that is an instance of\n`Errors`. This can be used to display validation error\nmessages returned from the server when a `record.save()` rejects.\n\nFor Example, if you had a `User` model that looked like this:\n\n```app/models/user.js\nimport Model, { attr } from '@ember-data/model';\n\nexport default class UserModel extends Model {\n @attr('string') email;\n}\n```\nAnd you attempted to save a record that did not validate on the backend:\n\n```javascript\nlet user = store.createRecord('user', {\n username: 'tomster',\n email: 'invalidEmail'\n});\nuser.save();\n```\n\nYour backend would be expected to return an error response that described\nthe problem, so that error messages can be generated on the app.\n\nAPI responses will be translated into instances of `Errors` differently,\ndepending on the specific combination of adapter and serializer used. You\nmay want to check the documentation or the source code of the libraries\nthat you are using, to know how they expect errors to be communicated.\n\nErrors can be displayed to the user by accessing their property name\nto get an array of all the error objects for that property. Each\nerror object is a JavaScript object with two keys:\n\n- `message` A string containing the error message from the backend\n- `attribute` The name of the property associated with this error message\n\n```handlebars\n\n{{#each @model.errors.username as |error|}}\n
\n {{error.message}}\n
\n{{/each}}\n\n\n{{#each @model.errors.email as |error|}}\n
\n {{error.message}}\n
\n{{/each}}\n```\n\nYou can also access the special `messages` property on the error\nobject to get an array of all the error strings.\n\n```handlebars\n{{#each @model.errors.messages as |message|}}\n
\n {{message}}\n
\n{{/each}}\n```\n", + "tagname": "", + "extends": "Ember.ArrayProxy" + }, + "ManyArray": { + "name": "ManyArray", + "shortname": "ManyArray", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/store", + "namespace": "", + "file": "../model/src/-private/many-array.ts", + "line": 43, + "access": "public", + "description": "A `ManyArray` is a `MutableArray` that represents the contents of a has-many\nrelationship.\n\nThe `ManyArray` is instantiated lazily the first time the relationship is\nrequested.\n\nThis class is not intended to be directly instantiated by consuming applications.\n\n### Inverses\n\nOften, the relationships in Ember Data applications will have\nan inverse. For example, imagine the following models are\ndefined:\n\n```app/models/post.js\nimport Model, { hasMany } from '@ember-data/model';\n\nexport default class PostModel extends Model {\n @hasmany('comment') comments;\n}\n```\n\n```app/models/comment.js\nimport Model, { belongsTo } from '@ember-data/model';\n\nexport default class CommentModel extends Model {\n @belongsto('post') post;\n}\n```\n\nIf you created a new instance of `Post` and added\na `Comment` record to its `comments` has-many\nrelationship, you would expect the comment's `post`\nproperty to be set to the post that contained\nthe has-many.\n\nWe call the record to which a relationship belongs-to the\nrelationship's _owner_.\n", + "tagname": "" + }, + "Model": { + "name": "Model", + "shortname": "Model", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/model", + "namespace": "", + "file": "../model/src/-private/model.js", + "line": 99, + "access": "public", + "description": "Base class from which Models can be defined.\n\n```js\nimport Model, { attr } from '@ember-data/model';\n\nexport default class User extends Model {\n @attr name;\n}\n```\n", + "tagname": "", + "extends": "Ember.EmberObject" + }, + "PromiseBelongsTo": { + "name": "PromiseBelongsTo", + "shortname": "PromiseBelongsTo", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/model", + "namespace": "", + "file": "../model/src/-private/promise-belongs-to.ts", + "line": 39, + "description": "A PromiseBelongsTo is a PromiseObject that also proxies certain method calls\nto the underlying belongsTo model.\nRight now we proxy:\n * `reload()`", + "extends": "PromiseObject", + "access": "private", + "tagname": "" + }, + "PromiseManyArray": { + "name": "PromiseManyArray", + "shortname": "PromiseManyArray", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/model", + "namespace": "", + "file": "../model/src/-private/promise-many-array.ts", + "line": 20, + "description": "This class is returned as the result of accessing an async hasMany relationship\non an instance of a Model extending from `@ember-data/model`.\n\nA PromiseManyArray is an iterable proxy that allows templates to consume related\nManyArrays and update once their contents are no longer pending.\n\nIn your JS code you should resolve the promise first.\n\n```js\nconst comments = await post.comments;\n```", + "access": "public", + "tagname": "" + }, + "CanaryFeatureFlags": { + "name": "CanaryFeatureFlags", + "shortname": "CanaryFeatureFlags", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/canary-features", + "namespace": "", + "file": "../private-build-infra/virtual-packages/canary-features.js", + "line": 76, + "description": "This is the current list of features used at build time for canary releases.\nIf empty there are no features currently gated by feature flags.\n\nThe valid values are:\n\n- `true` | The feature is **enabled** at all times, and cannot be disabled.\n- `false` | The feature is **disabled** at all times, and cannot be enabled.\n- `null` | The feature is **disabled by default**, but can be enabled via configuration.", + "access": "public", + "tagname": "" + }, + "DebugLogging": { + "name": "DebugLogging", + "shortname": "DebugLogging", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/debug", + "namespace": "", + "file": "../private-build-infra/virtual-packages/debugging.js", + "line": 4, + "description": "Many portions of the internals are helpfully instrumented with logging that can be activated\nat build time. This instrumentation is always removed from production builds or any builds\nthat has not explicitly activated it. To activate it set the appropriate flag to `true`.\n\n```ts\n let app = new EmberApp(defaults, {\n emberData: {\n debug: {\n LOG_PAYLOADS: false, // data store received to update cache with\n LOG_OPERATIONS: false, // updates to cache remote state\n LOG_MUTATIONS: false, // updates to cache local state\n LOG_NOTIFICATIONS: false,\n LOG_REQUESTS: false,\n LOG_REQUEST_STATUS: false,\n LOG_IDENTIFIERS: false,\n LOG_GRAPH: false,\n LOG_INSTANCE_CACHE: false,\n }\n }\n });\n ```", + "access": "public", + "tagname": "" + }, + "CurrentDeprecations": { + "name": "CurrentDeprecations", + "shortname": "CurrentDeprecations", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/deprecations", + "namespace": "", + "file": "../private-build-infra/virtual-packages/deprecations.js", + "line": 79, + "description": "The following list represents deprecations currently active.\n\nSome deprecation flags guard multiple deprecation IDs. All\nassociated IDs are listed.", + "access": "public", + "tagname": "" + }, + "@ember-data/request-utils": { + "name": "@ember-data/request-utils", + "shortname": "@ember-data/request-utils", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/request-utils", + "namespace": "" + }, + "LifetimesService": { + "name": "LifetimesService", + "shortname": "LifetimesService", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/request-utils", + "namespace": "", + "file": "../request-utils/src/index.ts", + "line": 582, + "description": "A basic LifetimesService that can be added to the Store service.\n\nDetermines staleness based on time since the request was last received from the API\nusing the `date` header.\n\nThis allows the Store's CacheHandler to determine if a request is expired and\nshould be refetched upon next request.\n\nThe `Fetch` handler provided by `@ember-data/request/fetch` will automatically\nadd the `date` header to responses if it is not present.\n\nUsage:\n\n```ts\nimport { LifetimesService } from '@ember-data/request-utils';\nimport DataStore from '@ember-data/store';\n\n// ...\n\nexport class Store extends DataStore {\n constructor(args) {\n super(args);\n this.lifetimes = new LifetimesService(this, { apiCacheSoftExpires: 30_000, apiCacheHardExpires: 60_000 });\n }\n}\n```", + "access": "public", + "tagname": "" + }, + "RequestManager": { + "name": "RequestManager", + "shortname": "RequestManager", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/request", + "namespace": "", + "file": "../request/src/-private/manager.ts", + "line": 415, + "description": "```js\nimport RequestManager from '@ember-data/request';\n```\n\nA RequestManager provides a request/response flow in which configured\nhandlers are successively given the opportunity to handle, modify, or\npass-along a request.\n\n```ts\ninterface RequestManager {\n request(req: RequestInfo): Future;\n}\n```\n\nFor example:\n\n```ts\nimport RequestManager from '@ember-data/request';\nimport Fetch from '@ember-data/request/fetch';\nimport Auth from 'ember-simple-auth/ember-data-handler';\nimport Config from './config';\n\nconst { apiUrl } = Config;\n\n// ... create manager\nconst manager = new RequestManager();\nmanager.use([Auth, Fetch]);\n\n// ... execute a request\nconst response = await manager.request({\n url: `${apiUrl}/users`\n});\n```\n\n### Futures\n\nThe return value of `manager.request` is a `Future`, which allows\naccess to limited information about the request while it is still\npending and fulfills with the final state when the request completes.\n\nA `Future` is cancellable via `abort`.\n\nHandlers may optionally expose a `ReadableStream` to the `Future` for\nstreaming data; however, when doing so the future should not resolve\nuntil the response stream is fully read.\n\n```ts\ninterface Future extends Promise> {\n abort(): void;\n\n async getStream(): ReadableStream | null;\n}\n```\n\n### StructuredDocuments\n\nA Future resolves with a `StructuredDataDocument` or rejects with a `StructuredErrorDocument`.\n\n```ts\ninterface StructuredDataDocument {\n request: ImmutableRequestInfo;\n response: ImmutableResponseInfo;\n content: T;\n}\ninterface StructuredErrorDocument extends Error {\n request: ImmutableRequestInfo;\n response: ImmutableResponseInfo;\n error: string | object;\n}\ntype StructuredDocument = StructuredDataDocument | StructuredErrorDocument;\n```", + "access": "public", + "tagname": "" + }, + "Future": { + "name": "Future", + "shortname": "Future", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/request", + "namespace": "", + "file": "../request/src/-private/types.ts", + "line": 66, + "description": "A Future is a Promise which resolves to a StructuredDocument\nwhile providing the ability to `abort` the underlying request,\n`getStream` the response before the outer promise resolves;", + "extends": "Promise", + "access": "public", + "tagname": "" + }, + " Handler": { + "name": " Handler", + "shortname": " Handler", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/request", + "namespace": "", + "file": "../request/src/-private/types.ts", + "line": 205, + "description": "Requests are fulfilled by handlers. A handler receives the request context\nas well as a `next` function with which to pass along a request to the next\nhandler if it so chooses.\n\nA handler may be any object with a `request` method. This allows both stateful and non-stateful\nhandlers to be utilized.\n\nIf a handler calls `next`, it receives a `Future` which resolves to a `StructuredDocument`\nthat it can then compose how it sees fit with its own response.\n\n```ts\ntype NextFn

= (req: RequestInfo) => Future

;\n\ninterface Handler {\n async request(context: RequestContext, next: NextFn

): T;\n}\n```\n\n`RequestContext` contains a readonly version of the RequestInfo as well as a few methods for building up the `StructuredDocument` and `Future` that will be part of the response.\n\n```ts\ninterface RequestContext {\n readonly request: RequestInfo;\n\n setStream(stream: ReadableStream | Promise): void;\n setResponse(response: Response | ResponseInfo): void;\n}\n```\n\nA basic `fetch` handler with support for streaming content updates while\nthe download is still underway might look like the following, where we use\n[`response.clone()`](https://developer.mozilla.org/en-US/docs/Web/API/Response/clone) to `tee` the `ReadableStream` into two streams.\n\nA more efficient handler might read from the response stream, building up the\nresponse content before passing along the chunk downstream.\n\n```ts\nconst FetchHandler = {\n async request(context) {\n const response = await fetch(context.request);\n context.setResponse(reponse);\n context.setStream(response.clone().body);\n\n return response.json();\n }\n}\n```\n\n### Stream Currying\n\n`RequestManager.request` and `next` differ from `fetch` in one **crucial detail** in that the outer Promise resolves only once the response stream has been processed.\n\nFor context, it helps to understand a few of the use-cases that RequestManager\nis intended to allow.\n\n- to manage and return streaming content (such as video files)\n- to fulfill a request from multiple sources or by splitting one request into multiple requests\n - for instance one API call for a user and another for the user's friends\n - or e.g. fulfilling part of the request from one source (one API, in-memory, localStorage, IndexedDB etc.) and the rest from another source (a different API, a WebWorker, etc.)\n- to coalesce multiple requests\n- to decorate a request with additional info\n - e.g. an Auth handler that ensures the correct tokens or headers or cookies are attached.\n\n----\n\n`await fetch()` resolves at the moment headers are received. This allows for the body of the request to be processed as a stream by application\ncode *while chunks are still being received by the browser*.\n\nWhen an app chooses to `await response.json()` what occurs is the browser reads the stream to completion and then returns the result. Additionally, this stream may only be read **once**.\n\nThe `RequestManager` preserves this ability to subscribe to and utilize the stream by either the application or the handler – thereby delivering the full power and flexibility of native APIs – without restricting developers in ways that lead to complicated workarounds.\n\nEach handler may call `setStream` only once, but may do so *at any time* until the promise that the handler returns has resolved. The associated promise returned by calling `future.getStream` will resolve with the stream set by `setStream` if that method is called, or `null` if that method\nhas not been called by the time that the handler's request method has resolved.\n\nHandlers that do not create a stream of their own, but which call `next`, should defensively pipe the stream forward. While this is not required (see automatic currying below) it is better to do so in most cases as otherwise the stream may not become available to downstream handlers or the application until the upstream handler has fully read it.\n\n```ts\ncontext.setStream(future.getStream());\n```\n\nHandlers that either call `next` multiple times or otherwise have reason to create multiple fetch requests should either choose to return no stream, meaningfully combine the streams, or select a single prioritized stream.\n\nOf course, any handler may choose to read and handle the stream, and return either no stream or a different stream in the process.\n\n### Automatic Currying of Stream and Response\n\nIn order to simplify the common case for handlers which decorate a request, if `next` is called only a single time and `setResponse` was never called by the handler, the response set by the next handler in the chain will be applied to that handler's outcome. For instance, this makes the following pattern possible `return (await next()).content;`.\n\nSimilarly, if `next` is called only a single time and neither `setStream` nor `getStream` was called, we automatically curry the stream from the future returned by `next` onto the future returned by the handler.\n\nFinally, if the return value of a handler is a `Future`, we curry `content` and `errors` as well, thus enabling the simplest form `return next()`.\n\nIn the case of the `Future` being returned, `Stream` proxying is automatic and immediate and does not wait for the `Future` to resolve.\n\n### Handler Order\n\nRequest handlers are registered by configuring the manager via `use`\n\n```ts\nconst manager = new RequestManager();\n\nmanager.use([Handler1, Handler2]);\n```\n\nHandlers will be invoked in the order they are registered (\"fifo\", first-in first-out), and may only be registered up until the first request is made. It is recommended but not required to register all handlers at one time in order to ensure explicitly visible handler ordering.", + "access": "public", + "tagname": "" + }, + "Fetch": { + "name": "Fetch", + "shortname": "Fetch", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/request/fetch", + "namespace": "", + "file": "../request/src/fetch.ts", + "line": 35, + "description": "A basic handler which converts a request into a\n`fetch` call presuming the response to be `json`.\n\n```ts\nimport Fetch from '@ember-data/request/fetch';\n\nmanager.use([Fetch]);\n```", + "access": "public", + "tagname": "" + }, + "@ember-data/rest/request": { + "name": "@ember-data/rest/request", + "shortname": "@ember-data/rest/request", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/rest/request", + "namespace": "" + }, + "BooleanTransform": { + "name": "BooleanTransform", + "shortname": "BooleanTransform", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/serializer", + "namespace": "", + "file": "../serializer/src/-private/transforms/boolean.js", + "line": 5, + "access": "public", + "description": "The `BooleanTransform` class is used to serialize and deserialize\nboolean attributes on Ember Data record objects. This transform is\nused when `boolean` is passed as the type parameter to the\n[attr](/ember-data/release/functions/@ember-data%2Fmodel/attr) function.\n\nUsage\n\n```app/models/user.js\nimport Model, { attr } from '@ember-data/model';\n\nexport default class UserModel extends Model {\n @attr('boolean', { allowNull: true }) wantsWeeklyEmail;\n}\n```\n", + "tagname": "" + }, + "DateTransform": { + "name": "DateTransform", + "shortname": "DateTransform", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/serializer", + "namespace": "", + "file": "../serializer/src/-private/transforms/date.js", + "line": 5, + "access": "public", + "description": "The `DateTransform` class is used to serialize and deserialize\ndate attributes on Ember Data record objects. This transform is used\nwhen `date` is passed as the type parameter to the\n[attr](/ember-data/release/functions/@ember-data%2Fmodel/attr) function. It uses the [`ISO 8601`](https://en.wikipedia.org/wiki/ISO_8601)\nstandard.\n\n```app/models/score.js\nimport Model, { attr, belongsTo } from '@ember-data/model';\n\nexport default class ScoreModel extends Model {\n @attr('date') date;\n }\n```\n @belongsto('player') player;\n", + "tagname": "" + }, + "NumberTransform": { + "name": "NumberTransform", + "shortname": "NumberTransform", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/serializer", + "namespace": "", + "file": "../serializer/src/-private/transforms/number.js", + "line": 9, + "access": "public", + "description": "The `NumberTransform` class is used to serialize and deserialize\nnumeric attributes on Ember Data record objects. This transform is\nused when `number` is passed as the type parameter to the\n[attr](/ember-data/release/functions/@ember-data%2Fmodel/attr) function.\n\nUsage\n\n```app/models/score.js\nimport Model, { attr, belongsTo } from '@ember-data/model';\n\nexport default class ScoreModel extends Model {\n @attr('date') date;\n}\n```\n @belongsto('player') player;\n", + "tagname": "" + }, + "StringTransform": { + "name": "StringTransform", + "shortname": "StringTransform", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/serializer", + "namespace": "", + "file": "../serializer/src/-private/transforms/string.js", + "line": 5, + "access": "public", + "description": "The `StringTransform` class is used to serialize and deserialize\nstring attributes on Ember Data record objects. This transform is\nused when `string` is passed as the type parameter to the\n[attr](/ember-data/release/functions/@ember-data%2Fmodel/attr) function.\n\nUsage\n\n```app/models/user.js\nimport Model, { attr, belongsTo } from '@ember-data/model';\n\nexport default class UserModel extends Model {\n @attr('string') email;\n}\n```\n", + "tagname": "" + }, + "Transform": { + "name": "Transform", + "shortname": "Transform", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/serializer", + "namespace": "", + "file": "../serializer/src/-private/transforms/transform.js", + "line": 5, + "access": "public", + "description": "The `Transform` class is used to serialize and deserialize model\nattributes when they are saved or loaded from an\nadapter. Subclassing `Transform` is useful for creating custom\nattributes. All subclasses of `Transform` must implement a\n`serialize` and a `deserialize` method.\n\nExample\n\n```app/transforms/temperature.js\n\n// Converts centigrade in the JSON to fahrenheit in the app\nexport default class TemperatureTransform {\n deserialize(serialized, options) {\n return (serialized * 1.8) + 32;\n }\n\n serialize(deserialized, options) {\n return (deserialized - 32) / 1.8;\n }\n\n static create() {\n return new this();\n }\n}\n```\n\nUsage\n\n```app/models/requirement.js\nimport Model, { attr } from '@ember-data/model';\n\nexport default class RequirementModel extends Model {\n @attr('markdown', {\n markdown: {\n gfm: false,\n sanitize: true\n }\n })\n markdown;\n}\n```\n\n```app/transforms/markdown.js\nexport default class MarkdownTransform {\n serialize(deserialized, options) {\n return deserialized.raw;\n }\n\n deserialize(serialized, options) {\n let markdownOptions = options.markdown || {};\n\n return marked(serialized, markdownOptions);\n }\n\n static create() {\n return new this();\n }\n}\n```\n", + "tagname": "" + }, + "EmbeddedRecordsMixin": { + "name": "EmbeddedRecordsMixin", + "shortname": "EmbeddedRecordsMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/serializer/rest", + "namespace": "", + "file": "../serializer/src/-private/embedded-records-mixin.js", + "line": 10, + "description": "## Using Embedded Records\n\n`EmbeddedRecordsMixin` supports serializing embedded records.\n\nTo set up embedded records, include the mixin when extending a serializer,\nthen define and configure embedded (model) relationships.\n\nNote that embedded records will serialize with the serializer for their model instead of the serializer in which they are defined.\n\nNote also that this mixin does not work with JSONAPISerializer because the JSON:API specification does not describe how to format embedded resources.\n\nBelow is an example of a per-type serializer (`post` type).\n\n```app/serializers/post.js\nimport RESTSerializer, { EmbeddedRecordsMixin } from '@ember-data/serializer/rest';\n\nexport default class PostSerializer extends RESTSerializer.extend(EmbeddedRecordsMixin) {\n attrs = {\n author: { embedded: 'always' },\n comments: { serialize: 'ids' }\n }\n}\n```\nNote that this use of `{ embedded: 'always' }` is unrelated to\nthe `{ embedded: 'always' }` that is defined as an option on `attr` as part of\ndefining a model while working with the `ActiveModelSerializer`. Nevertheless,\nusing `{ embedded: 'always' }` as an option to `attr` is not a valid way to set up\nembedded records.\n\nThe `attrs` option for a resource `{ embedded: 'always' }` is shorthand for:\n\n```js\n{\n serialize: 'records',\n deserialize: 'records'\n}\n```\n\n### Configuring Attrs\n\nA resource's `attrs` option may be set to use `ids`, `records` or false for the\n`serialize` and `deserialize` settings.\n\nThe `attrs` property can be set on the `ApplicationSerializer` or a per-type\nserializer.\n\nIn the case where embedded JSON is expected while extracting a payload (reading)\nthe setting is `deserialize: 'records'`, there is no need to use `ids` when\nextracting as that is the default behaviour without this mixin if you are using\nthe vanilla `EmbeddedRecordsMixin`. Likewise, to embed JSON in the payload while\nserializing `serialize: 'records'` is the setting to use. There is an option of\nnot embedding JSON in the serialized payload by using `serialize: 'ids'`. If you\ndo not want the relationship sent at all, you can use `serialize: false`.\n\n\n### EmbeddedRecordsMixin defaults\nIf you do not overwrite `attrs` for a specific relationship, the `EmbeddedRecordsMixin`\nwill behave in the following way:\n\nBelongsTo: `{ serialize: 'id', deserialize: 'id' }`\nHasMany: `{ serialize: false, deserialize: 'ids' }`\n\n### Model Relationships\n\nEmbedded records must have a model defined to be extracted and serialized. Note that\nwhen defining any relationships on your model such as `belongsTo` and `hasMany`, you\nshould not both specify `async: true` and also indicate through the serializer's\n`attrs` attribute that the related model should be embedded for deserialization.\nIf a model is declared embedded for deserialization (`embedded: 'always'` or `deserialize: 'records'`),\nthen do not use `async: true`.\n\nTo successfully extract and serialize embedded records the model relationships\nmust be set up correctly. See the\n[defining relationships](https://guides.emberjs.com/current/models/relationships)\nsection of the **Defining Models** guide page.\n\nRecords without an `id` property are not considered embedded records, model\ninstances must have an `id` property to be used with Ember Data.\n\n### Example JSON payloads, Models and Serializers\n\n**When customizing a serializer it is important to grok what the customizations\nare. Please read the docs for the methods this mixin provides, in case you need\nto modify it to fit your specific needs.**\n\nFor example, review the docs for each method of this mixin:\n* [normalize](/ember-data/release/classes/EmbeddedRecordsMixin/methods/normalize?anchor=normalize)\n* [serializeBelongsTo](/ember-data/release/classes/EmbeddedRecordsMixin/methods/serializeBelongsTo?anchor=serializeBelongsTo)\n* [serializeHasMany](/ember-data/release/classes/EmbeddedRecordsMixin/methods/serializeHasMany?anchor=serializeHasMany)", + "access": "public", + "tagname": "" + }, + "Serializer": { + "name": "Serializer", + "shortname": "Serializer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/serializer", + "namespace": "", + "file": "../serializer/src/index.ts", + "line": 116, + "description": "> ⚠️ CAUTION you likely want the docs for [ Serializer](/ember-data/release/classes/%3CInterface%3E%20Serializer)\n> as extending this abstract class is unnecessary.\n\n`Serializer` is an abstract base class that you may override in your\napplication to customize it for your backend. The minimum set of methods\nthat you should implement is:\n\n * `normalizeResponse()`\n * `serialize()`\n\nAnd you can optionally override the following methods:\n\n * `normalize()`\n\nFor an example implementation, see\n[JSONSerializer](JSONSerializer), the included JSON serializer.", + "access": "public", + "tagname": "", + "extends": "Ember.EmberObject" + }, + "JSONAPISerializer": { + "name": "JSONAPISerializer", + "shortname": "JSONAPISerializer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/serializer/json-api", + "namespace": "", + "file": "../serializer/src/json-api.js", + "line": 13, + "itemtype": "main", + "description": "

\n

\n ⚠️ This is LEGACY documentation for a feature that is no longer encouraged to be used.\n If starting a new app or thinking of implementing a new adapter, consider writing a\n Handler instead to be used with the RequestManager\n

\n
\n\n In EmberData a Serializer is used to serialize and deserialize\n records when they are transferred in and out of an external source.\n This process involves normalizing property names, transforming\n attribute values and serializing relationships.\n\n `JSONAPISerializer` supports the http://jsonapi.org/ spec and is the\n serializer recommended by Ember Data.\n\n This serializer normalizes a JSON API payload that looks like:\n\n ```app/models/player.js\n import Model, { attr, belongsTo } from '@ember-data/model';\n\n export default class Player extends Model {\n @attr('string') location;\n @belongsto('club') club;\n }\n ```\n\n ```app/models/club.js\n import Model, { attr, hasMany } from '@ember-data/model';\n\n export default class Club extends Model {\n @hasmany('player') players;\n }\n ```\n\n ```js\n {\n \"data\": [\n {\n \"attributes\": {\n \"name\": \"Benfica\",\n \"location\": \"Portugal\"\n },\n \"id\": \"1\",\n \"relationships\": {\n \"players\": {\n \"data\": [\n {\n \"id\": \"3\",\n \"type\": \"players\"\n }\n ]\n }\n },\n \"type\": \"clubs\"\n }\n ],\n \"included\": [\n {\n \"attributes\": {\n \"name\": \"Eusebio Silva Ferreira\",\n \"skill\": \"Rocket shot\",\n \"games-played\": 431\n },\n \"id\": \"3\",\n \"relationships\": {\n \"club\": {\n \"data\": {\n \"id\": \"1\",\n \"type\": \"clubs\"\n }\n }\n },\n \"type\": \"players\"\n }\n ]\n }\n ```\n\n to the format that the Ember Data store expects.\n\n ### Customizing meta\n\n Since a JSON API Document can have meta defined in multiple locations you can\n use the specific serializer hooks if you need to customize the meta.\n\n One scenario would be to camelCase the meta keys of your payload. The example\n below shows how this could be done using `normalizeArrayResponse` and\n `extractRelationship`.\n\n ```app/serializers/application.js\n import JSONAPISerializer from '@ember-data/serializer/json-api';\n\n export default class ApplicationSerializer extends JSONAPISerializer {\n normalizeArrayResponse(store, primaryModelClass, payload, id, requestType) {\n let normalizedDocument = super.normalizeArrayResponse(...arguments);\n\n // Customize document meta\n normalizedDocument.meta = camelCaseKeys(normalizedDocument.meta);\n\n return normalizedDocument;\n }\n\n extractRelationship(relationshipHash) {\n let normalizedRelationship = super.extractRelationship(...arguments);\n\n // Customize relationship meta\n normalizedRelationship.meta = camelCaseKeys(normalizedRelationship.meta);\n\n return normalizedRelationship;\n }\n }\n ```\n @mainName @ember-data/serializer/json-api\n @tag main\n", + "_main": true, + "since": "1.13.0", + "access": "public", + "tagname": "", + "extends": "JSONSerializer" + }, + "JSONSerializer": { + "name": "JSONSerializer", + "shortname": "JSONSerializer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/serializer/json", + "namespace": "", + "file": "../serializer/src/json.js", + "line": 17, + "itemtype": "main", + "description": "
\n

\n ⚠️ This is LEGACY documentation for a feature that is no longer encouraged to be used.\n If starting a new app or thinking of implementing a new adapter, consider writing a\n Handler instead to be used with the RequestManager\n

\n
\n\n In EmberData a Serializer is used to serialize and deserialize\n records when they are transferred in and out of an external source.\n This process involves normalizing property names, transforming\n attribute values and serializing relationships.\n\n By default, EmberData uses and recommends the `JSONAPISerializer`.\n\n `JSONSerializer` is useful for simpler or legacy backends that may\n not support the http://jsonapi.org/ spec.\n\n For example, given the following `User` model and JSON payload:\n\n ```app/models/user.js\n import Model, { attr, belongsTo, hasMany } from '@ember-data/model';\n\n export default class UserModel extends Model {\n @hasmany('user') friends;\n @belongsto('location') house;\n @attr('string') name;\n }\n ```\n\n ```js\n {\n id: 1,\n name: 'Sebastian',\n friends: [3, 4],\n links: {\n house: '/houses/lefkada'\n }\n }\n ```\n\n `JSONSerializer` will normalize the JSON payload to the JSON API format that the\n Ember Data store expects.\n\n You can customize how JSONSerializer processes its payload by passing options in\n the `attrs` hash or by subclassing the `JSONSerializer` and overriding hooks:\n\n - To customize how a single record is normalized, use the `normalize` hook.\n - To customize how `JSONSerializer` normalizes the whole server response, use the\n `normalizeResponse` hook.\n - To customize how `JSONSerializer` normalizes a specific response from the server,\n use one of the many specific `normalizeResponse` hooks.\n - To customize how `JSONSerializer` normalizes your id, attributes or relationships,\n use the `extractId`, `extractAttributes` and `extractRelationships` hooks.\n\n The `JSONSerializer` normalization process follows these steps:\n\n 1. `normalizeResponse`\n - entry method to the serializer.\n 2. `normalizeCreateRecordResponse`\n - a `normalizeResponse` for a specific operation is called.\n 3. `normalizeSingleResponse`|`normalizeArrayResponse`\n - for methods like `createRecord` we expect a single record back, while for methods like `findAll` we expect multiple records back.\n 4. `normalize`\n - `normalizeArrayResponse` iterates and calls `normalize` for each of its records while `normalizeSingle`\n calls it once. This is the method you most likely want to subclass.\n 5. `extractId` | `extractAttributes` | `extractRelationships`\n - `normalize` delegates to these methods to\n turn the record payload into the JSON API format.\n @mainName @ember-data/serializer/json\n @tag main\n", + "_main": true, + "access": "public", + "tagname": "", + "extends": "Serializer" + }, + "RESTSerializer": { + "name": "RESTSerializer", + "shortname": "RESTSerializer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/serializer/rest", + "namespace": "", + "file": "../serializer/src/rest.js", + "line": 18, + "itemtype": "main", + "description": "
\n

\n ⚠️ This is LEGACY documentation for a feature that is no longer encouraged to be used.\n If starting a new app or thinking of implementing a new adapter, consider writing a\n Handler instead to be used with the RequestManager\n

\n
\n\n Normally, applications will use the `RESTSerializer` by implementing\n the `normalize` method.\n\n This allows you to do whatever kind of munging you need and is\n especially useful if your server is inconsistent and you need to\n do munging differently for many different kinds of responses.\n\n See the `normalize` documentation for more information.\n\n ## Across the Board Normalization\n\n There are also a number of hooks that you might find useful to define\n across-the-board rules for your payload. These rules will be useful\n if your server is consistent, or if you're building an adapter for\n an infrastructure service, like Firebase, and want to encode service\n conventions.\n\n For example, if all of your keys are underscored and all-caps, but\n otherwise consistent with the names you use in your models, you\n can implement across-the-board rules for how to convert an attribute\n name in your model to a key in your JSON.\n\n ```app/serializers/application.js\n import RESTSerializer from '@ember-data/serializer/rest';\n import { underscore } from '/utils/string-utils';\n\n export default class ApplicationSerializer extends RESTSerializer {\n keyForAttribute(attr, method) {\n return underscore(attr).toUpperCase();\n }\n }\n ```\n\n You can also implement `keyForRelationship`, which takes the name\n of the relationship as the first parameter, the kind of\n relationship (`hasMany` or `belongsTo`) as the second parameter, and\n the method (`serialize` or `deserialize`) as the third parameter.\n @mainName @ember-data/serializer/rest\n @tag main\n", + "_main": true, + "access": "public", + "tagname": "", + "extends": "JSONSerializer" + }, + "IdentifierCache": { + "name": "IdentifierCache", + "shortname": "IdentifierCache", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/store", + "namespace": "", + "file": "../store/src/-private/caches/identifier-cache.ts", + "line": 214, + "description": "Each instance of {Store} receives a unique instance of a IdentifierCache.\n\nThis cache is responsible for assigning or retrieving the unique identify\nfor arbitrary resource data encountered by the store. Data representing\na unique resource or record should always be represented by the same\nidentifier.\n\nIt can be configured by consuming applications.", + "access": "public", + "tagname": "" + }, + "RecordReference": { + "name": "RecordReference", + "shortname": "RecordReference", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/store", + "namespace": "", + "file": "../store/src/-private/legacy-model-support/record-reference.ts", + "line": 18, + "description": "A `RecordReference` is a low-level API that allows users and\naddon authors to perform meta-operations on a record.", + "access": "public", + "tagname": "", + "extends": "Reference" + }, + "CacheManager": { + "name": "CacheManager", + "shortname": "CacheManager", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/store", + "namespace": "", + "file": "../store/src/-private/managers/cache-manager.ts", + "line": 21, + "description": "The CacheManager wraps a Cache enforcing that only\nthe public API surface area is exposed.\n\nHence, it is the value of `Store.cache`, wrapping\nthe cache instance returned by `Store.createCache`.\n\nIt handles translating between cache versions when\nnecessary, for instance when a Store is configured\nto use both a v1 and a v2 cache depending on some\nheuristic.\n\nStarting with the v2 spec, the cache is designed such\nthat it must be implemented as a singleton.", + "access": "public", + "tagname": "" + }, + "NotificationManager": { + "name": "NotificationManager", + "shortname": "NotificationManager", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/store", + "namespace": "", + "file": "../store/src/-private/managers/notification-manager.ts", + "line": 71, + "description": "The NotificationManager provides the ability to subscribe to\nchanges to Cache state.\n\nThis Feature is what allows EmberData to create subscriptions that\nwork with any framework or change-notification system.", + "access": "public", + "tagname": "" + }, + "RequestStateService": { + "name": "RequestStateService", + "shortname": "RequestStateService", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/store", + "namespace": "", + "file": "../store/src/-private/network/request-cache.ts", + "line": 34, + "description": "The RequestStateService is used to track the state of requests\nfor fetching or updating known resource identifies that are inflight.", + "access": "public", + "tagname": "" + }, + "RecordArray": { + "name": "RecordArray", + "shortname": "RecordArray", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/store", + "namespace": "", + "file": "../store/src/-private/record-arrays/identifier-array.ts", + "line": 156, + "description": "A record array is an array that contains records of a certain type (or modelName).\nThe record array materializes records as needed when they are retrieved for the first\ntime. You should not create record arrays yourself. Instead, an instance of\n`RecordArray` or its subclasses will be returned by your application's store\nin response to queries.\n\nThis class should not be imported and instantiated by consuming applications.", + "access": "public", + "tagname": "" + }, + "Store": { + "name": "Store", + "shortname": "Store", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/store", + "namespace": "", + "file": "../store/src/-private/store-service.ts", + "line": 71, + "description": "A Store coordinates interaction between your application, a [Cache](https://api.emberjs.com/ember-data/release/classes/%3CInterface%3E%20Cache),\nand sources of data (such as your API or a local persistence layer)\naccessed via a [RequestManager](https://github.com/emberjs/data/tree/main/packages/request).\n\n```app/services/store.js\nimport Store from '@ember-data/store';\n\nexport default class extends Store {}\n```\n\nMost Ember applications will only have a single `Store` configured as a Service\nin this manner. However, setting up multiple stores is possible, including using\neach as a unique service.", + "access": "public", + "tagname": "" + }, + "@ember-data/tracking": { + "name": "@ember-data/tracking", + "shortname": "@ember-data/tracking", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember-data/tracking", + "namespace": "" + } + }, + "elements": {}, + "classitems": [ + { + "file": "../ember-data-types/cache/cache.ts", + "line": 41, + "description": "The Cache Version that this implementation implements.", + "type": "{'2'}", + "access": "public", + "tagname": "", + "itemtype": "property", + "name": "version", + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 53, + "description": "Cache the response to a request\n\nUnlike `store.push` which has UPSERT\nsemantics, `put` has `replace` semantics similar to\nthe `http` method `PUT`\n\nthe individually cacheable resource data it may contain\nshould upsert, but the document data surrounding it should\nfully replace any existing information\n\nNote that in order to support inserting arbitrary data\nto the cache that did not originate from a request `put`\nshould expect to sometimes encounter a document with only\na `content` member and therefor must not assume the existence\nof `request` and `response` on the document.", + "itemtype": "method", + "name": "put", + "params": [ + { + "name": "doc", + "description": "", + "type": "StructuredDocument" + } + ], + "return": { + "description": "", + "type": "ResourceDocument" + }, + "access": "public", + "tagname": "", + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 77, + "description": "Update the \"remote\" or \"canonical\" (persisted) state of the Cache\nby merging new information into the existing state.\n\nNote: currently the only valid resource operation is a MergeOperation\nwhich occurs when a collision of identifiers is detected.", + "itemtype": "method", + "name": "patch", + "access": "public", + "tagname": "", + "params": [ + { + "name": "op", + "description": "the operation to perform", + "type": "Operation" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 91, + "description": "Update the \"local\" or \"current\" (unpersisted) state of the Cache", + "itemtype": "method", + "name": "mutate", + "params": [ + { + "name": "mutation", + "description": "", + "type": "Mutation" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "access": "public", + "tagname": "", + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 101, + "description": "Peek resource data from the Cache.\n\nIn development, if the return value\nis JSON the return value\nwill be deep-cloned and deep-frozen\nto prevent mutation thereby enforcing cache\nImmutability.\n\nThis form of peek is useful for implementations\nthat want to feed raw-data from cache to the UI\nor which want to interact with a blob of data\ndirectly from the presentation cache.\n\nAn implementation might want to do this because\nde-referencing records which read from their own\nblob is generally safer because the record does\nnot require retainining connections to the Store\nand Cache to present data on a per-field basis.\n\nThis generally takes the place of `getAttr` as\nan API and may even take the place of `getRelationship`\ndepending on implementation specifics, though this\nlatter usage is less recommended due to the advantages\nof the Graph handling necessary entanglements and\nnotifications for relational data.", + "itemtype": "method", + "name": "peek", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "", + "type": "StableRecordIdentifier | StableDocumentIdentifier" + } + ], + "return": { + "description": "the known resource data", + "type": "ResourceDocument | ResourceBlob | null" + }, + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 136, + "description": "Peek the Cache for the existing request data associated with\na cacheable request", + "itemtype": "method", + "name": "peekRequest", + "params": [ + { + "name": "UNKNOWN", + "description": "", + "type": "StableDocumentIdentifier" + } + ], + "return": { + "description": "", + "type": "StableDocumentIdentifier | null" + }, + "access": "public", + "tagname": "", + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 147, + "description": "Push resource data from a remote source into the cache for this identifier", + "itemtype": "method", + "name": "upsert", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "data", + "description": "" + }, + { + "name": "hasRecord", + "description": "" + } + ], + "return": { + "description": "if `hasRecord` is true then calculated key changes should be returned", + "type": "Void | string[]" + }, + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 162, + "description": "Create a fork of the cache from the current state.\n\nApplications should typically not call this method themselves,\npreferring instead to fork at the Store level, which will\nutilize this method to fork the cache.", + "itemtype": "method", + "name": "fork", + "access": "public", + "tagname": "", + "return": { + "description": "Promise" + }, + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 175, + "description": "Merge a fork back into a parent Cache.\n\nApplications should typically not call this method themselves,\npreferring instead to merge at the Store level, which will\nutilize this method to merge the caches.", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "cache", + "description": "", + "type": "Cache" + } + ], + "access": "public", + "tagname": "", + "return": { + "description": "Promise" + }, + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 189, + "description": "Generate the list of changes applied to all\nrecord in the store.\n\nEach individual resource or document that has\nbeen mutated should be described as an individual\n`Change` entry in the returned array.\n\nA `Change` is described by an object containing up to\nthree properties: (1) the `identifier` of the entity that\nchanged; (2) the `op` code of that change being one of\n`upsert` or `remove`, and if the op is `upsert` a `patch`\ncontaining the data to merge into the cache for the given\nentity.\n\nThis `patch` is opaque to the Store but should be understood\nby the Cache and may expect to be utilized by an Adapter\nwhen generating data during a `save` operation.\n\nIt is generally recommended that the `patch` contain only\nthe updated state, ignoring fields that are unchanged\n\n```ts\ninterface Change {\n identifier: StableRecordIdentifier | StableDocumentIdentifier;\n op: 'upsert' | 'remove';\n patch?: unknown;\n}\n```", + "itemtype": "method", + "name": "diff", + "access": "public", + "tagname": "", + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 227, + "description": "Serialize the entire contents of the Cache into a Stream\nwhich may be fed back into a new instance of the same Cache\nvia `cache.hydrate`.", + "itemtype": "method", + "name": "dump", + "return": { + "description": "", + "type": "Promise" + }, + "access": "public", + "tagname": "", + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 238, + "description": "hydrate a Cache from a Stream with content previously serialized\nfrom another instance of the same Cache, resolving when hydration\nis complete.\n\nThis method should expect to be called both in the context of restoring\nthe Cache during application rehydration after SSR **AND** at unknown\ntimes during the lifetime of an already booted application when it is\ndesired to bulk-load additional information into the cache. This latter\nbehavior supports optimizing pre/fetching of data for route transitions\nvia data-only SSR modes.", + "itemtype": "method", + "name": "hydrate", + "params": [ + { + "name": "stream", + "description": "", + "type": "ReadableStream" + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "access": "public", + "tagname": "", + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 260, + "description": "[LIFECYCLE] Signal to the cache that a new record has been instantiated on the client\n\nIt returns properties from options that should be set on the record during the create\nprocess. This return value behavior is deprecated.", + "itemtype": "method", + "name": "clientDidCreate", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "createArgs", + "description": "" + } + ], + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 273, + "description": "[LIFECYCLE] Signals to the cache that a resource\nwill be part of a save transaction.", + "itemtype": "method", + "name": "willCommit", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 283, + "description": "[LIFECYCLE] Signals to the cache that a resource\nwas successfully updated as part of a save transaction.", + "itemtype": "method", + "name": "didCommit", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "- the primary identifier that was operated on" + }, + { + "name": "data", + "description": "- a document in the cache format containing any updated data" + } + ], + "return": { + "description": "", + "type": "SingleResourceDataDocument" + }, + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 295, + "description": "[LIFECYCLE] Signals to the cache that a resource\nwas update via a save transaction failed.", + "itemtype": "method", + "name": "commitWasRejected", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "errors", + "description": "" + } + ], + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 306, + "description": "[LIFECYCLE] Signals to the cache that all data for a resource\nshould be cleared.\n\nThis method is a candidate to become a mutation", + "itemtype": "method", + "name": "unloadRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 321, + "description": "Retrieve the data for an attribute from the cache", + "itemtype": "method", + "name": "getAttr", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "field", + "description": "" + } + ], + "return": { + "description": "", + "type": "Unknown" + }, + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 332, + "description": "Mutate the data for an attribute in the cache\n\nThis method is a candidate to become a mutation", + "itemtype": "method", + "name": "setAttr", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "field", + "description": "" + }, + { + "name": "value", + "description": "" + } + ], + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 345, + "description": "Query the cache for the changed attributes of a resource.\n\nReturns a map of field names to tuples of [old, new] values\n\n```\n{ : [, ] }\n```", + "itemtype": "method", + "name": "changedAttrs", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "return": { + "description": "{ : [, ] }", + "type": "Record" + }, + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 361, + "description": "Query the cache for whether any mutated attributes exist", + "itemtype": "method", + "name": "hasChangedAttrs", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 371, + "description": "Tell the cache to discard any uncommitted mutations to attributes\n\nThis method is a candidate to become a mutation", + "itemtype": "method", + "name": "rollbackAttrs", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "return": { + "description": "the names of fields that were restored", + "type": "String[]" + }, + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 383, + "description": "Query the cache for the changes to relationships of a resource.\n\nReturns a map of relationship names to RelationshipDiff objects.\n\n```ts\ntype RelationshipDiff =\n | {\n kind: 'collection';\n remoteState: StableRecordIdentifier[];\n additions: Set;\n removals: Set;\n localState: StableRecordIdentifier[];\n reordered: boolean;\n }\n | {\n kind: 'resource';\n remoteState: StableRecordIdentifier | null;\n localState: StableRecordIdentifier | null;\n };\n ```", + "itemtype": "method", + "name": "changedRelationships", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "", + "type": "StableRecordIdentifier" + } + ], + "return": { + "description": "", + "type": "Map" + }, + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 412, + "description": "Query the cache for whether any mutated attributes exist", + "itemtype": "method", + "name": "hasChangedRelationships", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "", + "type": "StableRecordIdentifier" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 422, + "description": "Tell the cache to discard any uncommitted mutations to relationships.\n\nThis will also discard the change on any appropriate inverses.\n\nThis method is a candidate to become a mutation", + "itemtype": "method", + "name": "rollbackRelationships", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "", + "type": "StableRecordIdentifier" + } + ], + "return": { + "description": "the names of relationships that were restored", + "type": "String[]" + }, + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 436, + "description": "Query the cache for the current state of a relationship property", + "itemtype": "method", + "name": "getRelationship", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "", + "type": "StableRecordIdentifier" + }, + { + "name": "field", + "description": "", + "type": "String" + } + ], + "return": { + "description": "resource relationship object" + }, + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 454, + "description": "Update the cache state for the given resource to be marked\nas locally deleted, or remove such a mark.\n\nThis method is a candidate to become a mutation", + "itemtype": "method", + "name": "setIsDeleted", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "isDeleted", + "description": "", + "type": "Boolean" + } + ], + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 467, + "description": "Query the cache for any validation errors applicable to the given resource.", + "itemtype": "method", + "name": "getErrors", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "return": { + "description": "", + "type": "JsonApiError[]" + }, + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 477, + "description": "Query the cache for whether a given resource has any available data", + "itemtype": "method", + "name": "isEmpty", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 487, + "description": "Query the cache for whether a given resource was created locally and not\nyet persisted.", + "itemtype": "method", + "name": "isNew", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 498, + "description": "Query the cache for whether a given resource is marked as deleted (but not\nnecessarily persisted yet).", + "itemtype": "method", + "name": "isDeleted", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/cache/cache.ts", + "line": 509, + "description": "Query the cache for whether a given resource has been deleted and that deletion\nhas also been persisted.", + "itemtype": "method", + "name": "isDeletionCommitted", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": " Cache", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/q/cache-store-wrapper.ts", + "line": 26, + "description": "Provides access to the IdentifierCache instance\nfor this Store instance.\n\nThe IdentifierCache can be used to peek, generate or\nretrieve a stable unique identifier for any resource.", + "itemtype": "property", + "name": "identifierCache", + "type": "IdentifierCache", + "access": "public", + "tagname": "", + "class": "CacheCapabilitiesManager", + "module": "@ember-data/store" + }, + { + "file": "../ember-data-types/q/cache-store-wrapper.ts", + "line": 38, + "description": "Provides access to the SchemaDefinitionService instance\nfor this Store instance.\n\nThe SchemaDefinitionService can be used to query for\ninformation about the schema of a resource.", + "itemtype": "method", + "name": "getSchemaDefinitionService", + "access": "public", + "tagname": "", + "class": "CacheCapabilitiesManager", + "module": "@ember-data/store" + }, + { + "file": "../ember-data-types/q/cache-store-wrapper.ts", + "line": 50, + "description": "Update the `id` for the record corresponding to the identifier\nThis operation can only be done for records whose `id` is `null`.", + "itemtype": "method", + "name": "setRecordId", + "params": [ + { + "name": "identifier;", + "description": "", + "type": "StableRecordIdentifier" + }, + { + "name": "id;", + "description": "", + "type": "String" + } + ], + "access": "public", + "tagname": "", + "class": "CacheCapabilitiesManager", + "module": "@ember-data/store" + }, + { + "file": "../ember-data-types/q/cache-store-wrapper.ts", + "line": 61, + "description": "Signal to the store that the specified record may be considered fully\nremoved from the cache. Generally this means that not only does no\ndata exist for the identified resource, no known relationships still\npoint to it either.", + "itemtype": "method", + "name": "disconnectRecord", + "params": [ + { + "name": "identifier", + "description": "", + "type": "StableRecordIdentifier" + } + ], + "access": "public", + "tagname": "", + "class": "CacheCapabilitiesManager", + "module": "@ember-data/store" + }, + { + "file": "../ember-data-types/q/cache-store-wrapper.ts", + "line": 73, + "description": "Use this method to determine if the Store has an instantiated record associated\nwith an identifier.", + "itemtype": "method", + "name": "hasRecord", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "CacheCapabilitiesManager", + "module": "@ember-data/store" + }, + { + "file": "../ember-data-types/q/cache-store-wrapper.ts", + "line": 84, + "description": "Notify subscribers of the NotificationManager that cache state has changed.\n\n`attributes` and `relationships` do not require a key, but if one is specified it\nis assumed to be the name of the attribute or relationship that has been updated.\n\nNo other namespaces currently expect the `key` argument.", + "itemtype": "method", + "name": "notifyChange", + "params": [ + { + "name": "identifier", + "description": "", + "type": "StableRecordIdentifier" + }, + { + "name": "namespace", + "description": "", + "type": "'attributes' | 'relationships' | 'identity' | 'errors' | 'meta' | 'state'" + }, + { + "name": "key", + "description": "", + "type": "String|undefined" + } + ], + "access": "public", + "tagname": "", + "class": "CacheCapabilitiesManager", + "module": "@ember-data/store" + }, + { + "file": "../ember-data-types/q/identifier.ts", + "line": 102, + "description": "A string representing a unique identity.", + "itemtype": "property", + "name": "lid", + "type": "String", + "access": "public", + "tagname": "", + "class": "StableRecordIdentifier", + "module": "@ember-data/store" + }, + { + "file": "../ember-data-types/q/identifier.ts", + "line": 108, + "description": "the primary resource `type` or `modelName` this identity belongs to.", + "itemtype": "property", + "name": "type", + "type": "String", + "access": "public", + "tagname": "", + "class": "StableRecordIdentifier", + "module": "@ember-data/store" + }, + { + "file": "../ember-data-types/q/identifier.ts", + "line": 114, + "description": "the primary id for the record this identity belongs to. `null`\nif not yet assigned an id.", + "itemtype": "property", + "name": "id", + "type": "String | null", + "access": "public", + "tagname": "", + "class": "StableRecordIdentifier", + "module": "@ember-data/store" + }, + { + "file": "../ember-data-types/q/identifier.ts", + "line": 123, + "description": "Configures how unique identifier lid strings are generated by @ember-data/store.\n\nThis configuration MUST occur prior to the store instance being created.\n\nTakes a method which can expect to receive various data as its first argument\nand the name of a bucket as its second argument.\n\nCurrently there are two buckets, 'record' and 'document'.\n\n### Resource (`Record`) Identity\n\nIf the bucket is `record` the method must return a unique (to at-least\nthe given bucket) string identifier for the given data as a string to be\nused as the `lid` of an `Identifier` token.\n\nThis method will only be called by either `getOrCreateRecordIdentifier` or\n`createIdentifierForNewRecord` when an identifier for the supplied data\nis not already known via `lid` or `type + id` combo and one needs to be\ngenerated or retrieved from a proprietary cache.\n\n`data` will be the same data argument provided to `getOrCreateRecordIdentifier`\nand in the `createIdentifierForNewRecord` case will be an object with\nonly `type` as a key.\n\n```ts\nimport { setIdentifierGenerationMethod } from '@ember-data/store';\n\nexport function initialize(applicationInstance) {\n // note how `count` here is now scoped to the application instance\n // for our generation method by being inside the closure provided\n // by the initialize function\n let count = 0;\n\n setIdentifierGenerationMethod((resource, bucket) => {\n return resource.lid || `my-key-${count++}`;\n });\n}\n\nexport default {\n name: 'configure-ember-data-identifiers',\n initialize\n};\n```\n\n### Document Identity\n\nIf the bucket is `document` the method will receive the associated\nimmutable `request` passed to `store.request` as its first argument\nand should return a unique string for the given request if the document\nshould be cached, and `null` if it should not be cached.\n\nNote, the request result will still be passed to the cache via `Cache.put`,\nbut caches should take this as a signal that the document should not itself\nbe cached, while its contents may still be used to update other cache state.\n\nThe presence of `cacheOptions.key` on the request will take precedence\nfor the document cache key, and this method will not be called if it is\npresent.\n\nThe default method implementation for this bucket is to return `null`\nfor all requests whose method is not `GET`, and to return the `url` for\nthose where it is.\n\nThis means that queries via `POST` MUST provide `cacheOptions.key` or\nimplement this hook.\n\n⚠️ Caution: Requests that do not have a `method` assigned are assumed to be `GET`", + "itemtype": "method", + "name": "setIdentifierGenerationMethod", + "params": [ + { + "name": "method", + "description": "" + } + ], + "access": "public", + "tagname": "", + "static": 1, + "class": "@ember-data/store", + "module": "@ember-data/store" + }, + { + "file": "../ember-data-types/q/identifier.ts", + "line": 204, + "description": "Configure a callback for when the identifier cache encounters new resource\ndata for an existing resource.\n\nThis configuration MUST occur prior to the store instance being created.\n\n```js\nimport { setIdentifierUpdateMethod } from '@ember-data/store';\n```\n\nTakes a method which can expect to receive an existing `Identifier` alongside\nsome new data to consider as a second argument. This is an opportunity\nfor secondary lookup tables and caches associated with the identifier\nto be amended.\n\nThis method is called everytime `updateRecordIdentifier` is called and\n with the same arguments. It provides the opportunity to update secondary\n lookup tables for existing identifiers.\n\nIt will always be called after an identifier created with `createIdentifierForNewRecord`\n has been committed, or after an update to the `record` a `RecordIdentifier`\n is assigned to has been committed. Committed here meaning that the server\n has acknowledged the update (for instance after a call to `.save()`)\n\nIf `id` has not previously existed, it will be assigned to the `Identifier`\n prior to this `UpdateMethod` being called; however, calls to the parent method\n `updateRecordIdentifier` that attempt to change the `id` or calling update\n without providing an `id` when one is missing will throw an error.", + "itemtype": "method", + "name": "setIdentifierUpdateMethod", + "params": [ + { + "name": "method", + "description": "" + } + ], + "access": "public", + "tagname": "", + "static": 1, + "class": "@ember-data/store", + "module": "@ember-data/store" + }, + { + "file": "../ember-data-types/q/identifier.ts", + "line": 245, + "description": "Configure a callback for when the identifier cache is going to release an identifier.\n\nThis configuration MUST occur prior to the store instance being created.\n\n```js\nimport { setIdentifierForgetMethod } from '@ember-data/store';\n```\n\nTakes method which can expect to receive an existing `Identifier` that should be eliminated\nfrom any secondary lookup tables or caches that the user has populated for it.", + "itemtype": "method", + "name": "setIdentifierForgetMethod", + "params": [ + { + "name": "method", + "description": "" + } + ], + "access": "public", + "tagname": "", + "static": 1, + "class": "@ember-data/store", + "module": "@ember-data/store" + }, + { + "file": "../ember-data-types/q/identifier.ts", + "line": 265, + "description": "Configure a callback for when the identifier cache is being torn down.\n\nThis configuration MUST occur prior to the store instance being created.\n\n```js\nimport { setIdentifierResetMethod } from '@ember-data/store';\n```\n\nTakes a method which can expect to be called when the parent application is destroyed.\n\nIf you have properly used a WeakMap to encapsulate the state of your customization\nto the application instance, you may not need to implement the `resetMethod`.", + "itemtype": "method", + "name": "setIdentifierResetMethod", + "params": [ + { + "name": "method", + "description": "" + } + ], + "access": "public", + "tagname": "", + "static": 1, + "class": "@ember-data/store", + "module": "@ember-data/store" + }, + { + "file": "../ember-data-types/q/minimum-adapter-interface.ts", + "line": 38, + "description": "`adapter.findRecord` takes a request for a resource of a given `type` and `id` combination\nand should return a `Promise` which fulfills with data for a single resource matching that\n`type` and `id`.\n\nThe response will be fed to the associated serializer's `normalizeResponse` method with the\n`requestType` set to `findRecord`, which should return a `JSON:API` document.\n\nThe final result after normalization to `JSON:API` will be added to store via `store.push` where\nit will merge with any existing data for the record.\n\n⚠️ If the adapter's response resolves to a false-y value, the associated `serializer.normalizeResponse`\ncall will NOT be made. In this scenario you may need to do at least a minimum amount of response\nprocessing within the adapter.\n\n`adapter.findRecord` is called whenever the `store` needs to load, reload, or backgroundReload\nthe resource data for a given `type` and `id`.", + "itemtype": "method", + "name": "findRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "The store service that initiated the request being normalized", + "type": "Store" + }, + { + "name": "schema", + "description": "An object with methods for accessing information about\n the type, attributes and relationships of the primary type associated with the request.", + "type": "ModelSchema" + }, + { + "name": "id", + "description": "", + "type": "String" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "a promise resolving with resource data to feed to the associated serializer", + "type": "Promise" + }, + "class": " Adapter", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/q/minimum-adapter-interface.ts", + "line": 67, + "description": "`adapter.findAll` takes a request for resources of a given `type` and should return\n a `Promise` which fulfills with a collection of resource data matching that `type`.\n\nThe response will be fed to the associated serializer's `normalizeResponse` method\n with the `requestType` set to `findAll`, which should return a `JSON:API` document.\n\nThe final result after normalization to `JSON:API` will be added to store via `store.push` where\nit will merge with any existing records for `type`. Existing records for the `type` will not be removed.\n\n⚠️ If the adapter's response resolves to a false-y value, the associated `serializer.normalizeResponse`\ncall will NOT be made. In this scenario you may need to do at least a minimum amount of response\nprocessing within the adapter.\n\n`adapter.findAll` is called whenever `store.findAll` is asked to reload or backgroundReload.\nThe records in the response are merged with the contents of the store. Existing records for\nthe `type` will not be removed.\n\nSee also `shouldReloadAll` and `shouldBackgroundReloadAll`", + "itemtype": "method", + "name": "findAll", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "The store service that initiated the request being normalized", + "type": "Store" + }, + { + "name": "schema", + "description": "An object with methods for accessing information about\n the type, attributes and relationships of the primary type associated with the request.", + "type": "ModelSchema" + }, + { + "name": "sinceToken", + "description": "This parameter is no longer used and will always be null.", + "type": "Null" + }, + { + "name": "snapshotRecordArray", + "description": "an object containing any passed in options,\n adapterOptions, and the ability to access a snapshot for each existing record of the type.", + "type": "SnapshotRecordArray" + } + ], + "return": { + "description": "a promise resolving with resource data to feed to the associated serializer", + "type": "Promise" + }, + "class": " Adapter", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/q/minimum-adapter-interface.ts", + "line": 104, + "description": "`adapter.query` takes a request for resources of a given `type` and should return\n a `Promise` which fulfills with a collection of resource data matching that `type`.\n\nThe response will be fed to the associated serializer's `normalizeResponse` method\n with the `requestType` set to `query`, which should return a `JSON:API` document.\n\nAs with `findAll`, the final result after normalization to `JSON:API` will be added to\nstore via `store.push` where it will merge with any existing records for `type`.\n\n⚠️ If the adapter's response resolves to a false-y value, the associated `serializer.normalizeResponse`\ncall will NOT be made. In this scenario you may need to do at least a minimum amount of response\nprocessing within the adapter.\n\n`adapter.query` is called whenever `store.query` is called or a previous query result is\nasked to reload.\n\nExisting records for the `type` will not be removed. The key difference is in the result\nreturned by the `store`. For `findAll` the result is all known records of the `type`,\nwhile for `query` it will only be the records returned from `adapter.query`.", + "itemtype": "method", + "name": "query", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "The store service that initiated the request being normalized", + "type": "Store" + }, + { + "name": "schema", + "description": "An object with methods for accessing information about\n the type, attributes and relationships of the primary type associated with the request.", + "type": "ModelSchema" + }, + { + "name": "query", + "description": "", + "type": "Object" + }, + { + "name": "recordArray", + "description": "", + "type": "Collection" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "a promise resolving with resource data to feed to the associated serializer", + "type": "Promise" + }, + "class": " Adapter", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/q/minimum-adapter-interface.ts", + "line": 143, + "description": "`adapter.queryRecord` takes a request for resource of a given `type` and should return\n a `Promise` which fulfills with data for a single resource matching that `type`.\n\nThe response will be fed to the associated serializer's `normalizeResponse` method\n with the `requestType` set to `queryRecord`, which should return a `JSON:API` document.\n\nThe final result after normalization to `JSON:API` will be added to store via `store.push` where\nit will merge with any existing data for the returned record.\n\n⚠️ If the adapter's response resolves to a false-y value, the associated `serializer.normalizeResponse`\ncall will NOT be made. In this scenario you may need to do at least a minimum amount of response\nprocessing within the adapter.", + "itemtype": "method", + "name": "queryRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "The store service that initiated the request being normalized", + "type": "Store" + }, + { + "name": "schema", + "description": "An object with methods for accessing information about\n the type, attributes and relationships of the primary type associated with the request.", + "type": "ModelSchema" + }, + { + "name": "query", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "return": { + "description": "a promise resolving with resource data to feed to the associated serializer", + "type": "Promise" + }, + "class": " Adapter", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/q/minimum-adapter-interface.ts", + "line": 173, + "description": "`adapter.createRecord` takes a request to create a resource of a given `type` and should\nreturn a `Promise` which fulfills with data for the newly created resource.\n\nThe response will be fed to the associated serializer's `normalizeResponse` method\n with the `requestType` set to `createRecord`, which should return a `JSON:API` document.\n\nThe final result after normalization to `JSON:API` will be added to store via `store.push` where\nit will merge with any existing data for the record.\n\n⚠️ If the adapter's response resolves to a false-y value, the associated `serializer.normalizeResponse`\ncall will NOT be made. In this scenario you may need to do at least a minimum amount of response\nprocessing within the adapter.\n\nIf the adapter rejects or throws an error the record will enter an error state and the attributes\nthat had attempted to be saved will still be considered dirty.\n\n### InvalidErrors\n\nWhen rejecting a `createRecord` request due to validation issues during save (typically a 422 status code),\nyou may throw an `InvalidError`.\n\nThrowing an `InvalidError` makes per-attribute errors available for records to use in the UI as needed.\nRecords can also use this information to mark themselves as being in an `invalid` state.\nFor more reading [see the RecordData Errors RFC](https://emberjs.github.io/rfcs/0465-record-data-errors.html)\n\n```js\nlet error = new Error(errorMessage);\n\n// these two properties combined\n// alert EmberData to this error being for\n// invalid properties on the record during\n// the request\nerror.isAdapterError = true;\nerror.code = 'InvalidError';\n\n// A JSON:API formatted array of errors\n// See https://jsonapi.org/format/#errors\nerror.errors = [];\n\nthrow error;\n```", + "itemtype": "method", + "name": "createRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "The store service that initiated the request being normalized", + "type": "Store" + }, + { + "name": "schema", + "description": "An object with methods for accessing information about\n the type, attributes and relationships of the primary type associated with the request.", + "type": "ModelSchema" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "a promise resolving with resource data to feed to the associated serializer", + "type": "Promise" + }, + "class": " Adapter", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/q/minimum-adapter-interface.ts", + "line": 226, + "description": "`adapter.updateRecord` takes a request to update a resource of a given `type` and should\nreturn a `Promise` which fulfills with the updated data for the resource.\n\nThe response will be fed to the associated serializer's `normalizeResponse` method\n with the `requestType` set to `updateRecord`, which should return a `JSON:API` document.\n\nThe final result after normalization to `JSON:API` will be added to store via `store.push` where\nit will merge with any existing data for the record.\n\n⚠️ If the adapter's response resolves to a false-y value, the associated `serializer.normalizeResponse`\ncall will NOT be made. In this scenario you may need to do at least a minimum amount of response\nprocessing within the adapter.\n\nIf the adapter rejects or throws an error the record will enter an error state and the attributes\nthat had attempted to be saved will still be considered dirty.\n\n### InvalidErrors\n\nWhen rejecting a `createRecord` request due to validation issues during save (typically a 422 status code),\nyou may throw an `InvalidError`.\n\nThrowing an `InvalidError` makes per-attribute errors available for records to use in the UI as needed.\nRecords can also use this information to mark themselves as being in an `invalid` state.\nFor more reading [see the RecordData Errors RFC](https://emberjs.github.io/rfcs/0465-record-data-errors.html)\n\n```js\nlet error = new Error(errorMessage);\n\n// these two properties combined\n// alert EmberData to this error being for\n// invalid properties on the record during\n// the request\nerror.isAdapterError = true;\nerror.code = 'InvalidError';\n\n// A JSON:API formatted array of errors\n// See https://jsonapi.org/format/#errors\nerror.errors = [];\n\nthrow error;\n```", + "itemtype": "method", + "name": "updateRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "The store service that initiated the request being normalized", + "type": "Store" + }, + { + "name": "schema", + "description": "An object with methods for accessing information about\n the type, attributes and relationships of the primary type associated with the request.", + "type": "ModelSchema" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "class": " Adapter", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/q/minimum-adapter-interface.ts", + "line": 278, + "description": "`adapter.deleteRecord` takes a request to delete a resource of a given `type` and\nshould return a `Promise` which resolves when that deletion is complete.\n\nUsually the response will be empty, but you may include additional updates in the\nresponse. The response will be fed to the associated serializer's `normalizeResponse` method\nwith the `requestType` set to `deleteRecord`, which should return a `JSON:API` document.\n\nThe final result after normalization to `JSON:API` will be added to store via `store.push` where\nit will merge with any existing data.\n\n⚠️ If the adapter's response resolves to a false-y value, the associated `serializer.normalizeResponse`\ncall will NOT be made. In this scenario you may need to do at least a minimum amount of response\nprocessing within the adapter.\n\nIf the adapter rejects or errors the record will need to be saved again once the reason\nfor the error is addressed in order to persist the deleted state.", + "itemtype": "method", + "name": "deleteRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "The store service that initiated the request being normalized", + "type": "Store" + }, + { + "name": "schema", + "description": "An object with methods for accessing information about\n the type, attributes and relationships of the primary type associated with the request.", + "type": "ModelSchema" + }, + { + "name": "snapshot", + "description": "A Snapshot containing the record's current data", + "type": "Snapshot" + } + ], + "return": { + "description": "" + }, + "class": " Adapter", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/q/minimum-adapter-interface.ts", + "line": 306, + "description": "`adapter.findBelongsTo` takes a request to fetch a related resource located at a\n`relatedLink` and should return a `Promise` which fulfills with data for a single\n resource.\n\n⚠️ This method is only called if the store previously received relationship information for a resource\ncontaining a [related link](https://jsonapi.org/format/#document-resource-object-related-resource-links).\n\nIf the cache does not have a `link` for the relationship then `findRecord` will be used if a `type` and `id`\nfor the related resource is known.\n\nThe response will be fed to the associated serializer's `normalizeResponse` method\n with the `requestType` set to `findBelongsTo`, which should return a `JSON:API` document.\n\nThe final result after normalization to `JSON:API` will be added to store via `store.push` where\nit will merge with any existing data.\n\n⚠️ If the adapter's response resolves to a false-y value, the associated `serializer.normalizeResponse`\ncall will NOT be made. In this scenario you may need to do at least a minimum amount of response\nprocessing within the adapter.", + "itemtype": "method", + "name": "findBelongsTo [OPTIONAL]", + "access": "public", + "tagname": "", + "optional": 1, + "params": [ + { + "name": "store", + "description": "The store service that initiated the request being normalized", + "type": "Store" + }, + { + "name": "snapshot", + "description": "A Snapshot containing the parent record's current data", + "type": "Snapshot" + }, + { + "name": "relatedLink", + "description": "The link at which the associated resource might be found", + "type": "String" + }, + { + "name": "relationship", + "description": "", + "type": "RelationshipSchema" + } + ], + "return": { + "description": "a promise resolving with resource data to feed to the associated serializer", + "type": "Promise" + }, + "class": " Adapter", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/q/minimum-adapter-interface.ts", + "line": 343, + "description": "`adapter.findHasMany` takes a request to fetch a related resource collection located\n at a `relatedLink` and should return a `Promise` which fulfills with data for that\n collection.\n\n⚠️ This method is only called if the store previously received relationship information for a resource\ncontaining a [related link](https://jsonapi.org/format/#document-resource-object-related-resource-links).\n\nIf the cache does not have a `link` for the relationship but the `type` and `id` of\nrelated resources are known then `findRecord` will be used for each individual related\nresource.\n\nThe response will be fed to the associated serializer's `normalizeResponse` method\n with the `requestType` set to `findHasMany`, which should return a `JSON:API` document.\n\nThe final result after normalization to `JSON:API` will be added to store via `store.push` where\nit will merge with any existing data.\n\n⚠️ If the adapter's response resolves to a false-y value, the associated `serializer.normalizeResponse`\ncall will NOT be made. In this scenario you may need to do at least a minimum amount of response\nprocessing within the adapter.", + "itemtype": "method", + "name": "findhasMany [OPTIONAL]", + "access": "public", + "tagname": "", + "optional": 1, + "params": [ + { + "name": "store", + "description": "The store service that initiated the request being normalized", + "type": "Store" + }, + { + "name": "snapshot", + "description": "A Snapshot containing the parent record's current data", + "type": "Snapshot" + }, + { + "name": "relatedLink", + "description": "The link at which the associated resource collection might be found", + "type": "String" + }, + { + "name": "relationship", + "description": "", + "type": "RelationshipSchema" + } + ], + "return": { + "description": "a promise resolving with resource data to feed to the associated serializer", + "type": "Promise" + }, + "class": " Adapter", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/q/minimum-adapter-interface.ts", + "line": 381, + "description": "⚠️ This Method is only called if `coalesceFindRequests` is `true`. The array passed to it is determined\nby the adapter's `groupRecordsForFindMany` method, and will be called once per group returned.\n\n`adapter.findMany` takes a request to fetch a collection of resources and should return a\n`Promise` which fulfills with data for that collection.\n\nThe response will be fed to the associated serializer's `normalizeResponse` method\n with the `requestType` set to `findMany`, which should return a `JSON:API` document.\n\nThe final result after normalization to `JSON:API` will be added to store via `store.push` where\nit will merge with any existing data.\n\n⚠️ If the adapter's response resolves to a false-y value, the associated `serializer.normalizeResponse`\ncall will NOT be made. In this scenario you may need to do at least a minimum amount of response\nprocessing within the adapter.\n\nSee also `groupRecordsForFindMany` and `coalesceFindRequests`", + "itemtype": "method", + "name": "findMany [OPTIONAL]", + "access": "public", + "tagname": "", + "optional": 1, + "params": [ + { + "name": "store", + "description": "The store service that initiated the request being normalized", + "type": "Store" + }, + { + "name": "schema", + "description": "An object with methods for accessing information about\n the type, attributes and relationships of the primary type associated with the request.", + "type": "ModelSchema" + }, + { + "name": "ids", + "description": "An array of the ids of the resources to fetch", + "type": "Array" + }, + { + "name": "snapshots", + "description": "An array of snapshots of the available data for the resources to fetch", + "type": "Array" + } + ], + "return": { + "description": "a promise resolving with resource data to feed to the associated serializer", + "type": "Promise" + }, + "class": " Adapter", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/q/minimum-adapter-interface.ts", + "line": 412, + "description": "This method provides the ability to generate an ID to assign to a new record whenever `store.createRecord`\nis called if no `id` was provided.\n\nAlternatively you can pass an id into the call to `store.createRecord` directly.\n\n```js\nlet id = generateNewId(type);\nlet newRecord = store.createRecord(type, { id });\n```", + "itemtype": "method", + "name": "generateIdForRecord [OPTIONAL]", + "access": "public", + "tagname": "", + "optional": 1, + "params": [ + { + "name": "store", + "description": "The store service that initiated the request being normalized", + "type": "Store" + }, + { + "name": "type", + "description": "The type (or modelName) of record being created", + "type": "String" + }, + { + "name": "properties", + "description": "the properties passed as the second arg to `store.createRecord`" + } + ], + "return": { + "description": "a string ID that should be unique (no other models of `type` in the cache should have this `id`)", + "type": "String" + }, + "class": " Adapter", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/q/minimum-adapter-interface.ts", + "line": 433, + "description": "If your adapter implements `findMany`, setting this to `true` will cause `findRecord`\nrequests triggered within the same `runloop` to be coalesced into one or more calls\nto `adapter.findMany`. The number of calls made and the records contained in each call\ncan be tuned by your adapter's `groupRecordsForHasMany` method.\n\nImplementing coalescing using this flag and the associated methods does not always offer\nthe right level of correctness, timing control or granularity. If your application would\nbe better suited coalescing across multiple types, coalescing for longer than a single runloop,\nor with a more custom request structure, coalescing within your application adapter may prove\nmore effective.", + "itemtype": "property", + "name": "coalesceFindRequests [OPTIONAL]", + "access": "public", + "tagname": "", + "optional": 1, + "type": "{boolean} true if the requests to find individual records should be coalesced, false otherwise", + "class": " Adapter", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/q/minimum-adapter-interface.ts", + "line": 452, + "description": "⚠️ This Method is only called if `coalesceFindRequests` is `true`.\n\nThis method allows for you to split pending requests for records into multiple `findMany`\nrequests. It receives an array of snapshots where each snapshot represents a unique record\nrequested via `store.findRecord` during the most recent `runloop` that was not found in the\ncache or needs to be reloaded. It should return an array of groups.\n\nA group is an array of snapshots meant to be fetched together by a single `findMany` request.\n\nBy default if this method is not implemented EmberData will call `findMany` once with all\nrequested records as a single group when `coalesceFindRequests` is `true`.\n\nSee also `findMany` and `coalesceFindRequests`", + "itemtype": "method", + "name": "groupRecordsForFindMany [OPTIONAL]", + "access": "public", + "tagname": "", + "optional": 1, + "params": [ + { + "name": "store", + "description": "The store service that initiated the request being normalized", + "type": "Store" + }, + { + "name": "snapshots", + "description": "An array of snapshots", + "type": "Array" + } + ], + "return": { + "description": "An array of Snapshot arrays", + "type": "Array>" + }, + "class": " Adapter", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/q/minimum-adapter-interface.ts", + "line": 476, + "description": "When a record is already available in the store and is requested again via `store.findRecord`,\nand `reload` is not specified as an option in the request, this method is called to determine\nwhether the record should be reloaded prior to returning the result.\n\nIf `reload` is specified as an option in the request (`true` or `false`) this method will not\nbe called.\n\n```js\nstore.findRecord('user', '1', { reload: false })\n```\n\nThe default behavior if this method is not implemented and the option is not specified is to\nnot reload, the same as a return of `false`.\n\nSee also the documentation for `shouldBackgroundReloadRecord` which defaults to `true`.", + "itemtype": "method", + "name": "shouldReloadRecord [OPTIONAL]", + "access": "public", + "tagname": "", + "optional": 1, + "params": [ + { + "name": "store", + "description": "The store service that initiated the request being normalized", + "type": "Store" + }, + { + "name": "snapshot", + "description": "A Snapshot containing the record's current data", + "type": "Snapshot" + } + ], + "return": { + "description": "true if the record should be reloaded immediately, false otherwise", + "type": "Boolean" + }, + "class": " Adapter", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/q/minimum-adapter-interface.ts", + "line": 502, + "description": "When `store.findAll()` is called without a `reload` option, the adapter\nis presented the opportunity to trigger a new request for records of that type.\n\nIf `reload` is specified as an option in the request (`true` or `false`) this method will not\nbe called.\n\n```js\nstore.findAll('user', { reload: false })\n```\n\nThe default behavior if this method is not implemented and the option is not specified is to\nnot reload, the same as a return of `false`.\n\nNote: the Promise returned by `store.findAll` resolves to the same RecordArray instance\nreturned by `store.peekAll` for that type, and will include all records in the store for\nthe given type, including any previously existing records not returned by the reload request.", + "itemtype": "method", + "name": "shouldReloadAll [OPTIONAL]", + "access": "public", + "tagname": "", + "optional": 1, + "params": [ + { + "name": "store", + "description": "The store service that initiated the request being normalized", + "type": "Store" + }, + { + "name": "snapshotArray", + "description": "", + "type": "SnapshotRecordArray" + } + ], + "return": { + "description": "true if the a new request for all records of the type in SnapshotRecordArray should be made immediately, false otherwise", + "type": "Boolean" + }, + "class": " Adapter", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/q/minimum-adapter-interface.ts", + "line": 529, + "description": "When a record is already available in the store and is requested again via `store.findRecord`,\nand the record does not need to be reloaded prior to return, this method provides the ability\nto specify whether a refresh of the data for the reload should be scheduled to occur in the background.\n\nUsers may explicitly declare a record should/should not be background reloaded by passing\n`backgroundReload: true` or `backgroundReload: false` as an option to the request respectively.\n\n```js\nstore.findRecord('user', '1', { backgroundReload: false })\n```\n\nIf the `backgroundReload` option is not present, this method will be called to determine whether\na backgroundReload should be performed.\n\nThe default behavior if this method is not implemented and the option was not specified is to\nbackground reload, the same as a return of `true`.", + "itemtype": "method", + "name": "shouldBackgroundReloadRecord [OPTIONAL]", + "access": "public", + "tagname": "", + "optional": 1, + "params": [ + { + "name": "store", + "description": "The store service that initiated the request being normalized", + "type": "Store" + }, + { + "name": "snapshot", + "description": "A Snapshot containing the record's current data", + "type": "Snapshot" + } + ], + "return": { + "description": "true if the record should be reloaded in the background, false otherwise", + "type": "Boolean" + }, + "class": " Adapter", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/q/minimum-adapter-interface.ts", + "line": 556, + "description": "When `store.findAll()` is called and a `reload` is not initiated, the adapter\nis presented the opportunity to trigger a new non-blocking (background) request for\nrecords of that type\n\nUsers may explicitly declare that this background request should/should not occur by passing\n`backgroundReload: true` or `backgroundReload: false` as an option to the request respectively.\n\n```js\nstore.findAll('user', { backgroundReload: false })\n```\n\nThe default behavior if this method is not implemented and the option is not specified is to\nperform a reload, the same as a return of `true`.", + "itemtype": "method", + "name": "shouldBackgroundReloadAll [OPTIONAL]", + "access": "public", + "tagname": "", + "optional": 1, + "params": [ + { + "name": "store", + "description": "The store service that initiated the request being normalized", + "type": "Store" + }, + { + "name": "snapshotArray", + "description": "", + "type": "SnapshotRecordArray" + } + ], + "return": { + "description": "true if the a new request for all records of the type in SnapshotRecordArray should be made in the background, false otherwise", + "type": "Boolean" + }, + "class": " Adapter", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/q/minimum-adapter-interface.ts", + "line": 580, + "description": "In some situations the adapter may need to perform cleanup when destroyed,\nthat cleanup can be done in `destroy`.\n\nIf not implemented, the store does not inform the adapter of destruction.", + "itemtype": "method", + "name": "destroy [OPTIONAL]", + "access": "public", + "tagname": "", + "optional": 1, + "class": " Adapter", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/q/minimum-serializer-interface.ts", + "line": 45, + "description": "This method is responsible for normalizing the value resolved from the promise returned\nby an Adapter request into the format expected by the `Store`.\n\nThe output should be a [JSON:API Document](https://jsonapi.org/format/#document-structure)\nwith the following additional restrictions:\n\n- `type` should be formatted in the `singular` `dasherized` `lowercase` form\n- `members` (the property names of attributes and relationships) should be formatted\n to match their definition in the corresponding `Model` definition. Typically this\n will be `camelCase`.\n- [`lid`](https://github.com/emberjs/rfcs/blob/main/text/0403-ember-data-identifiers.md) is\n a valid optional sibling to `id` and `type` in both [Resources](https://jsonapi.org/format/#document-resource-objects)\n and [Resource Identifier Objects](https://jsonapi.org/format/#document-resource-identifier-objects)", + "itemtype": "method", + "name": "normalizeResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "The store service that initiated the request being normalized", + "type": "Store" + }, + { + "name": "schema", + "description": "An object with methods for accessing information about\n the type, attributes and relationships of the primary type associated with the request.", + "type": "ModelSchema" + }, + { + "name": "rawPayload", + "description": "The raw JSON response data returned from an API request.\n This correlates to the value the promise returned by the adapter method that performed\n the request resolved to.", + "type": "JSONObject" + }, + { + "name": "id", + "description": "For a findRecord request, this is the id initially provided\n in the call to store.findRecord. Else this value is null.", + "type": "String|null" + }, + { + "name": "requestType", + "description": "The\n type of request the Adapter had been asked to perform.", + "type": "'findRecord' | 'queryRecord' | 'findAll' | 'findBelongsTo' | 'findHasMany' | 'findMany' | 'query' | 'createRecord' | 'deleteRecord' | 'updateRecord'" + } + ], + "return": { + "description": "a document following the structure of a JSON:API Document.", + "type": "JsonApiDocument" + }, + "class": " Serializer", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/q/minimum-serializer-interface.ts", + "line": 93, + "description": "This method is responsible for serializing an individual record\nvia a [Snapshot](Snapshot) into the format expected by the API.\n\nThis method is called by `snapshot.serialize()`.\n\nWhen using `Model`, this method is called by `record.serialize()`.\n\nWhen using `JSONAPIAdapter` or `RESTAdapter` this method is called\nby `updateRecord` and `createRecord` if `Serializer.serializeIntoHash`\nis not implemented.", + "itemtype": "method", + "name": "serialize", + "access": "public", + "tagname": "", + "params": [ + { + "name": "snapshot", + "description": "A Snapshot for the record to serialize", + "type": "Snapshot" + }, + { + "name": "options", + "description": "", + "type": "Object", + "optional": true + } + ], + "class": " Serializer", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/q/minimum-serializer-interface.ts", + "line": 112, + "description": "This method is intended to normalize data into a [JSON:API Document](https://jsonapi.org/format/#document-structure)\nwith a data member containing a single [Resource](https://jsonapi.org/format/#document-resource-objects).\n\n- `type` should be formatted in the singular, dasherized and lowercase form\n- `members` (the property names of attributes and relationships) should be formatted\n to match their definition in the corresponding `Model` definition. Typically this\n will be `camelCase`.\n- [`lid`](https://github.com/emberjs/rfcs/blob/main/text/0403-ember-data-identifiers.md) is\n a valid optional sibling to `id` and `type` in both [Resources](https://jsonapi.org/format/#document-resource-objects)\n and [Resource Identifier Objects](https://jsonapi.org/format/#document-resource-identifier-objects)\n\nThis method is called by the `Store` when `store.normalize(modelName, payload)` is\ncalled. It is recommended to use `store.serializerFor(modelName).normalizeResponse`\nover `store.normalize`.\n\nThis method may be called when also using the `RESTSerializer`\nwhen `serializer.pushPayload` is called by `store.pushPayload`.\nHowever, it is recommended to use `store.push` over `store.pushPayload` after normalizing\nthe payload directly.\n\nExample:\n```js\nfunction pushPayload(store, modelName, rawPayload) {\n const ModelClass = store.modelFor(modelName);\n const serializer = store.serializerFor(modelName);\n const jsonApiPayload = serializer.normalizeResponse(store, ModelClass, rawPayload, null, 'query');\n\n return store.push(jsonApiPayload);\n}\n```\n\nThis method may be called when also using the `JSONAPISerializer`\nwhen normalizing included records. If mixing serializer usage in this way\nwe recommend implementing this method, but caution that it may lead\nto unexpected mixing of formats.\n\nThis method may also be called when normalizing embedded relationships when\nusing the `EmbeddedRecordsMixin`. If using this mixin in a serializer in\nyour application we recommend implementing this method, but caution that\nit may lead to unexpected mixing of formats.", + "itemtype": "method", + "name": "normalize [OPTIONAL]", + "access": "public", + "tagname": "", + "optional": 1, + "params": [ + { + "name": "schema", + "description": "An object with methods for accessing information about\n the type, attributes and relationships of the primary type associated with the request.", + "type": "ModelSchema" + }, + { + "name": "rawPayload", + "description": "Some raw JSON data to be normalized into a JSON:API Resource.", + "type": "JSONObject" + }, + { + "name": "prop", + "description": "When called by the EmbeddedRecordsMixin this param will be the\n property at which the object provided as rawPayload was found.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "A JSON:API Document\n containing a single JSON:API Resource\n as its primary data.", + "type": "SingleResourceDocument" + }, + "class": " Serializer", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/q/minimum-serializer-interface.ts", + "line": 168, + "description": "When using `JSONAPIAdapter` or `RESTAdapter` this method is called\nby `adapter.updateRecord` and `adapter.createRecord` if `serializer.serializeIntoHash`\nis implemented. If this method is not implemented, `serializer.serialize`\nwill be called in this case.\n\nYou can use this method to customize the root keys serialized into the payload.\nThe hash property should be modified by reference.\n\nFor instance, your API may expect resources to be keyed by underscored type in the payload:\n\n```js\n{\n _user: {\n type: 'user',\n id: '1'\n }\n}\n```\n\nWhich when using these adapters can be achieved by implementing this method similar\nto the following:\n\n```js\nserializeIntoHash(hash, ModelClass, snapshot, options) {\n hash[`_${snapshot.modelName}`] = this.serialize(snapshot, options).data;\n}\n```", + "itemtype": "method", + "name": "serializeIntoHash [OPTIONAL]", + "access": "public", + "tagname": "", + "optional": 1, + "params": [ + { + "name": "hash", + "description": "A top most object of the request payload onto\n which to append the serialized record" + }, + { + "name": "schema", + "description": "An object with methods for accessing information about\n the type, attributes and relationships of the primary type associated with the request.", + "type": "ModelSchema" + }, + { + "name": "snapshot", + "description": "A Snapshot for the record to serialize", + "type": "Snapshot" + }, + { + "name": "options", + "description": "", + "optional": true + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": " Serializer", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/q/minimum-serializer-interface.ts", + "line": 210, + "description": "This method allows for normalization of data when `store.pushPayload` is called\nand should be implemented if you want to use that method.\n\nThe method is responsible for pushing new data to the store using `store.push`\nonce any necessary normalization has occurred, and no data in the store will be\nupdated unless it does so.\n\nThe normalized form pushed to the store should be a [JSON:API Document](https://jsonapi.org/format/#document-structure)\nwith the following additional restrictions:\n\n- `type` should be formatted in the singular, dasherized and lowercase form\n- `members` (the property names of attributes and relationships) should be formatted\n to match their definition in the corresponding `Model` definition. Typically this\n will be `camelCase`.\n- [`lid`](https://github.com/emberjs/rfcs/blob/main/text/0403-ember-data-identifiers.md) is\n a valid optional sibling to `id` and `type` in both [Resources](https://jsonapi.org/format/#document-resource-objects)\n and [Resource Identifier Objects](https://jsonapi.org/format/#document-resource-identifier-objects)\n\nIf you need better control over normalization or want access to the records being added or updated\nin the store, we recommended using `store.push` over `store.pushPayload` after normalizing\nthe payload directly. This can even take advantage of an existing serializer for the format\nthe data is in, for example:\n\n```js\nfunction pushPayload(store, modelName, rawPayload) {\n const ModelClass = store.modelFor(modelName);\n const serializer = store.serializerFor(modelName);\n const jsonApiPayload = serializer.normalizeResponse(store, ModelClass, rawPayload, null, 'query');\n\n return store.push(jsonApiPayload);\n}\n```", + "itemtype": "method", + "name": "pushPayload [OPTIONAL]", + "access": "public", + "tagname": "", + "optional": 1, + "params": [ + { + "name": "store", + "description": "The store service that initiated the request being normalized", + "type": "Store" + }, + { + "name": "rawPayload", + "description": "The raw JSON response data returned from an API request.\n This JSON should be in the API format expected by the serializer.", + "type": "JSONObject" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": " Serializer", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/q/minimum-serializer-interface.ts", + "line": 254, + "description": "In some situations the serializer may need to perform cleanup when destroyed,\nthat cleanup can be done in `destroy`.\n\nIf not implemented, the store does not inform the serializer of destruction.", + "itemtype": "method", + "name": "destroy [OPTIONAL]", + "access": "public", + "tagname": "", + "optional": 1, + "class": " Serializer", + "module": "@ember-data/experimental-preview-types" + }, + { + "file": "../ember-data-types/q/schema-service.ts", + "line": 59, + "description": "Queries whether the schema-definition-service recognizes `type` as a resource type", + "itemtype": "method", + "name": "doesTypeExist", + "access": "public", + "tagname": "", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "SchemaService", + "module": "@ember-data/store" + }, + { + "file": "../ember-data-types/q/schema-service.ts", + "line": 69, + "itemtype": "method", + "description": "Returns definitions for all properties of the specified resource\nthat are considered \"attributes\". Generally these are properties\nthat are not related to book-keeping state on the client and do\nnot represent a linkage to another resource.\n\nThe return value should be a dictionary of key:value pairs\nwhere the `key` is the attribute or property's name and `value`\nis an object with at least the property `name` which should also\nmatch `key`.\n\nOptionally, this object may also specify `type`, which should\nbe a string reference to a `transform`, and `options` which\nshould be dictionary in which any key:value pairs are permissable.\n\nFor instance, when using `@ember-data/model`, the following attribute\ndefinition:\n\n```ts\nclass extends Model {\n @attr firstName;\n}\n```\n\nWould be returned as:\n\n```js\n{\n greeting: { name: 'greeting', type: 'string', options: { defaultValue: 'hello' } },\n birthday: { name: 'birthday', type: 'date' },\n firstName: { name: 'firstName' }\n}\n```\n", + "name": "attributesDefinitionFor", + "access": "public", + "tagname": "", + "params": [ + { + "name": "}", + "description": "identifier", + "type": "RecordIdentifier| type: string" + } + ], + "return": { + "description": "", + "type": "AttributesSchema" + }, + "class": "SchemaService", + "module": "@ember-data/store" + }, + { + "file": "../ember-data-types/q/schema-service.ts", + "line": 112, + "itemtype": "method", + "description": "Returns definitions for all properties of the specified resource\nthat are considered \"relationships\". Generally these are properties\nthat represent a linkage to another resource.\n\nThe return value should be a dictionary of key:value pairs\nwhere the `key` is the relationship or property's name and `value`\nis an object with at least the following properties:\n\n- `name` which should also match the `key` used in the dictionary.\n- `kind` which should be either `belongsTo` or `hasMany`\n- `type` which should be the related resource's string \"type\"\n- `options` which should be a dictionary allowing any key but with\n at least the below keys present.\n\n- `options.async` a boolean representing whether data for this relationship is\n typically loaded on-demand.\n- `options.inverse` a string or null representing the field name / key of the\n corresponding relationship on the inverse resource.\n\nAdditionally the following options properties are optional. See [Polymorphic Relationships](https://rfcs.emberjs.com/id/0793-polymporphic-relations-without-inheritance)\n\n- `options.polymorphic` a boolean representing whether multiple resource types\n can be used to satisfy this relationship.\n- `options.as` a string representing the abstract type that the concrete side of\n a relationship must specify when fulfilling a polymorphic inverse.\n\nFor example, the following Model using @ember-data/model would generate this relationships\ndefinition by default:\n\n```js\nclass User extends Model {\n @belongsto('user', { async: false, inverse: null }) bestFriend;\n @hasmany('pet', { async: false, polymorphic: true, inverse: 'owner' }) pets;\n}\n```\n\nWhich would be returned as\n\n```js\n{\n bestFriend: {\n name: 'bestFriend',\n kind: 'belongsTo',\n type: 'user',\n options: {\n async: false,\n inverse: null\n }\n },\n friends: {\n name: 'friends',\n kind: 'hasMany',\n type: 'user',\n options: {\n async: true,\n inverse: 'friends'\n }\n },\n pets: {\n name: 'pets',\n kind: 'hasMany',\n type: 'pet',\n options: {\n async: false,\n polymorphic: true,\n inverse: 'owner'\n }\n },\n}\n```\n", + "name": "relationshipsDefinitionFor", + "access": "public", + "tagname": "", + "params": [ + { + "name": "}", + "description": "identifier", + "type": "RecordIdentifier| type: string" + } + ], + "return": { + "description": "", + "type": "RelationshipsSchema" + }, + "class": "SchemaService", + "module": "@ember-data/store" + }, + { + "file": "../packages/active-record/src/-private/builders/find-record.ts", + "line": 21, + "description": "Builds request options to fetch a single resource by a known id or identifier\nconfigured for the url and header expectations of most ActiveRecord APIs.\n\n**Basic Usage**\n\n```ts\nimport { findRecord } from '@ember-data/active-record/request';\n\nconst data = await store.request(findRecord('person', '1'));\n```\n\n**With Options**\n\n```ts\nimport { findRecord } from '@ember-data/active-record/request';\n\nconst options = findRecord('person', '1', { include: ['pets', 'friends'] });\nconst data = await store.request(options);\n```\n\n**With an Identifier**\n\n```ts\nimport { findRecord } from '@ember-data/active-record/request';\n\nconst options = findRecord({ type: 'person', id: '1' }, { include: ['pets', 'friends'] });\nconst data = await store.request(options);\n```\n\n**Supplying Options to Modify the Request Behavior**\n\nThe following options are supported:\n\n- `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.\n- `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.\n- `resourcePath` - The resource path to use for the request, defaults to pluralizing and underscoring the supplied type\n- `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to `false` if none is configured.\n- `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to `false` if none is configured.\n- `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)\n\n```ts\nimport { findRecord } from '@ember-data/active-record/request';\n\nconst options = findRecord('person', '1', { include: ['pets', 'friends'] }, { namespace: 'api/v2' });\nconst data = await store.request(options);\n```", + "itemtype": "method", + "name": "findRecord", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/active-record/request", + "module": "@ember-data/active-record/request" + }, + { + "file": "../packages/active-record/src/-private/builders/query.ts", + "line": 13, + "description": "Builds request options to query for resources, usually by a primary\ntype, configured for the url and header expectations of most ActiveRecord APIs.\n\n**Basic Usage**\n\n```ts\nimport { query } from '@ember-data/active-record/request';\n\nconst data = await store.request(query('person'));\n```\n\n**With Query Params**\n\n```ts\nimport { query } from '@ember-data/active-record/request';\n\nconst options = query('person', { include: ['pets', 'friends'] });\nconst data = await store.request(options);\n```\n\n**Supplying Options to Modify the Request Behavior**\n\nThe following options are supported:\n\n- `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.\n- `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.\n- `resourcePath` - The resource path to use for the request, defaults to pluralizing and underscoring the supplied type\n- `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to `false` if none is configured.\n- `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to `false` if none is configured.\n- `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)\n\n```ts\nimport { query } from '@ember-data/active-record/request';\n\nconst options = query('person', { include: ['pets', 'friends'] }, { reload: true });\nconst data = await store.request(options);\n```", + "itemtype": "method", + "name": "query", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "query", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/active-record/request", + "module": "@ember-data/active-record/request" + }, + { + "file": "../packages/active-record/src/-private/builders/save-record.ts", + "line": 27, + "description": "Builds request options to delete record for resources,\nconfigured for the url, method and header expectations of ActiveRecord APIs.\n\n**Basic Usage**\n\n```ts\nimport { deleteRecord } from '@ember-data/active-record/request';\n\nconst person = this.store.peekRecord('person', '1');\n\n// mark record as deleted\nstore.deleteRecord(person);\n\n// persist deletion\nconst data = await store.request(deleteRecord(person));\n```\n\n**Supplying Options to Modify the Request Behavior**\n\nThe following options are supported:\n\n- `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.\n- `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.\n- `resourcePath` - The resource path to use for the request, defaults to pluralizing the supplied type\n- `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to `false` if none is configured.\n- `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to `false` if none is configured.\n- `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)\n\n```ts\nimport { deleteRecord } from '@ember-data/active-record/request';\n\nconst person = this.store.peekRecord('person', '1');\n\n// mark record as deleted\nstore.deleteRecord(person);\n\n// persist deletion\nconst options = deleteRecord(person, { namespace: 'api/v1' });\nconst data = await store.request(options);\n```", + "itemtype": "method", + "name": "deleteRecord", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "record", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/active-record/request", + "module": "@ember-data/active-record/request" + }, + { + "file": "../packages/active-record/src/-private/builders/save-record.ts", + "line": 107, + "description": "Builds request options to create new record for resources,\nconfigured for the url, method and header expectations of most ActiveRecord APIs.\n\n**Basic Usage**\n\n```ts\nimport { createRecord } from '@ember-data/active-record/request';\n\nconst person = this.store.createRecord('person', { name: 'Ted' });\nconst data = await store.request(createRecord(person));\n```\n\n**Supplying Options to Modify the Request Behavior**\n\nThe following options are supported:\n\n- `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.\n- `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.\n- `resourcePath` - The resource path to use for the request, defaults to pluralizing the supplied type\n- `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to `false` if none is configured.\n- `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to `false` if none is configured.\n- `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)\n\n```ts\nimport { createRecord } from '@ember-data/active-record/request';\n\nconst person = this.store.createRecord('person', { name: 'Ted' });\nconst options = createRecord(person, { namespace: 'api/v1' });\nconst data = await store.request(options);\n```", + "itemtype": "method", + "name": "createRecord", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "record", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/active-record/request", + "module": "@ember-data/active-record/request" + }, + { + "file": "../packages/active-record/src/-private/builders/save-record.ts", + "line": 176, + "description": "Builds request options to update existing record for resources,\nconfigured for the url, method and header expectations of most ActiveRecord APIs.\n\n**Basic Usage**\n\n```ts\nimport { updateRecord } from '@ember-data/active-record/request';\n\nconst person = this.store.peekRecord('person', '1');\nperson.name = 'Chris';\nconst data = await store.request(updateRecord(person));\n```\n\n**Supplying Options to Modify the Request Behavior**\n\nThe following options are supported:\n\n- `patch` - Allows caller to specify whether to use a PATCH request instead of a PUT request, defaults to `false`.\n- `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.\n- `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.\n- `resourcePath` - The resource path to use for the request, defaults to pluralizing the supplied type\n- `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to `false` if none is configured.\n- `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to `false` if none is configured.\n- `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)\n\n```ts\nimport { updateRecord } from '@ember-data/active-record/request';\n\nconst person = this.store.peekRecord('person', '1');\nperson.name = 'Chris';\nconst options = updateRecord(person, { patch: true });\nconst data = await store.request(options);\n```", + "itemtype": "method", + "name": "updateRecord", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "record", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/active-record/request", + "module": "@ember-data/active-record/request" + }, + { + "file": "../packages/adapter/src/-private/build-url-mixin.ts", + "line": 145, + "description": "Builds a URL for a given type and optional ID.\n\nBy default, it pluralizes the type's name (for example, 'post'\nbecomes 'posts' and 'person' becomes 'people'). To override the\npluralization see [pathForType](./pathForType?anchor=pathForType).\n\nIf an ID is specified, it adds the ID to the path generated\nfor the type, separated by a `/`.\n\nWhen called by `RESTAdapter.findMany()` the `id` and `snapshot` parameters\nwill be arrays of ids and snapshots.", + "itemtype": "method", + "name": "buildURL", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelName", + "description": "", + "type": "String" + }, + { + "name": "id", + "description": "single id or array of ids or query", + "type": "(String|Array|Object)" + }, + { + "name": "snapshot", + "description": "single snapshot or array of snapshots", + "type": "(Snapshot|SnapshotRecordArray)" + }, + { + "name": "requestType", + "description": "", + "type": "String" + }, + { + "name": "query", + "description": "object of query parameters to send for query requests.", + "type": "Object" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "BuildURLMixin", + "module": "@ember-data/adapter" + }, + { + "file": "../packages/adapter/src/-private/build-url-mixin.ts", + "line": 294, + "itemtype": "method", + "name": "_buildURL", + "access": "private", + "tagname": "", + "params": [ + { + "name": "modelName", + "description": "", + "type": "String" + }, + { + "name": "id", + "description": "", + "type": "String" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "BuildURLMixin", + "module": "@ember-data/adapter" + }, + { + "file": "../packages/adapter/src/-private/build-url-mixin.ts", + "line": 329, + "description": "Builds a URL for a `store.findRecord(type, id)` call.\n\nExample:\n\n```app/adapters/user.js\nimport JSONAPIAdapter from '@ember-data/adapter/json-api';\n\nexport default class ApplicationAdapter extends JSONAPIAdapter {\n urlForFindRecord(id, modelName, snapshot) {\n let baseUrl = this.buildURL(modelName, id, snapshot);\n return `${baseUrl}/users/${snapshot.adapterOptions.user_id}/playlists/${id}`;\n }\n}\n```", + "itemtype": "method", + "name": "urlForFindRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "id", + "description": "", + "type": "String" + }, + { + "name": "modelName", + "description": "", + "type": "String" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "BuildURLMixin", + "module": "@ember-data/adapter" + }, + { + "file": "../packages/adapter/src/-private/build-url-mixin.ts", + "line": 357, + "description": "Builds a URL for a `store.findAll(type)` call.\n\nExample:\n\n```app/adapters/comment.js\nimport JSONAPIAdapter from '@ember-data/adapter/json-api';\n\nexport default class ApplicationAdapter extends JSONAPIAdapter {\n urlForFindAll(modelName, snapshot) {\n let baseUrl = this.buildURL(modelName);\n return `${baseUrl}/data/comments.json`;\n }\n}\n```", + "itemtype": "method", + "name": "urlForFindAll", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelName", + "description": "", + "type": "String" + }, + { + "name": "snapshot", + "description": "", + "type": "SnapshotRecordArray" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "BuildURLMixin", + "module": "@ember-data/adapter" + }, + { + "file": "../packages/adapter/src/-private/build-url-mixin.ts", + "line": 383, + "description": "Builds a URL for a `store.query(type, query)` call.\n\nExample:\n\n```app/adapters/application.js\nimport RESTAdapter from '@ember-data/adapter/rest';\n\nexport default class ApplicationAdapter extends RESTAdapter {\n host = 'https://api.github.com';\n urlForQuery (query, modelName) {\n switch(modelName) {\n case 'repo':\n return `https://api.github.com/orgs/${query.orgId}/repos`;\n default:\n return super.urlForQuery(...arguments);\n }\n }\n}\n```", + "itemtype": "method", + "name": "urlForQuery", + "access": "public", + "tagname": "", + "params": [ + { + "name": "query", + "description": "", + "type": "Object" + }, + { + "name": "modelName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "BuildURLMixin", + "module": "@ember-data/adapter" + }, + { + "file": "../packages/adapter/src/-private/build-url-mixin.ts", + "line": 414, + "description": "Builds a URL for a `store.queryRecord(type, query)` call.\n\nExample:\n\n```app/adapters/application.js\nimport RESTAdapter from '@ember-data/adapter/rest';\n\nexport default class ApplicationAdapter extends RESTAdapter {\n urlForQueryRecord({ slug }, modelName) {\n let baseUrl = this.buildURL();\n return `${baseUrl}/${encodeURIComponent(slug)}`;\n }\n}\n```", + "itemtype": "method", + "name": "urlForQueryRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "query", + "description": "", + "type": "Object" + }, + { + "name": "modelName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "BuildURLMixin", + "module": "@ember-data/adapter" + }, + { + "file": "../packages/adapter/src/-private/build-url-mixin.ts", + "line": 440, + "description": "Builds a URL for coalescing multiple `store.findRecord(type, id)`\nrecords into 1 request when the adapter's `coalesceFindRequests`\nproperty is `true`.\n\nExample:\n\n```app/adapters/application.js\nimport RESTAdapter from '@ember-data/adapter/rest';\n\nexport default class ApplicationAdapter extends RESTAdapter {\n urlForFindMany(ids, modelName) {\n let baseUrl = this.buildURL();\n return `${baseUrl}/coalesce`;\n }\n}\n```", + "itemtype": "method", + "name": "urlForFindMany", + "access": "public", + "tagname": "", + "params": [ + { + "name": "ids", + "description": "", + "type": "Array" + }, + { + "name": "modelName", + "description": "", + "type": "String" + }, + { + "name": "snapshots", + "description": "", + "type": "Array" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "BuildURLMixin", + "module": "@ember-data/adapter" + }, + { + "file": "../packages/adapter/src/-private/build-url-mixin.ts", + "line": 469, + "description": "Builds a URL for fetching an async `hasMany` relationship when a URL\nis not provided by the server.\n\nExample:\n\n```app/adapters/application.js\nimport JSONAPIAdapter from '@ember-data/adapter/json-api';\n\nexport default class ApplicationAdapter extends JSONAPIAdapter {\n urlForFindHasMany(id, modelName, snapshot) {\n let baseUrl = this.buildURL(modelName, id);\n return `${baseUrl}/relationships`;\n }\n}\n```", + "itemtype": "method", + "name": "urlForFindHasMany", + "access": "public", + "tagname": "", + "params": [ + { + "name": "id", + "description": "", + "type": "String" + }, + { + "name": "modelName", + "description": "", + "type": "String" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "BuildURLMixin", + "module": "@ember-data/adapter" + }, + { + "file": "../packages/adapter/src/-private/build-url-mixin.ts", + "line": 497, + "description": "Builds a URL for fetching an async `belongsTo` relationship when a url\nis not provided by the server.\n\nExample:\n\n```app/adapters/application.js\nimport JSONAPIAdapter from '@ember-data/adapter/json-api';\n\nexport default class ApplicationAdapter extends JSONAPIAdapter {\n urlForFindBelongsTo(id, modelName, snapshot) {\n let baseUrl = this.buildURL(modelName, id);\n return `${baseUrl}/relationships`;\n }\n}\n```", + "itemtype": "method", + "name": "urlForFindBelongsTo", + "access": "public", + "tagname": "", + "params": [ + { + "name": "id", + "description": "", + "type": "String" + }, + { + "name": "modelName", + "description": "", + "type": "String" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "BuildURLMixin", + "module": "@ember-data/adapter" + }, + { + "file": "../packages/adapter/src/-private/build-url-mixin.ts", + "line": 525, + "description": "Builds a URL for a `record.save()` call when the record was created\nlocally using `store.createRecord()`.\n\nExample:\n\n```app/adapters/application.js\nimport RESTAdapter from '@ember-data/adapter/rest';\n\nexport default class ApplicationAdapter extends RESTAdapter {\n urlForCreateRecord(modelName, snapshot) {\n return super.urlForCreateRecord(...arguments) + '/new';\n }\n}\n```", + "itemtype": "method", + "name": "urlForCreateRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelName", + "description": "", + "type": "String" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "BuildURLMixin", + "module": "@ember-data/adapter" + }, + { + "file": "../packages/adapter/src/-private/build-url-mixin.ts", + "line": 551, + "description": "Builds a URL for a `record.save()` call when the record has been updated locally.\n\nExample:\n\n```app/adapters/application.js\nimport RESTAdapter from '@ember-data/adapter/rest';\n\nexport default class ApplicationAdapter extends RESTAdapter {\n urlForUpdateRecord(id, modelName, snapshot) {\n return `/${id}/feed?access_token=${snapshot.adapterOptions.token}`;\n }\n}\n```", + "itemtype": "method", + "name": "urlForUpdateRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "id", + "description": "", + "type": "String" + }, + { + "name": "modelName", + "description": "", + "type": "String" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "BuildURLMixin", + "module": "@ember-data/adapter" + }, + { + "file": "../packages/adapter/src/-private/build-url-mixin.ts", + "line": 577, + "description": "Builds a URL for a `record.save()` call when the record has been deleted locally.\n\nExample:\n\n```app/adapters/application.js\nimport RESTAdapter from '@ember-data/adapter/rest';\n\nexport default class ApplicationAdapter extends RESTAdapter {\n urlForDeleteRecord(id, modelName, snapshot) {\n return super.urlForDeleteRecord(...arguments) + '/destroy';\n }\n}\n```", + "itemtype": "method", + "name": "urlForDeleteRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "id", + "description": "", + "type": "String" + }, + { + "name": "modelName", + "description": "", + "type": "String" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "url", + "type": "String" + }, + "class": "BuildURLMixin", + "module": "@ember-data/adapter" + }, + { + "file": "../packages/adapter/src/-private/build-url-mixin.ts", + "line": 603, + "itemtype": "method", + "name": "urlPrefix", + "access": "private", + "tagname": "", + "params": [ + { + "name": "path", + "description": "", + "type": "String" + }, + { + "name": "parentURL", + "description": "", + "type": "String" + } + ], + "return": { + "description": "urlPrefix", + "type": "String" + }, + "class": "BuildURLMixin", + "module": "@ember-data/adapter" + }, + { + "file": "../packages/adapter/src/-private/build-url-mixin.ts", + "line": 643, + "description": "Determines the pathname for a given type.\n\nBy default, it pluralizes the type's name (for example,\n'post' becomes 'posts' and 'person' becomes 'people').\n\n### Pathname customization\n\nFor example, if you have an object `LineItem` with an\nendpoint of `/line_items/`.\n\n```app/adapters/application.js\nimport RESTAdapter from '@ember-data/adapter/rest';\nimport { decamelize, pluralize } from '/utils/string-utils';\n\nexport default class ApplicationAdapter extends RESTAdapter {\n pathForType(modelName) {\n var decamelized = decamelize(modelName);\n return pluralize(decamelized);\n }\n}\n```", + "itemtype": "method", + "name": "pathForType", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "path", + "type": "String" + }, + "class": "BuildURLMixin", + "module": "@ember-data/adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 260, + "description": "The `findRecord()` method is invoked when the store is asked for a record that\nhas not previously been loaded. In response to `findRecord()` being called, you\nshould query your persistence layer for a record with the given ID. The `findRecord`\nmethod should return a promise that will resolve to a JavaScript object that will be\nnormalized by the serializer.\n\nHere is an example of the `findRecord` implementation:\n\n```app/adapters/application.js\nimport Adapter from '@ember-data/adapter';\nimport RSVP from 'RSVP';\nimport $ from 'jquery';\n\nexport default class ApplicationAdapter extends Adapter {\n findRecord(store, type, id, snapshot) {\n return new RSVP.Promise(function(resolve, reject) {\n $.getJSON(`/${type.modelName}/${id}`).then(function(data) {\n resolve(data);\n }, function(jqXHR) {\n reject(jqXHR);\n });\n });\n }\n}\n```", + "itemtype": "method", + "name": "findRecord", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "", + "type": "Model" + }, + { + "name": "id", + "description": "", + "type": "String" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "access": "public", + "tagname": "", + "class": "Adapter", + "module": "@ember-data/adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 302, + "description": "The `findAll()` method is used to retrieve all records for a given type.\n\nExample\n\n```app/adapters/application.js\nimport Adapter from '@ember-data/adapter';\nimport RSVP from 'RSVP';\nimport $ from 'jquery';\n\nexport default class ApplicationAdapter extends Adapter {\n findAll(store, type) {\n return new RSVP.Promise(function(resolve, reject) {\n $.getJSON(`/${type.modelName}`).then(function(data) {\n resolve(data);\n }, function(jqXHR) {\n reject(jqXHR);\n });\n });\n }\n}\n```", + "itemtype": "method", + "name": "findAll", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "", + "type": "Model" + }, + { + "name": "neverSet", + "description": "a value is never provided to this argument", + "type": "Undefined" + }, + { + "name": "snapshotRecordArray", + "description": "", + "type": "SnapshotRecordArray" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "access": "public", + "tagname": "", + "class": "Adapter", + "module": "@ember-data/adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 345, + "description": "This method is called when you call `query` on the store.\n\nExample\n\n```app/adapters/application.js\nimport Adapter from '@ember-data/adapter';\nimport RSVP from 'RSVP';\nimport $ from 'jquery';\n\nexport default class ApplicationAdapter extends Adapter {\n query(store, type, query) {\n return new RSVP.Promise(function(resolve, reject) {\n $.getJSON(`/${type.modelName}`, query).then(function(data) {\n resolve(data);\n }, function(jqXHR) {\n reject(jqXHR);\n });\n });\n }\n}\n```", + "itemtype": "method", + "name": "query", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "", + "type": "Model" + }, + { + "name": "query", + "description": "", + "type": "Object" + }, + { + "name": "recordArray", + "description": "", + "type": "Collection" + }, + { + "name": "adapterOptions", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "access": "public", + "tagname": "", + "class": "Adapter", + "module": "@ember-data/adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 384, + "description": "The `queryRecord()` method is invoked when the store is asked for a single\nrecord through a query object.\n\nIn response to `queryRecord()` being called, you should always fetch fresh\ndata. Once found, you can asynchronously call the store's `push()` method\nto push the record into the store.\n\nHere is an example `queryRecord` implementation:\n\nExample\n\n```app/adapters/application.js\nimport Adapter, { BuildURLMixin } from '@ember-data/adapter';\nimport RSVP from 'RSVP';\nimport $ from 'jquery';\n\nexport default class ApplicationAdapter extends Adapter.extend(BuildURLMixin) {\n queryRecord(store, type, query) {\n return new RSVP.Promise(function(resolve, reject) {\n $.getJSON(`/${type.modelName}`, query).then(function(data) {\n resolve(data);\n }, function(jqXHR) {\n reject(jqXHR);\n });\n });\n }\n}\n```", + "itemtype": "method", + "name": "queryRecord", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "", + "type": "Subclass of Model" + }, + { + "name": "query", + "description": "", + "type": "Object" + }, + { + "name": "adapterOptions", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "access": "public", + "tagname": "", + "class": "Adapter", + "module": "@ember-data/adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 429, + "description": "If the globally unique IDs for your records should be generated on the client,\nimplement the `generateIdForRecord()` method. This method will be invoked\neach time you create a new record, and the value returned from it will be\nassigned to the record's `primaryKey`.\n\nMost traditional REST-like HTTP APIs will not use this method. Instead, the ID\nof the record will be set by the server, and your adapter will update the store\nwith the new ID when it calls `didCreateRecord()`. Only implement this method if\nyou intend to generate record IDs on the client-side.\n\nThe `generateIdForRecord()` method will be invoked with the requesting store as\nthe first parameter and the newly created record as the second parameter:\n\n```javascript\nimport Adapter from '@ember-data/adapter';\nimport { v4 } from 'uuid';\n\nexport default class ApplicationAdapter extends Adapter {\n generateIdForRecord(store, type, inputProperties) {\n return v4();\n }\n}\n```", + "itemtype": "method", + "name": "generateIdForRecord", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "the Model class of the record", + "type": "Model" + }, + { + "name": "inputProperties", + "description": "a hash of properties to set on the\n newly created record.", + "type": "Object" + } + ], + "return": { + "description": "id", + "type": "(String|Number)" + }, + "access": "public", + "tagname": "", + "class": "Adapter", + "module": "@ember-data/adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 463, + "description": "Proxies to the serializer's `serialize` method.\n\nExample\n\n```app/adapters/application.js\nimport Adapter from '@ember-data/adapter';\n\nexport default class ApplicationAdapter extends Adapter {\n createRecord(store, type, snapshot) {\n let data = this.serialize(snapshot, { includeId: true });\n let url = `/${type.modelName}`;\n\n // ...\n }\n}\n```", + "itemtype": "method", + "name": "serialize", + "params": [ + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "serialized snapshot", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Adapter", + "module": "@ember-data/adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 491, + "description": "Implement this method in a subclass to handle the creation of\nnew records.\n\nSerializes the record and sends it to the server.\n\nExample\n\n```app/adapters/application.js\nimport Adapter from '@ember-data/adapter';\nimport RSVP from 'RSVP';\nimport $ from 'jquery';\n\nexport default class ApplicationAdapter extends Adapter {\n createRecord(store, type, snapshot) {\n let data = this.serialize(snapshot, { includeId: true });\n\n return new RSVP.Promise(function (resolve, reject) {\n $.ajax({\n type: 'POST',\n url: `/${type.modelName}`,\n dataType: 'json',\n data: data\n }).then(function (data) {\n resolve(data);\n }, function (jqXHR) {\n jqXHR.then = null; // tame jQuery's ill mannered promises\n reject(jqXHR);\n });\n });\n }\n}\n```", + "itemtype": "method", + "name": "createRecord", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "the Model class of the record", + "type": "Model" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "access": "public", + "tagname": "", + "class": "Adapter", + "module": "@ember-data/adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 539, + "description": "Implement this method in a subclass to handle the updating of\na record.\n\nSerializes the record update and sends it to the server.\n\nThe updateRecord method is expected to return a promise that will\nresolve with the serialized record. This allows the backend to\ninform the Ember Data store the current state of this record after\nthe update. If it is not possible to return a serialized record\nthe updateRecord promise can also resolve with `undefined` and the\nEmber Data store will assume all of the updates were successfully\napplied on the backend.\n\nExample\n\n```app/adapters/application.js\nimport Adapter from '@ember-data/adapter';\nimport RSVP from 'RSVP';\nimport $ from 'jquery';\n\nexport default class ApplicationAdapter extends Adapter {\n updateRecord(store, type, snapshot) {\n let data = this.serialize(snapshot, { includeId: true });\n let id = snapshot.id;\n\n return new RSVP.Promise(function(resolve, reject) {\n $.ajax({\n type: 'PUT',\n url: `/${type.modelName}/${id}`,\n dataType: 'json',\n data: data\n }).then(function(data) {\n resolve(data);\n }, function(jqXHR) {\n jqXHR.then = null; // tame jQuery's ill mannered promises\n reject(jqXHR);\n });\n });\n }\n}\n```", + "itemtype": "method", + "name": "updateRecord", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "the Model class of the record", + "type": "Model" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "access": "public", + "tagname": "", + "class": "Adapter", + "module": "@ember-data/adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 596, + "description": "Implement this method in a subclass to handle the deletion of\na record.\n\nSends a delete request for the record to the server.\n\nExample\n\n```app/adapters/application.js\nimport Adapter from '@ember-data/adapter';\nimport RSVP from 'RSVP';\nimport $ from 'jquery';\n\nexport default class ApplicationAdapter extends Adapter {\n deleteRecord(store, type, snapshot) {\n let data = this.serialize(snapshot, { includeId: true });\n let id = snapshot.id;\n\n return new RSVP.Promise(function(resolve, reject) {\n $.ajax({\n type: 'DELETE',\n url: `/${type.modelName}/${id}`,\n dataType: 'json',\n data: data\n }).then(function(data) {\n resolve(data)\n }, function(jqXHR) {\n jqXHR.then = null; // tame jQuery's ill mannered promises\n reject(jqXHR);\n });\n });\n }\n}\n```", + "itemtype": "method", + "name": "deleteRecord", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "the Model class of the record", + "type": "Model" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "access": "public", + "tagname": "", + "class": "Adapter", + "module": "@ember-data/adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 645, + "description": "By default the store will try to coalesce all `findRecord` calls within the same runloop\ninto as few requests as possible by calling groupRecordsForFindMany and passing it into a findMany call.\nYou can opt out of this behaviour by either not implementing the findMany hook or by setting\ncoalesceFindRequests to false.", + "itemtype": "property", + "name": "coalesceFindRequests", + "access": "public", + "tagname": "", + "type": "{boolean}", + "class": "Adapter", + "module": "@ember-data/adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 667, + "description": "The store will call `findMany` instead of multiple `findRecord`\nrequests to find multiple records at once if coalesceFindRequests\nis true.\n\n```app/adapters/application.js\nimport Adapter from '@ember-data/adapter';\nimport RSVP from 'RSVP';\nimport $ from 'jquery';\n\nexport default class ApplicationAdapter extends Adapter {\n findMany(store, type, ids, snapshots) {\n return new RSVP.Promise(function(resolve, reject) {\n $.ajax({\n type: 'GET',\n url: `/${type.modelName}/`,\n dataType: 'json',\n data: { filter: { id: ids.join(',') } }\n }).then(function(data) {\n resolve(data);\n }, function(jqXHR) {\n jqXHR.then = null; // tame jQuery's ill mannered promises\n reject(jqXHR);\n });\n });\n }\n}\n```", + "itemtype": "method", + "name": "findMany", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "the Model class of the records", + "type": "Model" + }, + { + "name": "ids", + "description": "", + "type": "Array" + }, + { + "name": "snapshots", + "description": "", + "type": "Array" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "access": "public", + "tagname": "", + "class": "Adapter", + "module": "@ember-data/adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 705, + "description": "Organize records into groups, each of which is to be passed to separate\ncalls to `findMany`.\n\nFor example, if your API has nested URLs that depend on the parent, you will\nwant to group records by their parent.\n\nThe default implementation returns the records as a single group.", + "itemtype": "method", + "name": "groupRecordsForFindMany", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "snapshots", + "description": "", + "type": "Array" + } + ], + "return": { + "description": "an array of arrays of records, each of which is to be\n loaded separately by `findMany`.", + "type": "Array" + }, + "class": "Adapter", + "module": "@ember-data/adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 725, + "description": "This method is used by the store to determine if the store should\nreload a record from the adapter when a record is requested by\n`store.findRecord`.\n\nIf this method returns `true`, the store will re-fetch a record from\nthe adapter. If this method returns `false`, the store will resolve\nimmediately using the cached record.\n\nFor example, if you are building an events ticketing system, in which users\ncan only reserve tickets for 20 minutes at a time, and want to ensure that\nin each route you have data that is no more than 20 minutes old you could\nwrite:\n\n```javascript\nshouldReloadRecord(store, ticketSnapshot) {\n let lastAccessedAt = ticketSnapshot.attr('lastAccessedAt');\n let timeDiff = moment().diff(lastAccessedAt, 'minutes');\n\n if (timeDiff > 20) {\n return true;\n } else {\n return false;\n }\n}\n```\n\nThis method would ensure that whenever you do `store.findRecord('ticket',\nid)` you will always get a ticket that is no more than 20 minutes old. In\ncase the cached version is more than 20 minutes old, `findRecord` will not\nresolve until you fetched the latest version.\n\nBy default this hook returns `false`, as most UIs should not block user\ninteractions while waiting on data update.\n\nNote that, with default settings, `shouldBackgroundReloadRecord` will always\nre-fetch the records in the background even if `shouldReloadRecord` returns\n`false`. You can override `shouldBackgroundReloadRecord` if this does not\nsuit your use case.", + "since": "1.13.0", + "itemtype": "method", + "name": "shouldReloadRecord", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Adapter", + "module": "@ember-data/adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 776, + "description": "This method is used by the store to determine if the store should\nreload all records from the adapter when records are requested by\n`store.findAll`.\n\nIf this method returns `true`, the store will re-fetch all records from\nthe adapter. If this method returns `false`, the store will resolve\nimmediately using the cached records.\n\nFor example, if you are building an events ticketing system, in which users\ncan only reserve tickets for 20 minutes at a time, and want to ensure that\nin each route you have data that is no more than 20 minutes old you could\nwrite:\n\n```javascript\nshouldReloadAll(store, snapshotArray) {\n let snapshots = snapshotArray.snapshots();\n\n return snapshots.any((ticketSnapshot) => {\n let lastAccessedAt = ticketSnapshot.attr('lastAccessedAt');\n let timeDiff = moment().diff(lastAccessedAt, 'minutes');\n\n if (timeDiff > 20) {\n return true;\n } else {\n return false;\n }\n });\n}\n```\n\nThis method would ensure that whenever you do `store.findAll('ticket')` you\nwill always get a list of tickets that are no more than 20 minutes old. In\ncase a cached version is more than 20 minutes old, `findAll` will not\nresolve until you fetched the latest versions.\n\nBy default, this method returns `true` if the passed `snapshotRecordArray`\nis empty (meaning that there are no records locally available yet),\notherwise, it returns `false`.\n\nNote that, with default settings, `shouldBackgroundReloadAll` will always\nre-fetch all the records in the background even if `shouldReloadAll` returns\n`false`. You can override `shouldBackgroundReloadAll` if this does not suit\nyour use case.", + "since": "1.13.0", + "itemtype": "method", + "name": "shouldReloadAll", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "snapshotRecordArray", + "description": "", + "type": "SnapshotRecordArray" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Adapter", + "module": "@ember-data/adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 832, + "description": "This method is used by the store to determine if the store should\nreload a record after the `store.findRecord` method resolves a\ncached record.\n\nThis method is *only* checked by the store when the store is\nreturning a cached record.\n\nIf this method returns `true` the store will re-fetch a record from\nthe adapter.\n\nFor example, if you do not want to fetch complex data over a mobile\nconnection, or if the network is down, you can implement\n`shouldBackgroundReloadRecord` as follows:\n\n```javascript\nshouldBackgroundReloadRecord(store, snapshot) {\n let { downlink, effectiveType } = navigator.connection;\n\n return downlink > 0 && effectiveType === '4g';\n}\n```\n\nBy default, this hook returns `true` so the data for the record is updated\nin the background.", + "since": "1.13.0", + "itemtype": "method", + "name": "shouldBackgroundReloadRecord", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Adapter", + "module": "@ember-data/adapter" + }, + { + "file": "../packages/adapter/src/index.ts", + "line": 869, + "description": "This method is used by the store to determine if the store should\nreload a record array after the `store.findAll` method resolves\nwith a cached record array.\n\nThis method is *only* checked by the store when the store is\nreturning a cached record array.\n\nIf this method returns `true` the store will re-fetch all records\nfrom the adapter.\n\nFor example, if you do not want to fetch complex data over a mobile\nconnection, or if the network is down, you can implement\n`shouldBackgroundReloadAll` as follows:\n\n```javascript\nshouldBackgroundReloadAll(store, snapshotArray) {\n let { downlink, effectiveType } = navigator.connection;\n\n return downlink > 0 && effectiveType === '4g';\n}\n```\n\nBy default this method returns `true`, indicating that a background reload\nshould always be triggered.", + "since": "1.13.0", + "itemtype": "method", + "name": "shouldBackgroundReloadAll", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "snapshotRecordArray", + "description": "", + "type": "SnapshotRecordArray" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "access": "public", + "tagname": "", + "class": "Adapter", + "module": "@ember-data/adapter" + }, + { + "file": "../packages/adapter/src/json-api.ts", + "line": 167, + "itemtype": "method", + "name": "ajaxOptions", + "access": "private", + "tagname": "", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + }, + { + "name": "type", + "description": "The request type GET, POST, PUT, DELETE etc.", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter/json-api" + }, + { + "file": "../packages/adapter/src/json-api.ts", + "line": 187, + "description": "By default the JSONAPIAdapter will send each find request coming from a `store.find`\nor from accessing a relationship separately to the server. If your server supports passing\nids as a query string, you can set coalesceFindRequests to true to coalesce all find requests\nwithin a single runloop.\n\nFor example, if you have an initial payload of:\n\n```javascript\n{\n data: {\n id: 1,\n type: 'post',\n relationship: {\n comments: {\n data: [\n { id: 1, type: 'comment' },\n { id: 2, type: 'comment' }\n ]\n }\n }\n }\n}\n```\n\nBy default calling `post.comments` will trigger the following requests(assuming the\ncomments haven't been loaded before):\n\n```\nGET /comments/1\nGET /comments/2\n```\n\nIf you set coalesceFindRequests to `true` it will instead trigger the following request:\n\n```\nGET /comments?filter[id]=1,2\n```\n\nSetting coalesceFindRequests to `true` also works for `store.find` requests and `belongsTo`\nrelationships accessed within the same runloop. If you set `coalesceFindRequests: true`\n\n```javascript\nstore.findRecord('comment', 1);\nstore.findRecord('comment', 2);\n```\n\nwill also send a request to: `GET /comments?filter[id]=1,2`\n\nNote: Requests coalescing rely on URL building strategy. So if you override `buildURL` in your app\n`groupRecordsForFindMany` more likely should be overridden as well in order for coalescing to work.", + "itemtype": "property", + "name": "coalesceFindRequests", + "access": "public", + "tagname": "", + "type": "{boolean}", + "class": "JSONAPIAdapter", + "module": "@ember-data/adapter/json-api" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 343, + "description": "This property allows ajax to still be used instead when `false`.", + "itemtype": "property", + "name": "useFetch", + "type": "{Boolean}", + "default": "true", + "access": "public", + "tagname": "", + "class": "RESTAdapter", + "module": "@ember-data/adapter/rest" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 370, + "description": "By default, the RESTAdapter will send the query params sorted alphabetically to the\nserver.\n\nFor example:\n\n```js\nstore.query('posts', { sort: 'price', category: 'pets' });\n```\n\nwill generate a requests like this `/posts?category=pets&sort=price`, even if the\nparameters were specified in a different order.\n\nThat way the generated URL will be deterministic and that simplifies caching mechanisms\nin the backend.\n\nSetting `sortQueryParams` to a falsey value will respect the original order.\n\nIn case you want to sort the query parameters with a different criteria, set\n`sortQueryParams` to your custom sort function.\n\n```app/adapters/application.js\nimport RESTAdapter from '@ember-data/adapter/rest';\n\nexport default class ApplicationAdapter extends RESTAdapter {\n sortQueryParams(params) {\n let sortedKeys = Object.keys(params).sort().reverse();\n let len = sortedKeys.length, newParams = {};\n\n for (let i = 0; i < len; i++) {\n newParams[sortedKeys[i]] = params[sortedKeys[i]];\n }\n\n return newParams;\n }\n}\n```", + "itemtype": "method", + "name": "sortQueryParams", + "params": [ + { + "name": "obj", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "RESTAdapter", + "module": "@ember-data/adapter/rest" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 428, + "description": "By default the RESTAdapter will send each find request coming from a `store.find`\nor from accessing a relationship separately to the server. If your server supports passing\nids as a query string, you can set coalesceFindRequests to true to coalesce all find requests\nwithin a single runloop.\n\nFor example, if you have an initial payload of:\n\n```javascript\n{\n post: {\n id: 1,\n comments: [1, 2]\n }\n}\n```\n\nBy default calling `post.comments` will trigger the following requests(assuming the\ncomments haven't been loaded before):\n\n```\nGET /comments/1\nGET /comments/2\n```\n\nIf you set coalesceFindRequests to `true` it will instead trigger the following request:\n\n```\nGET /comments?ids[]=1&ids[]=2\n```\n\nSetting coalesceFindRequests to `true` also works for `store.find` requests and `belongsTo`\nrelationships accessed within the same runloop. If you set `coalesceFindRequests: true`\n\n```javascript\nstore.findRecord('comment', 1);\nstore.findRecord('comment', 2);\n```\n\nwill also send a request to: `GET /comments?ids[]=1&ids[]=2`\n\nNote: Requests coalescing rely on URL building strategy. So if you override `buildURL` in your app\n`groupRecordsForFindMany` more likely should be overridden as well in order for coalescing to work.", + "itemtype": "property", + "name": "coalesceFindRequests", + "access": "public", + "tagname": "", + "type": "{boolean}", + "class": "RESTAdapter", + "module": "@ember-data/adapter/rest" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 488, + "description": "Endpoint paths can be prefixed with a `namespace` by setting the namespace\nproperty on the adapter:\n\n```app/adapters/application.js\nimport RESTAdapter from '@ember-data/adapter/rest';\n\nexport default class ApplicationAdapter extends RESTAdapter {\n namespace = 'api/1';\n}\n```\n\nRequests for the `Post` model would now target `/api/1/post/`.", + "itemtype": "property", + "name": "namespace", + "access": "public", + "tagname": "", + "type": "{String}", + "class": "RESTAdapter", + "module": "@ember-data/adapter/rest" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 507, + "description": "An adapter can target other hosts by setting the `host` property.\n\n```app/adapters/application.js\nimport RESTAdapter from '@ember-data/adapter/rest';\n\nexport default class ApplicationAdapter extends RESTAdapter {\n host = 'https://api.example.com';\n}\n```\n\nRequests for the `Post` model would now target `https://api.example.com/post/`.", + "itemtype": "property", + "name": "host", + "access": "public", + "tagname": "", + "type": "{String}", + "class": "RESTAdapter", + "module": "@ember-data/adapter/rest" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 525, + "description": "Some APIs require HTTP headers, e.g. to provide an API\nkey. Arbitrary headers can be set as key/value pairs on the\n`RESTAdapter`'s `headers` object and Ember Data will send them\nalong with each ajax request. For dynamic headers see [headers\ncustomization](/ember-data/release/classes/RESTAdapter).\n\n```app/adapters/application.js\nimport RESTAdapter from '@ember-data/adapter/rest';\nimport { computed } from '@ember/object';\n\nexport default class ApplicationAdapter extends RESTAdapter {\n headers: computed(function() {\n return {\n 'API_KEY': 'secret key',\n 'ANOTHER_HEADER': 'Some header value'\n };\n })\n}\n```", + "itemtype": "property", + "name": "headers", + "access": "public", + "tagname": "", + "type": "{Object}", + "class": "RESTAdapter", + "module": "@ember-data/adapter/rest" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 552, + "description": "Called by the store in order to fetch the JSON for a given\ntype and ID.\n\nThe `findRecord` method makes an Ajax request to a URL computed by\n`buildURL`, and returns a promise for the resulting payload.\n\nThis method performs an HTTP `GET` request with the id provided as part of the query string.", + "since": "1.13.0", + "itemtype": "method", + "name": "findRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "", + "type": "Model" + }, + { + "name": "id", + "description": "", + "type": "String" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "class": "RESTAdapter", + "module": "@ember-data/adapter/rest" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 577, + "description": "Called by the store in order to fetch a JSON array for all\nof the records for a given type.\n\nThe `findAll` method makes an Ajax (HTTP GET) request to a URL computed by `buildURL`, and returns a\npromise for the resulting payload.", + "itemtype": "method", + "name": "findAll", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "", + "type": "Model" + }, + { + "name": "neverSet", + "description": "a value is never provided to this argument", + "type": "Undefined" + }, + { + "name": "snapshotRecordArray", + "description": "", + "type": "SnapshotRecordArray" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "class": "RESTAdapter", + "module": "@ember-data/adapter/rest" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 608, + "description": "Called by the store in order to fetch a JSON array for\nthe records that match a particular query.\n\nThe `query` method makes an Ajax (HTTP GET) request to a URL\ncomputed by `buildURL`, and returns a promise for the resulting\npayload.\n\nThe `query` argument is a simple JavaScript object that will be passed directly\nto the server as parameters.", + "itemtype": "method", + "name": "query", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "", + "type": "Model" + }, + { + "name": "query", + "description": "", + "type": "Object" + }, + { + "name": "recordArray", + "description": "", + "type": "Collection" + }, + { + "name": "adapterOptions", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "class": "RESTAdapter", + "module": "@ember-data/adapter/rest" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 638, + "description": "Called by the store in order to fetch a JSON object for\nthe record that matches a particular query.\n\nThe `queryRecord` method makes an Ajax (HTTP GET) request to a URL\ncomputed by `buildURL`, and returns a promise for the resulting\npayload.\n\nThe `query` argument is a simple JavaScript object that will be passed directly\nto the server as parameters.", + "since": "1.13.0", + "itemtype": "method", + "name": "queryRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "", + "type": "Model" + }, + { + "name": "query", + "description": "", + "type": "Object" + }, + { + "name": "adapterOptions", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "class": "RESTAdapter", + "module": "@ember-data/adapter/rest" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 673, + "description": "Called by the store in order to fetch several records together if `coalesceFindRequests` is true\n\nFor example, if the original payload looks like:\n\n```js\n{\n \"id\": 1,\n \"title\": \"Rails is omakase\",\n \"comments\": [ 1, 2, 3 ]\n}\n```\n\nThe IDs will be passed as a URL-encoded Array of IDs, in this form:\n\n```\nids[]=1&ids[]=2&ids[]=3\n```\n\nMany servers, such as Rails and PHP, will automatically convert this URL-encoded array\ninto an Array for you on the server-side. If you want to encode the\nIDs, differently, just override this (one-line) method.\n\nThe `findMany` method makes an Ajax (HTTP GET) request to a URL computed by `buildURL`, and returns a\npromise for the resulting payload.", + "itemtype": "method", + "name": "findMany", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "", + "type": "Model" + }, + { + "name": "ids", + "description": "", + "type": "Array" + }, + { + "name": "snapshots", + "description": "", + "type": "Array" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "class": "RESTAdapter", + "module": "@ember-data/adapter/rest" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 712, + "description": "Called by the store in order to fetch a JSON array for\nthe unloaded records in a has-many relationship that were originally\nspecified as a URL (inside of `links`).\n\nFor example, if your original payload looks like this:\n\n```js\n{\n \"post\": {\n \"id\": 1,\n \"title\": \"Rails is omakase\",\n \"links\": { \"comments\": \"/posts/1/comments\" }\n }\n}\n```\n\nThis method will be called with the parent record and `/posts/1/comments`.\n\nThe `findHasMany` method will make an Ajax (HTTP GET) request to the originally specified URL.\n\nThe format of your `links` value will influence the final request URL via the `urlPrefix` method:\n\n* Links beginning with `//`, `http://`, `https://`, will be used as is, with no further manipulation.\n\n* Links beginning with a single `/` will have the current adapter's `host` value prepended to it.\n\n* Links with no beginning `/` will have a parentURL prepended to it, via the current adapter's `buildURL`.", + "itemtype": "method", + "name": "findHasMany", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "url", + "description": "", + "type": "String" + }, + { + "name": "relationship", + "description": "meta object describing the relationship", + "type": "Object" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "class": "RESTAdapter", + "module": "@ember-data/adapter/rest" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 767, + "description": "Called by the store in order to fetch the JSON for the unloaded record in a\nbelongs-to relationship that was originally specified as a URL (inside of\n`links`).\n\nFor example, if your original payload looks like this:\n\n```js\n{\n \"person\": {\n \"id\": 1,\n \"name\": \"Tom Dale\",\n \"links\": { \"group\": \"/people/1/group\" }\n }\n}\n```\n\nThis method will be called with the parent record and `/people/1/group`.\n\nThe `findBelongsTo` method will make an Ajax (HTTP GET) request to the originally specified URL.\n\nThe format of your `links` value will influence the final request URL via the `urlPrefix` method:\n\n* Links beginning with `//`, `http://`, `https://`, will be used as is, with no further manipulation.\n\n* Links beginning with a single `/` will have the current adapter's `host` value prepended to it.\n\n* Links with no beginning `/` will have a parentURL prepended to it, via the current adapter's `buildURL`.", + "itemtype": "method", + "name": "findBelongsTo", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "url", + "description": "", + "type": "String" + }, + { + "name": "relationship", + "description": "meta object describing the relationship", + "type": "Object" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "class": "RESTAdapter", + "module": "@ember-data/adapter/rest" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 816, + "description": "Called by the store when a newly created record is\nsaved via the `save` method on a model record instance.\n\nThe `createRecord` method serializes the record and makes an Ajax (HTTP POST) request\nto a URL computed by `buildURL`.\n\nSee `serialize` for information on how to customize the serialized form\nof a record.", + "itemtype": "method", + "name": "createRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "", + "type": "Model" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "class": "RESTAdapter", + "module": "@ember-data/adapter/rest" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 841, + "description": "Called by the store when an existing record is saved\nvia the `save` method on a model record instance.\n\nThe `updateRecord` method serializes the record and makes an Ajax (HTTP PUT) request\nto a URL computed by `buildURL`.\n\nSee `serialize` for information on how to customize the serialized form\nof a record.", + "itemtype": "method", + "name": "updateRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "schema", + "description": "", + "type": "Model" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "class": "RESTAdapter", + "module": "@ember-data/adapter/rest" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 868, + "description": "Called by the store when a record is deleted.\n\nThe `deleteRecord` method makes an Ajax (HTTP DELETE) request to a URL computed by `buildURL`.", + "itemtype": "method", + "name": "deleteRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "", + "type": "Model" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "class": "RESTAdapter", + "module": "@ember-data/adapter/rest" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 918, + "description": "Organize records into groups, each of which is to be passed to separate\ncalls to `findMany`.\n\nThis implementation groups together records that have the same base URL but\ndiffering ids. For example `/comments/1` and `/comments/2` will be grouped together\nbecause we know findMany can coalesce them together as `/comments?ids[]=1&ids[]=2`\n\nIt also supports urls where ids are passed as a query param, such as `/comments?id=1`\nbut not those where there is more than 1 query param such as `/comments?id=2&name=David`\nCurrently only the query param of `id` is supported. If you need to support others, please\noverride this or the `_stripIDFromURL` method.\n\nIt does not group records that have differing base urls, such as for example: `/posts/1/comments/2`\nand `/posts/2/comments/3`", + "itemtype": "method", + "name": "groupRecordsForFindMany", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "snapshots", + "description": "", + "type": "Array" + } + ], + "return": { + "description": "an array of arrays of records, each of which is to be\n loaded separately by `findMany`.", + "type": "Array" + }, + "class": "RESTAdapter", + "module": "@ember-data/adapter/rest" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 965, + "description": "Takes an ajax response, and returns the json payload or an error.\n\nBy default this hook just returns the json payload passed to it.\nYou might want to override it in two cases:\n\n1. Your API might return useful results in the response headers.\nResponse headers are passed in as the second argument.\n\n2. Your API might return errors as successful responses with status code\n200 and an Errors text or object. You can return a `InvalidError` or a\n`AdapterError` (or a sub class) from this hook and it will automatically\nreject the promise and put your record into the invalid or error state.\n\nReturning a `InvalidError` from this method will cause the\nrecord to transition into the `invalid` state and make the\n`errors` object available on the record. When returning an\n`InvalidError` the store will attempt to normalize the error data\nreturned from the server using the serializer's `extractErrors`\nmethod.", + "since": "1.13.0", + "itemtype": "method", + "name": "handleResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "status", + "description": "", + "type": "Number" + }, + { + "name": "headers", + "description": "", + "type": "Object" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "requestData", + "description": "- the original request information", + "type": "Object" + } + ], + "return": { + "description": "response", + "type": "Object | AdapterError" + }, + "class": "RESTAdapter", + "module": "@ember-data/adapter/rest" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 1028, + "description": "Default `handleResponse` implementation uses this hook to decide if the\nresponse is a success.", + "since": "1.13.0", + "itemtype": "method", + "name": "isSuccess", + "access": "public", + "tagname": "", + "params": [ + { + "name": "status", + "description": "", + "type": "Number" + }, + { + "name": "headers", + "description": "", + "type": "Object" + }, + { + "name": "payload", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "RESTAdapter", + "module": "@ember-data/adapter/rest" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 1044, + "description": "Default `handleResponse` implementation uses this hook to decide if the\nresponse is an invalid error.", + "since": "1.13.0", + "itemtype": "method", + "name": "isInvalid", + "access": "public", + "tagname": "", + "params": [ + { + "name": "status", + "description": "", + "type": "Number" + }, + { + "name": "headers", + "description": "", + "type": "Object" + }, + { + "name": "payload", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "RESTAdapter", + "module": "@ember-data/adapter/rest" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 1060, + "description": "Takes a URL, an HTTP method and a hash of data, and makes an\nHTTP request.\n\nWhen the server responds with a payload, Ember Data will call into `extractSingle`\nor `extractArray` (depending on whether the original query was for one record or\nmany records).\n\nBy default, `ajax` method has the following behavior:\n\n* It sets the response `dataType` to `\"json\"`\n* If the HTTP method is not `\"GET\"`, it sets the `Content-Type` to be\n `application/json; charset=utf-8`\n* If the HTTP method is not `\"GET\"`, it stringifies the data passed in. The\n data is the serialized record in the case of a save.\n* Registers success and failure handlers.", + "itemtype": "method", + "name": "ajax", + "access": "private", + "tagname": "", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + }, + { + "name": "type", + "description": "The request type GET, POST, PUT, DELETE etc.", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "class": "RESTAdapter", + "module": "@ember-data/adapter/rest" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 1105, + "itemtype": "method", + "name": "_ajaxRequest", + "access": "private", + "tagname": "", + "params": [ + { + "name": "options", + "description": "jQuery ajax options to be used for the ajax request", + "type": "Object" + } + ], + "class": "RESTAdapter", + "module": "@ember-data/adapter/rest" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 1129, + "itemtype": "method", + "name": "ajaxOptions", + "access": "private", + "tagname": "", + "params": [ + { + "name": "url", + "description": "", + "type": "String" + }, + { + "name": "type", + "description": "The request type GET, POST, PUT, DELETE etc.", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "RESTAdapter", + "module": "@ember-data/adapter/rest" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 1204, + "itemtype": "method", + "name": "parseErrorResponse", + "access": "private", + "tagname": "", + "params": [ + { + "name": "responseText", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "RESTAdapter", + "module": "@ember-data/adapter/rest" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 1222, + "itemtype": "method", + "name": "normalizeErrorResponse", + "access": "private", + "tagname": "", + "params": [ + { + "name": "status", + "description": "", + "type": "Number" + }, + { + "name": "headers", + "description": "", + "type": "Object" + }, + { + "name": "payload", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "errors payload", + "type": "Array" + }, + "class": "RESTAdapter", + "module": "@ember-data/adapter/rest" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 1252, + "description": "Generates a detailed (\"friendly\") error message, with plenty\nof information for debugging (good luck!)", + "itemtype": "method", + "name": "generatedDetailedMessage", + "access": "private", + "tagname": "", + "params": [ + { + "name": "status", + "description": "", + "type": "Number" + }, + { + "name": "headers", + "description": "", + "type": "Object" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "requestData", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "detailed error message", + "type": "String" + }, + "class": "RESTAdapter", + "module": "@ember-data/adapter/rest" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 1286, + "description": "Used by `findAll` and `findRecord` to build the query's `data` hash\nsupplied to the ajax method.", + "itemtype": "method", + "name": "buildQuery", + "since": "2.5.0", + "access": "public", + "tagname": "", + "params": [ + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "RESTAdapter", + "module": "@ember-data/adapter/rest" + }, + { + "file": "../packages/adapter/src/rest.ts", + "line": 1464, + "description": "Helper function that translates the options passed to `jQuery.ajax` into a format that `fetch` expects.", + "itemtype": "method", + "name": "fetchOptions", + "params": [ + { + "name": "_options", + "description": "", + "type": "Object" + }, + { + "name": "adapter", + "description": "", + "type": "Adapter" + } + ], + "access": "private", + "tagname": "", + "return": { + "description": "", + "type": "Object" + }, + "class": "@ember-data/adapter/rest", + "module": "@ember-data/adapter/rest" + }, + { + "file": "../packages/debug/addon/index.js", + "line": 57, + "description": "Specifies how records can be filtered based on the state of the record\nRecords returned will need to have a `filterValues`\nproperty with a key for every name in the returned array", + "itemtype": "method", + "name": "getFilters", + "access": "private", + "tagname": "", + "return": { + "description": "List of objects defining filters\n The object should have a `name` and `desc` property", + "type": "Array" + }, + "class": "InspectorDataAdapter", + "module": "@ember-data/debug" + }, + { + "file": "../packages/debug/addon/index.js", + "line": 79, + "description": "Fetch the model types and observe them for changes.\nMaintains the list of model types without needing the Model package for detection.", + "itemtype": "method", + "name": "watchModelTypes", + "access": "private", + "tagname": "", + "params": [ + { + "name": "typesAdded", + "description": "Callback to call to add types.\nTakes an array of objects containing wrapped types (returned from `wrapModelType`).", + "type": "Function" + }, + { + "name": "typesUpdated", + "description": "Callback to call when a type has changed.\nTakes an array of objects containing wrapped types.", + "type": "Function" + } + ], + "return": { + "description": "Method to call to remove all observers", + "type": "Function" + }, + "class": "InspectorDataAdapter", + "module": "@ember-data/debug" + }, + { + "file": "../packages/debug/addon/index.js", + "line": 130, + "description": "Loop over the discovered types and use the callbacks from watchModelTypes to notify\nthe consumer of this adapter about the mdoels.", + "itemtype": "method", + "name": "watchTypeIfUnseen", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "discoveredTypes", + "description": "", + "type": "Map" + }, + { + "name": "type", + "description": "", + "type": "String" + }, + { + "name": "typesAdded", + "description": "", + "type": "Function" + }, + { + "name": "typesUpdated", + "description": "", + "type": "Function" + }, + { + "name": "releaseMethods", + "description": "", + "type": "Array" + } + ], + "access": "private", + "tagname": "", + "class": "InspectorDataAdapter", + "module": "@ember-data/debug" + }, + { + "file": "../packages/debug/addon/index.js", + "line": 153, + "description": "Creates a human readable string used for column headers", + "itemtype": "method", + "name": "columnNameToDesc", + "access": "private", + "tagname": "", + "params": [ + { + "name": "name", + "description": "The attribute name", + "type": "String" + } + ], + "return": { + "description": "Human readable string based on the attribute name", + "type": "String" + }, + "class": "InspectorDataAdapter", + "module": "@ember-data/debug" + }, + { + "file": "../packages/debug/addon/index.js", + "line": 165, + "description": "Get the columns for a given model type", + "itemtype": "method", + "name": "columnsForType", + "access": "private", + "tagname": "", + "params": [ + { + "name": "typeClass", + "description": "", + "type": "Model" + } + ], + "return": { + "description": "An array of columns of the following format:\n name: {String} The name of the column\n desc: {String} Humanized description (what would show in a table column name)", + "type": "Array" + }, + "class": "InspectorDataAdapter", + "module": "@ember-data/debug" + }, + { + "file": "../packages/debug/addon/index.js", + "line": 194, + "description": "Fetches all loaded records for a given type", + "itemtype": "method", + "name": "getRecords", + "access": "private", + "tagname": "", + "params": [ + { + "name": "modelClass", + "description": "of the record", + "type": "Model" + }, + { + "name": "modelName", + "description": "of the record", + "type": "String" + } + ], + "return": { + "description": "An array of Model records\n This array will be observed for changes,\n so it should update when new records are added/removed", + "type": "Array" + }, + "class": "InspectorDataAdapter", + "module": "@ember-data/debug" + }, + { + "file": "../packages/debug/addon/index.js", + "line": 220, + "description": "Gets the values for each column\nThis is the attribute values for a given record", + "itemtype": "method", + "name": "getRecordColumnValues", + "access": "private", + "tagname": "", + "params": [ + { + "name": "record", + "description": "to get values from", + "type": "Model" + } + ], + "return": { + "description": "Keys should match column names defined by the model type", + "type": "Object" + }, + "class": "InspectorDataAdapter", + "module": "@ember-data/debug" + }, + { + "file": "../packages/debug/addon/index.js", + "line": 242, + "description": "Returns keywords to match when searching records", + "itemtype": "method", + "name": "getRecordKeywords", + "access": "private", + "tagname": "", + "params": [ + { + "name": "record", + "description": "", + "type": "Model" + } + ], + "return": { + "description": "Relevant keywords for search based on the record's attribute values", + "type": "Array" + }, + "class": "InspectorDataAdapter", + "module": "@ember-data/debug" + }, + { + "file": "../packages/debug/addon/index.js", + "line": 258, + "description": "Returns the values of filters defined by `getFilters`\nThese reflect the state of the record", + "itemtype": "method", + "name": "getRecordFilterValues", + "access": "private", + "tagname": "", + "params": [ + { + "name": "record", + "description": "", + "type": "Model" + } + ], + "return": { + "description": "The record state filter values", + "type": "Object" + }, + "class": "InspectorDataAdapter", + "module": "@ember-data/debug" + }, + { + "file": "../packages/debug/addon/index.js", + "line": 275, + "description": "Returns a color that represents the record's state\nPossible colors: black, blue, green", + "itemtype": "method", + "name": "getRecordColor", + "access": "private", + "tagname": "", + "params": [ + { + "name": "record", + "description": "", + "type": "Model" + } + ], + "return": { + "description": "The record color", + "type": "String" + }, + "class": "InspectorDataAdapter", + "module": "@ember-data/debug" + }, + { + "file": "../packages/debug/addon/index.js", + "line": 294, + "description": "Observes all relevant properties and re-sends the wrapped record\nwhen a change occurs", + "itemtype": "method", + "name": "observeRecord", + "access": "private", + "tagname": "", + "params": [ + { + "name": "record", + "description": "", + "type": "Model" + }, + { + "name": "recordUpdated", + "description": "Callback used to notify changes", + "type": "Function" + } + ], + "return": { + "description": "The function to call to remove all observers", + "type": "Function" + }, + "class": "InspectorDataAdapter", + "module": "@ember-data/debug" + }, + { + "file": "../packages/json-api/src/-private/builders/find-record.ts", + "line": 15, + "description": "Builds request options to fetch a single resource by a known id or identifier\nconfigured for the url and header expectations of most JSON:API APIs.\n\n**Basic Usage**\n\n```ts\nimport { findRecord } from '@ember-data/json-api/request';\n\nconst data = await store.request(findRecord('person', '1'));\n```\n\n**With Options**\n\n```ts\nimport { findRecord } from '@ember-data/json-api/request';\n\nconst options = findRecord('person', '1', { include: ['pets', 'friends'] });\nconst data = await store.request(options);\n```\n\n**With an Identifier**\n\n```ts\nimport { findRecord } from '@ember-data/json-api/request';\n\nconst options = findRecord({ type: 'person', id: '1' }, { include: ['pets', 'friends'] });\nconst data = await store.request(options);\n```\n\n**Supplying Options to Modify the Request Behavior**\n\nThe following options are supported:\n\n- `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.\n- `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.\n- `resourcePath` - The resource path to use for the request, defaults to pluralizing the supplied type\n- `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to `false` if none is configured.\n- `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to `false` if none is configured.\n- `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)\n\n```ts\nimport { findRecord } from '@ember-data/json-api/request';\n\nconst options = findRecord('person', '1', { include: ['pets', 'friends'] }, { namespace: 'api/v2' });\nconst data = await store.request(options);\n```", + "itemtype": "method", + "name": "findRecord", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/json-api/request", + "module": "@ember-data/json-api/request" + }, + { + "file": "../packages/json-api/src/-private/builders/query.ts", + "line": 11, + "description": "Builds request options to query for resources, usually by a primary\ntype, configured for the url and header expectations of most JSON:API APIs.\n\n**Basic Usage**\n\n```ts\nimport { query } from '@ember-data/json-api/request';\n\nconst data = await store.request(query('person'));\n```\n\n**With Query Params**\n\n```ts\nimport { query } from '@ember-data/json-api/request';\n\nconst options = query('person', { include: ['pets', 'friends'] });\nconst data = await store.request(options);\n```\n\n**Supplying Options to Modify the Request Behavior**\n\nThe following options are supported:\n\n- `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.\n- `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.\n- `resourcePath` - The resource path to use for the request, defaults to pluralizing the supplied type\n- `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to `false` if none is configured.\n- `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to `false` if none is configured.\n- `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)\n\n```ts\nimport { query } from '@ember-data/json-api/request';\n\nconst options = query('person', { include: ['pets', 'friends'] }, { reload: true });\nconst data = await store.request(options);\n```", + "itemtype": "method", + "name": "query", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "query", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/json-api/request", + "module": "@ember-data/json-api/request" + }, + { + "file": "../packages/json-api/src/-private/builders/save-record.ts", + "line": 26, + "description": "Builds request options to delete record for resources,\nconfigured for the url, method and header expectations of most JSON:API APIs.\n\n**Basic Usage**\n\n```ts\nimport { deleteRecord } from '@ember-data/json-api/request';\n\nconst person = this.store.peekRecord('person', '1');\n\n// mark record as deleted\nstore.deleteRecord(person);\n\n// persist deletion\nconst data = await store.request(deleteRecord(person));\n```\n\n**Supplying Options to Modify the Request Behavior**\n\nThe following options are supported:\n\n- `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.\n- `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.\n- `resourcePath` - The resource path to use for the request, defaults to pluralizing the supplied type\n- `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to `false` if none is configured.\n- `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to `false` if none is configured.\n- `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)\n\n```ts\nimport { deleteRecord } from '@ember-data/json-api/request';\n\nconst person = this.store.peekRecord('person', '1');\n\n// mark record as deleted\nstore.deleteRecord(person);\n\n// persist deletion\nconst options = deleteRecord(person, { namespace: 'api/v1' });\nconst data = await store.request(options);\n```", + "itemtype": "method", + "name": "deleteRecord", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "record", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/json-api/request", + "module": "@ember-data/json-api/request" + }, + { + "file": "../packages/json-api/src/-private/builders/save-record.ts", + "line": 106, + "description": "Builds request options to create new record for resources,\nconfigured for the url, method and header expectations of most JSON:API APIs.\n\n**Basic Usage**\n\n```ts\nimport { createRecord } from '@ember-data/json-api/request';\n\nconst person = this.store.createRecord('person', { name: 'Ted' });\nconst data = await store.request(createRecord(person));\n```\n\n**Supplying Options to Modify the Request Behavior**\n\nThe following options are supported:\n\n- `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.\n- `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.\n- `resourcePath` - The resource path to use for the request, defaults to pluralizing the supplied type\n- `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to `false` if none is configured.\n- `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to `false` if none is configured.\n- `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)\n\n```ts\nimport { createRecord } from '@ember-data/json-api/request';\n\nconst person = this.store.createRecord('person', { name: 'Ted' });\nconst options = createRecord(person, { namespace: 'api/v1' });\nconst data = await store.request(options);\n```", + "itemtype": "method", + "name": "createRecord", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "record", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/json-api/request", + "module": "@ember-data/json-api/request" + }, + { + "file": "../packages/json-api/src/-private/builders/save-record.ts", + "line": 175, + "description": "Builds request options to update existing record for resources,\nconfigured for the url, method and header expectations of most JSON:API APIs.\n\n**Basic Usage**\n\n```ts\nimport { updateRecord } from '@ember-data/json-api/request';\n\nconst person = this.store.peekRecord('person', '1');\nperson.name = 'Chris';\nconst data = await store.request(updateRecord(person));\n```\n\n**Supplying Options to Modify the Request Behavior**\n\nThe following options are supported:\n\n- `patch` - Allows caller to specify whether to use a PATCH request instead of a PUT request, defaults to `false`.\n- `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.\n- `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.\n- `resourcePath` - The resource path to use for the request, defaults to pluralizing the supplied type\n- `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to `false` if none is configured.\n- `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to `false` if none is configured.\n- `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)\n\n```ts\nimport { updateRecord } from '@ember-data/json-api/request';\n\nconst person = this.store.peekRecord('person', '1');\nperson.name = 'Chris';\nconst options = updateRecord(person, { patch: true });\nconst data = await store.request(options);\n```", + "itemtype": "method", + "name": "updateRecord", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "record", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/json-api/request", + "module": "@ember-data/json-api/request" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 109, + "description": "The Cache Version that this implementation implements.", + "type": "{'2'}", + "access": "public", + "tagname": "", + "itemtype": "property", + "name": "version", + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 135, + "description": "Cache the response to a request\n\nImplements `Cache.put`.\n\nExpects a StructuredDocument whose `content` member is a JsonApiDocument.\n\n```js\ncache.put({\n request: { url: 'https://api.example.com/v1/user/1' },\n content: {\n data: {\n type: 'user',\n id: '1',\n attributes: {\n name: 'Chris'\n }\n }\n }\n})\n```\n\n> **Note:** The nested `content` and `data` members are not a mistake. This is because\n> there are two separate concepts involved here, the `StructuredDocument` which contains\n> the context of a given Request that has been issued with the returned contents as its\n> `content` property, and a `JSON:API Document` which is the json contents returned by\n> this endpoint and which uses its `data` property to signify which resources are the\n> primary resources associated with the request.\n\nStructuredDocument's with urls will be cached as full documents with\nassociated resource membership order and contents preserved but linked\ninto the cache.", + "itemtype": "method", + "name": "put", + "params": [ + { + "name": "doc", + "description": "", + "type": "StructuredDocument" + } + ], + "return": { + "description": "", + "type": "ResourceDocument" + }, + "access": "public", + "tagname": "", + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 319, + "description": "Update the \"remote\" or \"canonical\" (persisted) state of the Cache\nby merging new information into the existing state.\n\nNote: currently the only valid resource operation is a MergeOperation\nwhich occurs when a collision of identifiers is detected.", + "itemtype": "method", + "name": "patch", + "access": "public", + "tagname": "", + "params": [ + { + "name": "op", + "description": "the operation to perform", + "type": "Operation" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 352, + "description": "Update the \"local\" or \"current\" (unpersisted) state of the Cache", + "itemtype": "method", + "name": "mutate", + "params": [ + { + "name": "mutation", + "description": "", + "type": "Mutation" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "access": "public", + "tagname": "", + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 374, + "description": "Peek resource data from the Cache.\n\nIn development, if the return value\nis JSON the return value\nwill be deep-cloned and deep-frozen\nto prevent mutation thereby enforcing cache\nImmutability.\n\nThis form of peek is useful for implementations\nthat want to feed raw-data from cache to the UI\nor which want to interact with a blob of data\ndirectly from the presentation cache.\n\nAn implementation might want to do this because\nde-referencing records which read from their own\nblob is generally safer because the record does\nnot require retainining connections to the Store\nand Cache to present data on a per-field basis.\n\nThis generally takes the place of `getAttr` as\nan API and may even take the place of `getRelationship`\ndepending on implementation specifics, though this\nlatter usage is less recommended due to the advantages\nof the Graph handling necessary entanglements and\nnotifications for relational data.", + "itemtype": "method", + "name": "peek", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "", + "type": "StableRecordIdentifier | StableDocumentIdentifier" + } + ], + "return": { + "description": "the known resource data", + "type": "ResourceDocument | ResourceBlob | null" + }, + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 448, + "description": "Peek the Cache for the existing request data associated with\na cacheable request", + "itemtype": "method", + "name": "peekRequest", + "params": [ + { + "name": "UNKNOWN", + "description": "", + "type": "StableDocumentIdentifier" + } + ], + "return": { + "description": "", + "type": "StableDocumentIdentifier | null" + }, + "access": "public", + "tagname": "", + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 461, + "description": "Push resource data from a remote source into the cache for this identifier", + "itemtype": "method", + "name": "upsert", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "data", + "description": "" + }, + { + "name": "hasRecord", + "description": "" + } + ], + "return": { + "description": "if `hasRecord` is true then calculated key changes should be returned", + "type": "Void | string[]" + }, + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 549, + "description": "Merge a fork back into a parent Cache.\n\nApplications should typically not call this method themselves,\npreferring instead to merge at the Store level, which will\nutilize this method to merge the caches.", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "cache", + "description": "", + "type": "Cache" + } + ], + "access": "public", + "tagname": "", + "return": { + "description": "Promise" + }, + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 565, + "description": "Generate the list of changes applied to all\nrecord in the store.\n\nEach individual resource or document that has\nbeen mutated should be described as an individual\n`Change` entry in the returned array.\n\nA `Change` is described by an object containing up to\nthree properties: (1) the `identifier` of the entity that\nchanged; (2) the `op` code of that change being one of\n`upsert` or `remove`, and if the op is `upsert` a `patch`\ncontaining the data to merge into the cache for the given\nentity.\n\nThis `patch` is opaque to the Store but should be understood\nby the Cache and may expect to be utilized by an Adapter\nwhen generating data during a `save` operation.\n\nIt is generally recommended that the `patch` contain only\nthe updated state, ignoring fields that are unchanged\n\n```ts\ninterface Change {\n identifier: StableRecordIdentifier | StableDocumentIdentifier;\n op: 'upsert' | 'remove';\n patch?: unknown;\n}\n```", + "itemtype": "method", + "name": "diff", + "access": "public", + "tagname": "", + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 605, + "description": "Serialize the entire contents of the Cache into a Stream\nwhich may be fed back into a new instance of the same Cache\nvia `cache.hydrate`.", + "itemtype": "method", + "name": "dump", + "return": { + "description": "", + "type": "Promise" + }, + "access": "public", + "tagname": "", + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 618, + "description": "hydrate a Cache from a Stream with content previously serialized\nfrom another instance of the same Cache, resolving when hydration\nis complete.\n\nThis method should expect to be called both in the context of restoring\nthe Cache during application rehydration after SSR **AND** at unknown\ntimes during the lifetime of an already booted application when it is\ndesired to bulk-load additional information into the cache. This latter\nbehavior supports optimizing pre/fetching of data for route transitions\nvia data-only SSR modes.", + "itemtype": "method", + "name": "hydrate", + "params": [ + { + "name": "stream", + "description": "", + "type": "ReadableStream" + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "access": "public", + "tagname": "", + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 642, + "description": "[LIFECYCLE] Signal to the cache that a new record has been instantiated on the client\n\nIt returns properties from options that should be set on the record during the create\nprocess. This return value behavior is deprecated.", + "itemtype": "method", + "name": "clientDidCreate", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "createArgs", + "description": "" + } + ], + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 729, + "description": "[LIFECYCLE] Signals to the cache that a resource\nwill be part of a save transaction.", + "itemtype": "method", + "name": "willCommit", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 761, + "description": "[LIFECYCLE] Signals to the cache that a resource\nwas successfully updated as part of a save transaction.", + "itemtype": "method", + "name": "didCommit", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "data", + "description": "" + } + ], + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 900, + "description": "[LIFECYCLE] Signals to the cache that a resource\nwas update via a save transaction failed.", + "itemtype": "method", + "name": "commitWasRejected", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "errors", + "description": "" + } + ], + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 929, + "description": "[LIFECYCLE] Signals to the cache that all data for a resource\nshould be cleared.\n\nThis method is a candidate to become a mutation", + "itemtype": "method", + "name": "unloadRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 1012, + "description": "Retrieve the data for an attribute from the cache", + "itemtype": "method", + "name": "getAttr", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "field", + "description": "" + } + ], + "return": { + "description": "", + "type": "Unknown" + }, + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 1035, + "description": "Mutate the data for an attribute in the cache\n\nThis method is a candidate to become a mutation", + "itemtype": "method", + "name": "setAttr", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "field", + "description": "" + }, + { + "name": "value", + "description": "" + } + ], + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 1067, + "description": "Query the cache for the changed attributes of a resource.", + "itemtype": "method", + "name": "changedAttrs", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "return": { + "description": "{ : [, ] }", + "type": "ChangedAttributesHash" + }, + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 1080, + "description": "Query the cache for whether any mutated attributes exist", + "itemtype": "method", + "name": "hasChangedAttrs", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 1097, + "description": "Tell the cache to discard any uncommitted mutations to attributes\n\nThis method is a candidate to become a mutation", + "itemtype": "method", + "name": "rollbackAttrs", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "return": { + "description": "the names of fields that were restored", + "type": "String[]" + }, + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 1141, + "description": "Query the cache for the changes to relationships of a resource.\n\nReturns a map of relationship names to RelationshipDiff objects.\n\n```ts\ntype RelationshipDiff =\n | {\n kind: 'collection';\n remoteState: StableRecordIdentifier[];\n additions: Set;\n removals: Set;\n localState: StableRecordIdentifier[];\n reordered: boolean;\n }\n | {\n kind: 'resource';\n remoteState: StableRecordIdentifier | null;\n localState: StableRecordIdentifier | null;\n };\n ```", + "itemtype": "method", + "name": "changedRelationships", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "", + "type": "StableRecordIdentifier" + } + ], + "return": { + "description": "", + "type": "Map" + }, + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 1172, + "description": "Query the cache for whether any mutated attributes exist", + "itemtype": "method", + "name": "hasChangedRelationships", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "", + "type": "StableRecordIdentifier" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 1184, + "description": "Tell the cache to discard any uncommitted mutations to relationships.\n\nThis will also discard the change on any appropriate inverses.\n\nThis method is a candidate to become a mutation", + "itemtype": "method", + "name": "rollbackRelationships", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "", + "type": "StableRecordIdentifier" + } + ], + "return": { + "description": "the names of relationships that were restored", + "type": "String[]" + }, + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 1205, + "description": "Query the cache for the current state of a relationship property", + "itemtype": "method", + "name": "getRelationship", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "field", + "description": "" + } + ], + "return": { + "description": "resource relationship object" + }, + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 1224, + "description": "Update the cache state for the given resource to be marked\nas locally deleted, or remove such a mark.\n\nThis method is a candidate to become a mutation", + "itemtype": "method", + "name": "setIsDeleted", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "isDeleted", + "description": "", + "type": "Boolean" + } + ], + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 1242, + "description": "Query the cache for any validation errors applicable to the given resource.", + "itemtype": "method", + "name": "getErrors", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "return": { + "description": "", + "type": "JsonApiError[]" + }, + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 1254, + "description": "Query the cache for whether a given resource has any available data", + "itemtype": "method", + "name": "isEmpty", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 1267, + "description": "Query the cache for whether a given resource was created locally and not\nyet persisted.", + "itemtype": "method", + "name": "isNew", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 1281, + "description": "Query the cache for whether a given resource is marked as deleted (but not\nnecessarily persisted yet).", + "itemtype": "method", + "name": "isDeleted", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/cache.ts", + "line": 1295, + "description": "Query the cache for whether a given resource has been deleted and that deletion\nhas also been persisted.", + "itemtype": "method", + "name": "isDeletionCommitted", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "Cache", + "module": "@ember-data/json-api" + }, + { + "file": "../packages/json-api/src/-private/serialize.ts", + "line": 10, + "description": "Serializes the current state of a resource or array of resources for use with POST or PUT requests.", + "itemtype": "method", + "name": "serializeResources", + "static": 1, + "access": "public", + "tagname": "", + "params": [ + { + "name": "cache}", + "description": "", + "type": "Cache" + }, + { + "name": "identifier", + "description": "", + "type": "StableRecordIdentifier" + } + ], + "return": { + "description": "An object with a `data` property containing the serialized resource patch", + "type": "Object" + }, + "class": "@ember-data/json-api/request", + "module": "@ember-data/json-api/request" + }, + { + "file": "../packages/json-api/src/-private/serialize.ts", + "line": 47, + "description": "Serializes changes to a resource for use with PATCH requests.\n\nOnly attributes which are changed are serialized.\nOnly relationships which are changed are serialized.\n\nCollection relationships serialize the collection as a whole.\n\nIf you would like to serialize updates to a collection more granularly\n(for instance, as operations) request the diff from the store and\nserialize as desired:\n\n```ts\nconst relationshipDiffMap = cache.changedRelationships(identifier);\n```", + "itemtype": "method", + "name": "serializePatch", + "static": 1, + "access": "public", + "tagname": "", + "params": [ + { + "name": "cache}", + "description": "", + "type": "Cache" + }, + { + "name": "identifier", + "description": "", + "type": "StableRecordIdentifier" + } + ], + "return": { + "description": "An object with a `data` property containing the serialized resource patch", + "type": "Object" + }, + "class": "@ember-data/json-api/request", + "module": "@ember-data/json-api/request" + }, + { + "file": "../packages/legacy-compat/src/legacy-network-handler/snapshot-record-array.ts", + "line": 29, + "description": "SnapshotRecordArray is not directly instantiable.\nInstances are provided to consuming application's\nadapters and serializers for certain requests.", + "itemtype": "method", + "name": "constructor", + "access": "private", + "tagname": "", + "is_constructor": 1, + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "type", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "" + } + ], + "class": "SnapshotRecordArray", + "module": "@ember-data/legacy-compat" + }, + { + "file": "../packages/legacy-compat/src/legacy-network-handler/snapshot-record-array.ts", + "line": 43, + "description": "An array of snapshots", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_snapshots", + "type": "{Array}", + "class": "SnapshotRecordArray", + "module": "@ember-data/legacy-compat" + }, + { + "file": "../packages/legacy-compat/src/legacy-network-handler/snapshot-record-array.ts", + "line": 51, + "description": "The modelName of the underlying records for the snapshots in the array, as a Model", + "itemtype": "property", + "name": "modelName", + "access": "public", + "tagname": "", + "type": "{Model}", + "class": "SnapshotRecordArray", + "module": "@ember-data/legacy-compat" + }, + { + "file": "../packages/legacy-compat/src/legacy-network-handler/snapshot-record-array.ts", + "line": 59, + "description": "A hash of adapter options passed into the store method for this request.\n\nExample\n\n```app/adapters/post.js\nimport MyCustomAdapter from './custom-adapter';\n\nexport default class PostAdapter extends MyCustomAdapter {\n findAll(store, type, sinceToken, snapshotRecordArray) {\n if (snapshotRecordArray.adapterOptions.subscribe) {\n // ...\n }\n // ...\n }\n}\n```", + "itemtype": "property", + "name": "adapterOptions", + "access": "public", + "tagname": "", + "type": "{Object}", + "class": "SnapshotRecordArray", + "module": "@ember-data/legacy-compat" + }, + { + "file": "../packages/legacy-compat/src/legacy-network-handler/snapshot-record-array.ts", + "line": 83, + "description": "The relationships to include for this request.\n\nExample\n\n```app/adapters/application.js\nimport Adapter from '@ember-data/adapter';\n\nexport default class ApplicationAdapter extends Adapter {\n findAll(store, type, snapshotRecordArray) {\n let url = `/${type.modelName}?include=${encodeURIComponent(snapshotRecordArray.include)}`;\n\n return fetch(url).then((response) => response.json())\n }\n}\n```", + "itemtype": "property", + "name": "include", + "access": "public", + "tagname": "", + "type": "{String|Array}", + "class": "SnapshotRecordArray", + "module": "@ember-data/legacy-compat" + }, + { + "file": "../packages/legacy-compat/src/legacy-network-handler/snapshot-record-array.ts", + "line": 107, + "description": "An array of records", + "itemtype": "property", + "name": "_recordArray", + "access": "private", + "tagname": "", + "type": "{Array}", + "class": "SnapshotRecordArray", + "module": "@ember-data/legacy-compat" + }, + { + "file": "../packages/legacy-compat/src/legacy-network-handler/snapshot-record-array.ts", + "line": 118, + "description": "Number of records in the array\n\nExample\n\n```app/adapters/post.js\nimport JSONAPIAdapter from '@ember-data/adapter/json-api';\n\nexport default class PostAdapter extends JSONAPIAdapter {\n shouldReloadAll(store, snapshotRecordArray) {\n return !snapshotRecordArray.length;\n }\n});\n```", + "itemtype": "property", + "name": "length", + "access": "public", + "tagname": "", + "type": "{Number}", + "class": "SnapshotRecordArray", + "module": "@ember-data/legacy-compat" + }, + { + "file": "../packages/legacy-compat/src/legacy-network-handler/snapshot-record-array.ts", + "line": 141, + "description": "Get snapshots of the underlying record array\n\nExample\n\n```app/adapters/post.js\nimport JSONAPIAdapter from '@ember-data/adapter/json-api';\n\nexport default class PostAdapter extends JSONAPIAdapter {\n shouldReloadAll(store, snapshotArray) {\n let snapshots = snapshotArray.snapshots();\n\n return snapshots.any(function(ticketSnapshot) {\n let timeDiff = moment().diff(ticketSnapshot.attr('lastAccessedAt'), 'minutes');\n if (timeDiff > 20) {\n return true;\n } else {\n return false;\n }\n });\n }\n}\n```", + "itemtype": "method", + "name": "snapshots", + "access": "public", + "tagname": "", + "return": { + "description": "Array of snapshots", + "type": "Array" + }, + "class": "SnapshotRecordArray", + "module": "@ember-data/legacy-compat" + }, + { + "file": "../packages/legacy-compat/src/legacy-network-handler/snapshot.ts", + "line": 49, + "itemtype": "method", + "name": "constructor", + "is_constructor": 1, + "access": "private", + "tagname": "", + "params": [ + { + "name": "options", + "description": "" + }, + { + "name": "identifier", + "description": "" + }, + { + "name": "_store", + "description": "" + } + ], + "class": "Snapshot", + "module": "@ember-data/store" + }, + { + "file": "../packages/legacy-compat/src/legacy-network-handler/snapshot.ts", + "line": 69, + "description": "The unique RecordIdentifier associated with this Snapshot.", + "itemtype": "property", + "name": "identifier", + "access": "public", + "tagname": "", + "type": "{StableRecordIdentifier}", + "class": "Snapshot", + "module": "@ember-data/store" + }, + { + "file": "../packages/legacy-compat/src/legacy-network-handler/snapshot.ts", + "line": 89, + "description": "The id of the snapshot's underlying record\n\nExample\n\n```javascript\n// store.push('post', { id: 1, author: 'Tomster', title: 'Ember.js rocks' });\npostSnapshot.id; // => '1'\n```", + "itemtype": "property", + "name": "id", + "type": "{String}", + "access": "public", + "tagname": "", + "class": "Snapshot", + "module": "@ember-data/store" + }, + { + "file": "../packages/legacy-compat/src/legacy-network-handler/snapshot.ts", + "line": 105, + "description": "A hash of adapter options", + "itemtype": "property", + "name": "adapterOptions", + "type": "{Object}", + "access": "public", + "tagname": "", + "class": "Snapshot", + "module": "@ember-data/store" + }, + { + "file": "../packages/legacy-compat/src/legacy-network-handler/snapshot.ts", + "line": 113, + "description": "If `include` was passed to the options hash for the request, the value\nwould be available here.", + "itemtype": "property", + "name": "include", + "type": "{String|Array}", + "access": "public", + "tagname": "", + "class": "Snapshot", + "module": "@ember-data/store" + }, + { + "file": "../packages/legacy-compat/src/legacy-network-handler/snapshot.ts", + "line": 123, + "description": "The name of the type of the underlying record for this snapshot, as a string.", + "itemtype": "property", + "name": "modelName", + "type": "{String}", + "access": "public", + "tagname": "", + "class": "Snapshot", + "module": "@ember-data/store" + }, + { + "file": "../packages/legacy-compat/src/legacy-network-handler/snapshot.ts", + "line": 137, + "description": "The underlying record for this snapshot. Can be used to access methods and\nproperties defined on the record.\n\nExample\n\n```javascript\nlet json = snapshot.record.toJSON();\n```", + "itemtype": "property", + "name": "record", + "type": "{Model}", + "access": "public", + "tagname": "", + "class": "Snapshot", + "module": "@ember-data/store" + }, + { + "file": "../packages/legacy-compat/src/legacy-network-handler/snapshot.ts", + "line": 176, + "description": "Returns the value of an attribute.\n\nExample\n\n```javascript\n// store.push('post', { id: 1, author: 'Tomster', title: 'Ember.js rocks' });\npostSnapshot.attr('author'); // => 'Tomster'\npostSnapshot.attr('title'); // => 'Ember.js rocks'\n```\n\nNote: Values are loaded eagerly and cached when the snapshot is created.", + "itemtype": "method", + "name": "attr", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "The attribute value or undefined", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Snapshot", + "module": "@ember-data/store" + }, + { + "file": "../packages/legacy-compat/src/legacy-network-handler/snapshot.ts", + "line": 201, + "description": "Returns all attributes and their corresponding values.\n\nExample\n\n```javascript\n// store.push('post', { id: 1, author: 'Tomster', title: 'Ember.js rocks' });\npostSnapshot.attributes(); // => { author: 'Tomster', title: 'Ember.js rocks' }\n```", + "itemtype": "method", + "name": "attributes", + "return": { + "description": "All attributes of the current snapshot", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Snapshot", + "module": "@ember-data/store" + }, + { + "file": "../packages/legacy-compat/src/legacy-network-handler/snapshot.ts", + "line": 219, + "description": "Returns all changed attributes and their old and new values.\n\nExample\n\n```javascript\n// store.push('post', { id: 1, author: 'Tomster', title: 'Ember.js rocks' });\npostModel.set('title', 'Ember.js rocks!');\npostSnapshot.changedAttributes(); // => { title: ['Ember.js rocks', 'Ember.js rocks!'] }\n```", + "itemtype": "method", + "name": "changedAttributes", + "return": { + "description": "All changed attributes of the current snapshot", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Snapshot", + "module": "@ember-data/store" + }, + { + "file": "../packages/legacy-compat/src/legacy-network-handler/snapshot.ts", + "line": 250, + "description": "Returns the current value of a belongsTo relationship.\n\n`belongsTo` takes an optional hash of options as a second parameter,\ncurrently supported options are:\n\n- `id`: set to `true` if you only want the ID of the related record to be\nreturned.\n\nExample\n\n```javascript\n// store.push('post', { id: 1, title: 'Hello World' });\n// store.createRecord('comment', { body: 'Lorem ipsum', post: post });\ncommentSnapshot.belongsTo('post'); // => Snapshot\ncommentSnapshot.belongsTo('post', { id: true }); // => '1'\n\n// store.push('comment', { id: 1, body: 'Lorem ipsum' });\ncommentSnapshot.belongsTo('post'); // => undefined\n```\n\nCalling `belongsTo` will return a new Snapshot as long as there's any known\ndata for the relationship available, such as an ID. If the relationship is\nknown but unset, `belongsTo` will return `null`. If the contents of the\nrelationship is unknown `belongsTo` will return `undefined`.\n\nNote: Relationships are loaded lazily and cached upon first access.", + "itemtype": "method", + "name": "belongsTo", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object", + "optional": true + } + ], + "access": "public", + "tagname": "", + "return": { + "description": "A snapshot or ID of a known\nrelationship or null if the relationship is known but unset. undefined\nwill be returned if the contents of the relationship is unknown.", + "type": "(Snapshot|String|null|undefined)" + }, + "class": "Snapshot", + "module": "@ember-data/store" + }, + { + "file": "../packages/legacy-compat/src/legacy-network-handler/snapshot.ts", + "line": 363, + "description": "Returns the current value of a hasMany relationship.\n\n`hasMany` takes an optional hash of options as a second parameter,\ncurrently supported options are:\n\n- `ids`: set to `true` if you only want the IDs of the related records to be\nreturned.\n\nExample\n\n```javascript\n// store.push('post', { id: 1, title: 'Hello World', comments: [2, 3] });\npostSnapshot.hasMany('comments'); // => [Snapshot, Snapshot]\npostSnapshot.hasMany('comments', { ids: true }); // => ['2', '3']\n\n// store.push('post', { id: 1, title: 'Hello World' });\npostSnapshot.hasMany('comments'); // => undefined\n```\n\nNote: Relationships are loaded lazily and cached upon first access.", + "itemtype": "method", + "name": "hasMany", + "params": [ + { + "name": "keyName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object", + "optional": true + } + ], + "access": "public", + "tagname": "", + "return": { + "description": "An array of snapshots or IDs of a known\nrelationship or an empty array if the relationship is known but unset.\nundefined will be returned if the contents of the relationship is unknown.", + "type": "(Array|undefined)" + }, + "class": "Snapshot", + "module": "@ember-data/store" + }, + { + "file": "../packages/legacy-compat/src/legacy-network-handler/snapshot.ts", + "line": 472, + "description": "Iterates through all the attributes of the model, calling the passed\nfunction on each attribute.\n\nExample\n\n```javascript\nsnapshot.eachAttribute(function(name, meta) {\n // ...\n});\n```", + "itemtype": "method", + "name": "eachAttribute", + "params": [ + { + "name": "callback", + "description": "the callback to execute", + "type": "Function" + }, + { + "name": "binding", + "description": "the value to which the callback's `this` should be bound", + "type": "Object", + "optional": true + } + ], + "access": "public", + "tagname": "", + "class": "Snapshot", + "module": "@ember-data/store" + }, + { + "file": "../packages/legacy-compat/src/legacy-network-handler/snapshot.ts", + "line": 496, + "description": "Iterates through all the relationships of the model, calling the passed\nfunction on each relationship.\n\nExample\n\n```javascript\nsnapshot.eachRelationship(function(name, relationship) {\n // ...\n});\n```", + "itemtype": "method", + "name": "eachRelationship", + "params": [ + { + "name": "callback", + "description": "the callback to execute", + "type": "Function" + }, + { + "name": "binding", + "description": "the value to which the callback's `this` should be bound", + "type": "Object", + "optional": true + } + ], + "access": "public", + "tagname": "", + "class": "Snapshot", + "module": "@ember-data/store" + }, + { + "file": "../packages/legacy-compat/src/legacy-network-handler/snapshot.ts", + "line": 520, + "description": "Serializes the snapshot using the serializer for the model.\n\nExample\n\n```app/adapters/application.js\nimport Adapter from '@ember-data/adapter';\n\nexport default Adapter.extend({\n createRecord(store, type, snapshot) {\n let data = snapshot.serialize({ includeId: true });\n let url = `/${type.modelName}`;\n\n return fetch(url, {\n method: 'POST',\n body: data,\n }).then((response) => response.json())\n }\n});\n```", + "itemtype": "method", + "name": "serialize", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "an object whose values are primitive JSON values only", + "type": "Object" + }, + "access": "public", + "tagname": "", + "class": "Snapshot", + "module": "@ember-data/store" + }, + { + "file": "../packages/model/src/-private/references/belongs-to.ts", + "line": 102, + "description": "The identifier of the record that this reference refers to.\n`null` if no related record is known.", + "itemtype": "property", + "name": "identifier", + "type": "StableRecordIdentifier | null", + "access": "public", + "tagname": "", + "class": "BelongsToReference", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/references/belongs-to.ts", + "line": 135, + "itemtype": "method", + "description": "The `id` of the record that this reference refers to. Together, the\n`type()` and `id()` methods form a composite key for the identity\nmap. This can be used to access the id of an async relationship\nwithout triggering a fetch that would normally happen if you\nattempted to use `record.relationship.id`.\n\nExample\n\n```javascript\n// models/blog.js\nimport Model, { belongsTo } from '@ember-data/model';\n\nexport default class BlogModel extends Model {\n @belongsto('user', { async: true, inverse: null }) user;\n}\n\nlet blog = store.push({\n data: {\n type: 'blog',\n id: 1,\n relationships: {\n user: {\n data: { type: 'user', id: 1 }\n }\n }\n }\n });\nlet userRef = blog.belongsTo('user');\n\n// get the identifier of the reference\nif (userRef.remoteType() === \"id\") {\n let id = userRef.id();\n }\n```\n", + "name": "id", + "access": "public", + "tagname": "", + "return": { + "description": "The id of the record in this belongsTo relationship.", + "type": "String" + }, + "class": "BelongsToReference", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/references/belongs-to.ts", + "line": 179, + "description": "The link Ember Data will use to fetch or reload this belongs-to\nrelationship. By default it uses only the \"related\" resource linkage.\n\nExample\n\n```javascript\n// models/blog.js\nimport Model, { belongsTo } from '@ember-data/model';\nexport default Model.extend({\n user: belongsTo('user', { async: true, inverse: null })\n });\n\nlet blog = store.push({\n data: {\n type: 'blog',\n id: 1,\n relationships: {\n user: {\n links: {\n related: '/articles/1/author'\n }\n }\n }\n }\n });\nlet userRef = blog.belongsTo('user');\n\n// get the identifier of the reference\nif (userRef.remoteType() === \"link\") {\n let link = userRef.link();\n }\n```", + "itemtype": "method", + "name": "link", + "access": "public", + "tagname": "", + "return": { + "description": "The link Ember Data will use to fetch or reload this belongs-to relationship.", + "type": "String" + }, + "class": "BelongsToReference", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/references/belongs-to.ts", + "line": 229, + "description": "any links that have been received for this relationship", + "itemtype": "method", + "name": "links", + "access": "public", + "tagname": "", + "return": { + "description": "" + }, + "class": "BelongsToReference", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/references/belongs-to.ts", + "line": 242, + "description": "The meta data for the belongs-to relationship.\n\nExample\n\n```javascript\n// models/blog.js\nimport Model, { belongsTo } from '@ember-data/model';\nexport default Model.extend({\n user: belongsTo('user', { async: true, inverse: null })\n });\n\nlet blog = store.push({\n data: {\n type: 'blog',\n id: 1,\n relationships: {\n user: {\n links: {\n related: {\n href: '/articles/1/author'\n },\n },\n meta: {\n lastUpdated: 1458014400000\n }\n }\n }\n }\n });\n\nlet userRef = blog.belongsTo('user');\n\nuserRef.meta() // { lastUpdated: 1458014400000 }\n```", + "itemtype": "method", + "name": "meta", + "access": "public", + "tagname": "", + "return": { + "description": "The meta information for the belongs-to relationship.", + "type": "Object" + }, + "class": "BelongsToReference", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/references/belongs-to.ts", + "line": 297, + "itemtype": "method", + "description": "This returns a string that represents how the reference will be\nlooked up when it is loaded. If the relationship has a link it will\nuse the \"link\" otherwise it defaults to \"id\".\n\nExample\n\n```app/models/post.js\nimport Model, { hasMany } from '@ember-data/model';\n\nexport default class PostModel extends Model {\n @hasmany('comment', { async: true, inverse: null }) comments;\n}\n```\n\n```javascript\nlet post = store.push({\n data: {\n type: 'post',\n id: 1,\n relationships: {\n comments: {\n data: [{ type: 'comment', id: 1 }]\n }\n }\n }\n});\n\nlet commentsRef = post.hasMany('comments');\n\n// get the identifier of the reference\nif (commentsRef.remoteType() === \"ids\") {\n let ids = commentsRef.ids();\n} else if (commentsRef.remoteType() === \"link\") {\n let link = commentsRef.link();\n}\n```\n", + "name": "remoteType", + "access": "public", + "tagname": "", + "return": { + "description": "The name of the remote type. This should either be `link` or `id`", + "type": "String" + }, + "class": "BelongsToReference", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/references/belongs-to.ts", + "line": 347, + "itemtype": "method", + "description": "`push` can be used to update the data in the relationship and Ember\nData will treat the new data as the canonical value of this\nrelationship on the backend.\n\nExample\n\n```app/models/blog.js\nimport Model, { belongsTo } from '@ember-data/model';\n\nexport default class BlogModel extends Model {\n @belongsto('user', { async: true, inverse: null }) user;\n }\n\nlet blog = store.push({\n data: {\n type: 'blog',\n id: 1,\n relationships: {\n user: {\n data: { type: 'user', id: 1 }\n }\n }\n }\n });\nlet userRef = blog.belongsTo('user');\n\n// provide data for reference\nuserRef.push({\n data: {\n type: 'user',\n id: 1,\n attributes: {\n username: \"@user\"\n }\n }\n }).then(function(user) {\n userRef.value() === user;\n });\n```\n", + "name": "push", + "access": "public", + "tagname": "", + "params": [ + { + "name": "object", + "description": "a JSONAPI document object describing the new value of this relationship.", + "type": "Object" + } + ], + "return": { + "description": "A promise that resolves with the new value in this belongs-to relationship.", + "type": "Promise" + }, + "class": "BelongsToReference", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/references/belongs-to.ts", + "line": 420, + "itemtype": "method", + "description": "`value()` synchronously returns the current value of the belongs-to\nrelationship. Unlike `record.relationshipName`, calling\n`value()` on a reference does not trigger a fetch if the async\nrelationship is not yet loaded. If the relationship is not loaded\nit will always return `null`.\n\nExample\n\n```javascript\n// models/blog.js\nimport Model, { belongsTo } from '@ember-data/model';\n\nexport default class BlogModel extends Model {\n @belongsto('user', { async: true, inverse: null }) user;\n}\n\nlet blog = store.push({\n data: {\n type: 'blog',\n id: 1,\n relationships: {\n user: {\n data: { type: 'user', id: 1 }\n }\n }\n }\n });\nlet userRef = blog.belongsTo('user');\n\nuserRef.value(); // null\n\n// provide data for reference\nuserRef.push({\n data: {\n type: 'user',\n id: 1,\n attributes: {\n username: \"@user\"\n }\n }\n }).then(function(user) {\n userRef.value(); // user\n });\n```\n", + "name": "value", + "access": "public", + "tagname": "", + "return": { + "description": "the record in this relationship", + "type": "Model" + }, + "class": "BelongsToReference", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/references/belongs-to.ts", + "line": 475, + "itemtype": "method", + "description": "Loads a record in a belongs-to relationship if it is not already\nloaded. If the relationship is already loaded this method does not\ntrigger a new load.\n\nExample\n\n```javascript\n// models/blog.js\nimport Model, { belongsTo } from '@ember-data/model';\n\nexport default class BlogModel extends Model {\n @belongsto('user', { async: true, inverse: null }) user;\n}\n\nlet blog = store.push({\n data: {\n type: 'blog',\n id: 1,\n relationships: {\n user: {\n data: { type: 'user', id: 1 }\n }\n }\n }\n });\nlet userRef = blog.belongsTo('user');\n\nuserRef.value(); // null\n\nuserRef.load().then(function(user) {\n userRef.value() === user\n });\n```\n\nYou may also pass in an options object whose properties will be\nfed forward. This enables you to pass `adapterOptions` into the\nrequest given to the adapter via the reference.\n\nExample\n\n```javascript\nuserRef.load({ adapterOptions: { isPrivate: true } }).then(function(user) {\n userRef.value() === user;\n});\n```\n```app/adapters/user.js\nimport Adapter from '@ember-data/adapter';\n\nexport default class UserAdapter extends Adapter {\n findRecord(store, type, id, snapshot) {\n // In the adapter you will have access to adapterOptions.\n let adapterOptions = snapshot.adapterOptions;\n }\n});\n```\n", + "name": "load", + "access": "public", + "tagname": "", + "params": [ + { + "name": "options", + "description": "the options to pass in.", + "type": "Object" + } + ], + "return": { + "description": "a promise that resolves with the record in this belongs-to relationship.", + "type": "Promise" + }, + "class": "BelongsToReference", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/references/belongs-to.ts", + "line": 548, + "itemtype": "method", + "description": "Triggers a reload of the value in this relationship. If the\nremoteType is `\"link\"` Ember Data will use the relationship link to\nreload the relationship. Otherwise it will reload the record by its\nid.\n\nExample\n\n```javascript\n// models/blog.js\nimport Model, { belongsTo } from '@ember-data/model';\n\nexport default class BlogModel extends Model {\n @belongsto('user', { async: true, inverse: null }) user;\n}\n\nlet blog = store.push({\n data: {\n type: 'blog',\n id: 1,\n relationships: {\n user: {\n data: { type: 'user', id: 1 }\n }\n }\n }\n });\nlet userRef = blog.belongsTo('user');\n\nuserRef.reload().then(function(user) {\n userRef.value() === user\n });\n```\n\nYou may also pass in an options object whose properties will be\nfed forward. This enables you to pass `adapterOptions` into the\nrequest given to the adapter via the reference. A full example\ncan be found in the `load` method.\n\nExample\n\n```javascript\nuserRef.reload({ adapterOptions: { isPrivate: true } })\n```\n", + "name": "reload", + "access": "public", + "tagname": "", + "params": [ + { + "name": "options", + "description": "the options to pass in.", + "type": "Object" + } + ], + "return": { + "description": "a promise that resolves with the record in this belongs-to relationship after the reload has completed.", + "type": "Promise" + }, + "class": "BelongsToReference", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/references/has-many.ts", + "line": 102, + "description": "An array of identifiers for the records that this reference refers to.", + "itemtype": "property", + "name": "identifiers", + "type": "StableRecordIdentifier[]", + "access": "public", + "tagname": "", + "class": "HasManyReference", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/references/has-many.ts", + "line": 154, + "itemtype": "method", + "description": "This returns a string that represents how the reference will be\nlooked up when it is loaded. If the relationship has a link it will\nuse the \"link\" otherwise it defaults to \"id\".\n\nExample\n\n```app/models/post.js\nimport Model, { hasMany } from '@ember-data/model';\n\nexport default class PostModel extends Model {\n @hasmany('comment', { async: true, inverse: null }) comments;\n}\n```\n\n```javascript\nlet post = store.push({\n data: {\n type: 'post',\n id: 1,\n relationships: {\n comments: {\n data: [{ type: 'comment', id: 1 }]\n }\n }\n }\n});\n\nlet commentsRef = post.hasMany('comments');\n\n// get the identifier of the reference\nif (commentsRef.remoteType() === \"ids\") {\n let ids = commentsRef.ids();\n} else if (commentsRef.remoteType() === \"link\") {\n let link = commentsRef.link();\n}\n```\n", + "name": "remoteType", + "access": "public", + "tagname": "", + "return": { + "description": "The name of the remote type. This should either be `link` or `ids`", + "type": "String" + }, + "class": "HasManyReference", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/references/has-many.ts", + "line": 205, + "itemtype": "method", + "description": "`ids()` returns an array of the record IDs in this relationship.\n\nExample\n\n```app/models/post.js\nimport Model, { hasMany } from '@ember-data/model';\n\nexport default class PostModel extends Model {\n @hasmany('comment', { async: true, inverse: null }) comments;\n}\n```\n\n```javascript\nlet post = store.push({\n data: {\n type: 'post',\n id: 1,\n relationships: {\n comments: {\n data: [{ type: 'comment', id: 1 }]\n }\n }\n }\n});\n\nlet commentsRef = post.hasMany('comments');\n\ncommentsRef.ids(); // ['1']\n```\n", + "name": "ids", + "access": "public", + "tagname": "", + "return": { + "description": "The ids in this has-many relationship", + "type": "Array" + }, + "class": "HasManyReference", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/references/has-many.ts", + "line": 244, + "description": "The link Ember Data will use to fetch or reload this belongs-to\nrelationship. By default it uses only the \"related\" resource linkage.\n\nExample\n\n```javascript\n// models/blog.js\nimport Model, { belongsTo } from '@ember-data/model';\nexport default Model.extend({\n user: belongsTo('user', { async: true, inverse: null })\n });\n\nlet blog = store.push({\n data: {\n type: 'blog',\n id: 1,\n relationships: {\n user: {\n links: {\n related: '/articles/1/author'\n }\n }\n }\n }\n });\nlet userRef = blog.belongsTo('user');\n\n// get the identifier of the reference\nif (userRef.remoteType() === \"link\") {\n let link = userRef.link();\n }\n```", + "itemtype": "method", + "name": "link", + "access": "public", + "tagname": "", + "return": { + "description": "The link Ember Data will use to fetch or reload this belongs-to relationship.", + "type": "String" + }, + "class": "HasManyReference", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/references/has-many.ts", + "line": 294, + "description": "any links that have been received for this relationship", + "itemtype": "method", + "name": "links", + "access": "public", + "tagname": "", + "return": { + "description": "" + }, + "class": "HasManyReference", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/references/has-many.ts", + "line": 307, + "description": "The meta data for the has-many relationship.\n\nExample\n\n```javascript\n// models/blog.js\nimport Model, { hasMany } from '@ember-data/model';\nexport default Model.extend({\n users: hasMany('user', { async: true, inverse: null })\n });\n\nlet blog = store.push({\n data: {\n type: 'blog',\n id: 1,\n relationships: {\n users: {\n links: {\n related: {\n href: '/articles/1/authors'\n },\n },\n meta: {\n lastUpdated: 1458014400000\n }\n }\n }\n }\n });\n\nlet usersRef = blog.hasMany('user');\n\nusersRef.meta() // { lastUpdated: 1458014400000 }\n```", + "itemtype": "method", + "name": "meta", + "access": "public", + "tagname": "", + "return": { + "description": "The meta information for the belongs-to relationship.", + "type": "Object" + }, + "class": "HasManyReference", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/references/has-many.ts", + "line": 356, + "itemtype": "method", + "description": "`push` can be used to update the data in the relationship and Ember\nData will treat the new data as the canonical value of this\nrelationship on the backend.\n\nExample\n\n```app/models/post.js\nimport Model, { hasMany } from '@ember-data/model';\n\nexport default class PostModel extends Model {\n @hasmany('comment', { async: true, inverse: null }) comments;\n}\n```\n\n```\nlet post = store.push({\n data: {\n type: 'post',\n id: 1,\n relationships: {\n comments: {\n data: [{ type: 'comment', id: 1 }]\n }\n }\n }\n});\n\nlet commentsRef = post.hasMany('comments');\n\ncommentsRef.ids(); // ['1']\n\ncommentsRef.push([\n[{ type: 'comment', id: 2 }],\n[{ type: 'comment', id: 3 }],\n])\n\ncommentsRef.ids(); // ['2', '3']\n```\n", + "name": "push", + "access": "public", + "tagname": "", + "params": [ + { + "name": "objectOrPromise", + "description": "a promise that resolves to a JSONAPI document object describing the new value of this relationship.", + "type": "Array|Promise" + } + ], + "return": { + "description": "", + "type": "ManyArray" + }, + "class": "HasManyReference", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/references/has-many.ts", + "line": 460, + "itemtype": "method", + "description": "`value()` synchronously returns the current value of the has-many\nrelationship. Unlike `record.relationshipName`, calling\n`value()` on a reference does not trigger a fetch if the async\nrelationship is not yet loaded. If the relationship is not loaded\nit will always return `null`.\n\nExample\n\n```app/models/post.js\nimport Model, { hasMany } from '@ember-data/model';\n\nexport default class PostModel extends Model {\n @hasmany('comment', { async: true, inverse: null }) comments;\n}\n```\n\n```javascript\nlet post = store.push({\n data: {\n type: 'post',\n id: 1,\n relationships: {\n comments: {\n data: [{ type: 'comment', id: 1 }]\n }\n }\n }\n});\n\nlet commentsRef = post.hasMany('comments');\n\npost.comments.then(function(comments) {\n commentsRef.value() === comments\n})\n```\n", + "name": "value", + "access": "public", + "tagname": "", + "return": { + "description": "", + "type": "ManyArray" + }, + "class": "HasManyReference", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/references/has-many.ts", + "line": 518, + "itemtype": "method", + "description": "Loads the relationship if it is not already loaded. If the\nrelationship is already loaded this method does not trigger a new\nload. This causes a request to the specified\nrelationship link or reloads all items currently in the relationship.\n\nExample\n\n```app/models/post.js\nimport Model, { hasMany } from '@ember-data/model';\n\nexport default class PostModel extends Model {\n @hasmany('comment', { async: true, inverse: null }) comments;\n}\n```\n\n```javascript\nlet post = store.push({\n data: {\n type: 'post',\n id: 1,\n relationships: {\n comments: {\n data: [{ type: 'comment', id: 1 }]\n }\n }\n }\n});\n\nlet commentsRef = post.hasMany('comments');\n\ncommentsRef.load().then(function(comments) {\n //...\n});\n```\n\nYou may also pass in an options object whose properties will be\nfed forward. This enables you to pass `adapterOptions` into the\nrequest given to the adapter via the reference.\n\nExample\n\n```javascript\ncommentsRef.load({ adapterOptions: { isPrivate: true } })\n .then(function(comments) {\n //...\n });\n```\n\n```app/adapters/comment.js\nexport default ApplicationAdapter.extend({\n findMany(store, type, id, snapshots) {\n // In the adapter you will have access to adapterOptions.\n let adapterOptions = snapshots[0].adapterOptions;\n }\n});\n```\n", + "name": "load", + "access": "public", + "tagname": "", + "params": [ + { + "name": "options", + "description": "the options to pass in.", + "type": "Object" + } + ], + "return": { + "description": "a promise that resolves with the ManyArray in\nthis has-many relationship.", + "type": "Promise" + }, + "class": "HasManyReference", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/references/has-many.ts", + "line": 593, + "itemtype": "method", + "description": "Reloads this has-many relationship. This causes a request to the specified\nrelationship link or reloads all items currently in the relationship.\n\nExample\n\n```app/models/post.js\nimport Model, { hasMany } from '@ember-data/model';\n\nexport default class PostModel extends Model {\n @hasmany('comment', { async: true, inverse: null }) comments;\n}\n```\n\n```javascript\nlet post = store.push({\n data: {\n type: 'post',\n id: 1,\n relationships: {\n comments: {\n data: [{ type: 'comment', id: 1 }]\n }\n }\n }\n});\n\nlet commentsRef = post.hasMany('comments');\n\ncommentsRef.reload().then(function(comments) {\n //...\n});\n```\n\nYou may also pass in an options object whose properties will be\nfed forward. This enables you to pass `adapterOptions` into the\nrequest given to the adapter via the reference. A full example\ncan be found in the `load` method.\n\nExample\n\n```javascript\ncommentsRef.reload({ adapterOptions: { isPrivate: true } })\n```\n", + "name": "reload", + "access": "public", + "tagname": "", + "params": [ + { + "name": "options", + "description": "the options to pass in.", + "type": "Object" + } + ], + "return": { + "description": "a promise that resolves with the ManyArray in this has-many relationship.", + "type": "Promise" + }, + "class": "HasManyReference", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/attr.js", + "line": 14, + "itemtype": "method", + "description": "`attr` defines an attribute on a [Model](/ember-data/release/classes/Model).\nBy default, attributes are passed through as-is, however you can specify an\noptional type to have the value automatically transformed.\nEmber Data ships with four basic transform types: `string`, `number`,\n`boolean` and `date`. You can define your own transforms by subclassing\n[Transform](/ember-data/release/classes/Transform).\n\nNote that you cannot use `attr` to define an attribute of `id`.\n\n`attr` takes an optional hash as a second parameter, currently\nsupported options are:\n\n- `defaultValue`: Pass a string or a function to be called to set the attribute\nto a default value if and only if the key is absent from the payload response.\n\nExample\n\n```app/models/user.js\nimport Model, { attr } from '@ember-data/model';\n\nexport default class UserModel extends Model {\n @attr('text', {\n uppercase: true\n })\n text;\n}\n```\n\n```app/transforms/text.js\nexport default class TextTransform {\n serialize(value, options) {\n if (options.uppercase) {\n return value.toUpperCase();\n }\n\n return value;\n }\n\n deserialize(value) {\n return value;\n }\n\n static create() {\n return new this();\n }\n}\n```\n", + "name": "attr", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "type", + "description": "the attribute type", + "type": "String|Object" + }, + { + "name": "options", + "description": "a hash of options", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Attribute" + }, + "class": "@ember-data/model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/belongs-to.js", + "line": 13, + "itemtype": "method", + "description": "`belongsTo` is used to define One-To-One and One-To-Many\nrelationships on a [Model](/ember-data/release/classes/Model).\n\n\n`belongsTo` takes an optional hash as a second parameter, currently\nsupported options are:\n\n- `async`: A boolean value used to explicitly declare this to be an async relationship. The default is true.\n- `inverse`: A string used to identify the inverse property on a\n related model in a One-To-Many relationship. See [Explicit Inverses](#explicit-inverses)\n- `polymorphic` A boolean value to mark the relationship as polymorphic\n\n#### One-To-One\nTo declare a one-to-one relationship between two models, use\n`belongsTo`:\n\n```app/models/user.js\nimport Model, { belongsTo } from '@ember-data/model';\n\nexport default class UserModel extends Model {\n @belongsto('post', {\n async: false,\n inverse: null\n })\n post;\n}\n```\n\nIn contrast to async relationship, accessing a sync relationship\nwill always return the record (Model instance) for the existing\nlocal resource, or null. But it will error on access when\na related resource is known to exist and it has not been loaded.\n\n```\nlet post = comment.post;\n\n```\n @hasmany('comment', { async: false, inverse: 'post' }) comments;\n}\n```\n\n```app/models/comment.js\nimport Model, { belongsTo } from '@ember-data/model';\n\nexport default class CommentModel extends Model {\n", + "name": "belongsTo", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "modelName", + "description": "(optional) type of the relationship", + "type": "String" + }, + { + "name": "options", + "description": "(optional) a hash of options", + "type": "Object" + } + ], + "return": { + "description": "relationship", + "type": "Ember.computed" + }, + "class": "@ember-data/model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/errors.ts", + "line": 106, + "itemtype": "property", + "name": "errorsByAttributeName", + "type": "{MapWithDefault}", + "access": "private", + "tagname": "", + "class": "Errors", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/errors.ts", + "line": 116, + "description": "Returns errors for a given attribute\n\n```javascript\nlet user = store.createRecord('user', {\n username: 'tomster',\n email: 'invalidEmail'\n});\nuser.save().catch(function(){\n user.errors.errorsFor('email'); // returns:\n // [{attribute: \"email\", message: \"Doesn't look like a valid email.\"}]\n});\n```", + "itemtype": "method", + "name": "errorsFor", + "access": "public", + "tagname": "", + "params": [ + { + "name": "attribute", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Array" + }, + "class": "Errors", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/errors.ts", + "line": 154, + "description": "An array containing all of the error messages for this\nrecord. This is useful for displaying all errors to the user.\n\n```handlebars\n{{#each @model.errors.messages as |message|}}\n
\n {{message}}\n
\n{{/each}}\n```", + "itemtype": "property", + "name": "messages", + "access": "public", + "tagname": "", + "type": "{Array}", + "class": "Errors", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/errors.ts", + "line": 173, + "itemtype": "property", + "name": "content", + "type": "{Array}", + "access": "private", + "tagname": "", + "class": "Errors", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/errors.ts", + "line": 183, + "itemtype": "method", + "name": "unknownProperty", + "access": "private", + "tagname": "", + "class": "Errors", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/errors.ts", + "line": 195, + "description": "Total number of errors.", + "itemtype": "property", + "name": "length", + "type": "{Number}", + "access": "public", + "tagname": "", + "readonly": "", + "class": "Errors", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/errors.ts", + "line": 204, + "description": "`true` if we have no errors.", + "itemtype": "property", + "name": "isEmpty", + "type": "{Boolean}", + "access": "public", + "tagname": "", + "readonly": "", + "class": "Errors", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/errors.ts", + "line": 215, + "description": "Manually adds errors to the record. This will trigger the `becameInvalid` event/ lifecycle method on\n the record and transition the record into an `invalid` state.\n\nExample\n```javascript\n let errors = user.errors;\n\n // add multiple errors\n errors.add('password', [\n 'Must be at least 12 characters',\n 'Must contain at least one symbol',\n 'Cannot contain your name'\n ]);\n\n errors.errorsFor('password');\n // =>\n // [\n // { attribute: 'password', message: 'Must be at least 12 characters' },\n // { attribute: 'password', message: 'Must contain at least one symbol' },\n // { attribute: 'password', message: 'Cannot contain your name' },\n // ]\n\n // add a single error\n errors.add('username', 'This field is required');\n\n errors.errorsFor('username');\n // =>\n // [\n // { attribute: 'username', message: 'This field is required' },\n // ]\n```", + "itemtype": "method", + "name": "add", + "access": "public", + "tagname": "", + "params": [ + { + "name": "attribute", + "description": "- the property name of an attribute or relationship", + "type": "String" + }, + { + "name": "messages", + "description": "- an error message or array of error messages for the attribute", + "type": "String[]|string" + } + ], + "class": "Errors", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/errors.ts", + "line": 262, + "itemtype": "method", + "name": "_findOrCreateMessages", + "access": "private", + "tagname": "", + "class": "Errors", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/errors.ts", + "line": 287, + "description": "Manually removes all errors for a given member from the record.\n This will transition the record into a `valid` state, and\n triggers the `becameValid` event and lifecycle method.\n\nExample:\n\n```javascript\n let errors = user.errors;\n errors.add('phone', ['error-1', 'error-2']);\n\n errors.errorsFor('phone');\n // =>\n // [\n // { attribute: 'phone', message: 'error-1' },\n // { attribute: 'phone', message: 'error-2' },\n // ]\n\n errors.remove('phone');\n\n errors.errorsFor('phone');\n // => undefined\n```", + "itemtype": "method", + "name": "remove", + "access": "public", + "tagname": "", + "params": [ + { + "name": "member", + "description": "- the property name of an attribute or relationship", + "type": "String" + } + ], + "class": "Errors", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/errors.ts", + "line": 338, + "description": "Manually clears all errors for the record.\n This will transition the record into a `valid` state, and\n will trigger the `becameValid` event and lifecycle method.\n\n Example:\n\n```javascript\nlet errors = user.errors;\nerrors.add('username', ['error-a']);\nerrors.add('phone', ['error-1', 'error-2']);\n\nerrors.errorsFor('username');\n// =>\n// [\n// { attribute: 'username', message: 'error-a' },\n// ]\n\nerrors.errorsFor('phone');\n// =>\n// [\n// { attribute: 'phone', message: 'error-1' },\n// { attribute: 'phone', message: 'error-2' },\n// ]\n\nerrors.clear();\n\nerrors.errorsFor('username');\n// => undefined\n\nerrors.errorsFor('phone');\n// => undefined\n\nerrors.messages\n// => []\n```", + "itemtype": "method", + "name": "clear", + "access": "public", + "tagname": "", + "class": "Errors", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/errors.ts", + "line": 398, + "itemtype": "method", + "description": "Checks if there are error messages for the given attribute.\n\n```app/controllers/user/edit.js\nimport Controller from '@ember/controller';\nimport { action } from '@ember/object';\n\nexport default class UserEditController extends Controller {\n @action save(user) {\n if (user.errors.has('email')) {\n return alert('Please update your email before attempting to save.');\n }\n user.save();\n }\n}\n```\n", + "name": "has", + "access": "public", + "tagname": "", + "params": [ + { + "name": "attribute", + "description": "", + "type": "String" + } + ], + "return": { + "description": "true if there some errors on given attribute", + "type": "Boolean" + }, + "class": "Errors", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/has-many.js", + "line": 41, + "itemtype": "method", + "description": "`hasMany` is used to define One-To-Many and Many-To-Many\nrelationships on a [Model](/ember-data/release/classes/Model).\n\n`hasMany` takes an optional hash as a second parameter, currently\nsupported options are:\n\n- `async`: A boolean value used to explicitly declare this to be an async relationship. The default is true.\n- `inverse`: A string used to identify the inverse property on a related model.\n- `polymorphic` A boolean value to mark the relationship as polymorphic\n\n#### One-To-Many\nTo declare a one-to-many relationship between two models, use\n`belongsTo` in combination with `hasMany`, like this:\n\n```app/models/post.js\nimport Model, { hasMany } from '@ember-data/model';\n\nexport default class PostModel extends Model {\n @hasmany('comment', {\n async: false\n })\n comments;\n}\n```\n\nIn contrast to async relationship, accessing a sync relationship\nwill always return a [ManyArray](/ember-data/release/classes/ManyArray) instance\ncontaining the existing local resources. But it will error on access\nwhen any of the known related resources have not been loaded.\n\n```\npost.comments.forEach((comment) => {\n\n});\n\n```\n\nIf you are using `links` with sync relationships, you have to use\n`ref.reload` to fetch the resources.\n @belongsto('post') bluePost;\n}\n```\n\n```app/models/post.js\nimport Model, { hasMany } from '@ember-data/model';\n\nexport default class PostModel extends Model {\n", + "name": "hasMany", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "type", + "description": "(optional) type of the relationship", + "type": "String" + }, + { + "name": "options", + "description": "(optional) a hash of options", + "type": "Object" + } + ], + "return": { + "description": "relationship", + "type": "Ember.computed" + }, + "class": "@ember-data/model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/many-array.ts", + "line": 88, + "description": "The loading state of this array", + "itemtype": "property", + "name": "isLoaded", + "type": "Boolean", + "access": "public", + "tagname": "", + "class": "ManyArray", + "module": "@ember-data/store" + }, + { + "file": "../packages/model/src/-private/many-array.ts", + "line": 96, + "description": "`true` if the relationship is polymorphic, `false` otherwise.", + "itemtype": "property", + "name": "isPolymorphic", + "type": "Boolean", + "access": "private", + "tagname": "", + "class": "ManyArray", + "module": "@ember-data/store" + }, + { + "file": "../packages/model/src/-private/many-array.ts", + "line": 104, + "description": "Metadata associated with the request for async hasMany relationships.\n\nExample\n\nGiven that the server returns the following JSON payload when fetching a\nhasMany relationship:\n\n```js\n{\n \"comments\": [{\n \"id\": 1,\n \"comment\": \"This is the first comment\",\n }, {\n// ...\n }],\n\n \"meta\": {\n \"page\": 1,\n \"total\": 5\n }\n}\n```\n\nYou can then access the meta data via the `meta` property:\n\n```js\nlet comments = await post.comments;\nlet meta = comments.meta;\n\n// meta.page => 1\n// meta.total => 5\n```", + "itemtype": "property", + "name": "meta", + "type": "Object | null", + "access": "public", + "tagname": "", + "class": "ManyArray", + "module": "@ember-data/store" + }, + { + "file": "../packages/model/src/-private/many-array.ts", + "line": 142, + "description": "Retrieve the links for this relationship", + "itemtype": "property", + "name": "links", + "type": "Object | null", + "access": "public", + "tagname": "", + "class": "ManyArray", + "module": "@ember-data/store" + }, + { + "file": "../packages/model/src/-private/many-array.ts", + "line": 284, + "description": "Reloads all of the records in the manyArray. If the manyArray\nholds a relationship that was originally fetched using a links url\nEmber Data will revisit the original links url to repopulate the\nrelationship.\n\nIf the manyArray holds the result of a `store.query()` reload will\nre-run the original query.\n\nExample\n\n```javascript\nlet user = store.peekRecord('user', '1')\nawait login(user);\n\nlet permissions = await user.permissions;\nawait permissions.reload();\n```", + "itemtype": "method", + "name": "reload", + "access": "public", + "tagname": "", + "class": "ManyArray", + "module": "@ember-data/store" + }, + { + "file": "../packages/model/src/-private/many-array.ts", + "line": 311, + "description": "Saves all of the records in the `ManyArray`.\n\nExample\n\n```javascript\nlet inbox = await store.findRecord('inbox', '1');\nlet messages = await inbox.messages;\nmessages.forEach((message) => {\n message.isRead = true;\n});\nmessages.save();\n```", + "itemtype": "method", + "name": "save", + "access": "public", + "tagname": "", + "return": { + "description": "promise", + "type": "PromiseArray" + }, + "class": "ManyArray", + "module": "@ember-data/store" + }, + { + "file": "../packages/model/src/-private/many-array.ts", + "line": 330, + "description": "Create a child record within the owner", + "itemtype": "method", + "name": "createRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "hash", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "record", + "type": "Model" + }, + "class": "ManyArray", + "module": "@ember-data/store" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 170, + "description": "If this property is `true` the record is in the `empty`\nstate. Empty is the first state all records enter after they have\nbeen created. Most records created by the store will quickly\ntransition to the `loading` state if data needs to be fetched from\nthe server or the `created` state if the record is created on the\nclient. A record can also enter the empty state if the adapter is\nunable to locate the record.", + "itemtype": "property", + "name": "isEmpty", + "access": "public", + "tagname": "", + "type": "{Boolean}", + "readonly": "", + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 189, + "description": "If this property is `true` the record is in the `loading` state. A\nrecord enters this state when the store asks the adapter for its\ndata. It remains in this state until the adapter provides the\nrequested data.", + "itemtype": "property", + "name": "isLoading", + "access": "public", + "tagname": "", + "type": "{Boolean}", + "readonly": "", + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 205, + "description": "If this property is `true` the record is in the `loaded` state. A\nrecord enters this state when its data is populated. Most of a\nrecord's lifecycle is spent inside substates of the `loaded`\nstate.\n\nExample\n\n```javascript\nlet record = store.createRecord('model');\nrecord.isLoaded; // true\n\nstore.findRecord('model', 1).then(function(model) {\n model.isLoaded; // true\n});\n```", + "itemtype": "property", + "name": "isLoaded", + "access": "public", + "tagname": "", + "type": "{Boolean}", + "readonly": "", + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 232, + "description": "If this property is `true` the record is in the `dirty` state. The\nrecord has local changes that have not yet been saved by the\nadapter. This includes records that have been created (but not yet\nsaved) or deleted.\n\nExample\n\n```javascript\nlet record = store.createRecord('model');\nrecord.hasDirtyAttributes; // true\n\nstore.findRecord('model', 1).then(function(model) {\n model.hasDirtyAttributes; // false\n model.set('foo', 'some value');\n model.hasDirtyAttributes; // true\n});\n```", + "since": "1.13.0", + "itemtype": "property", + "name": "hasDirtyAttributes", + "access": "public", + "tagname": "", + "type": "{Boolean}", + "readonly": "", + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 262, + "description": "If this property is `true` the record is in the `saving` state. A\nrecord enters the saving state when `save` is called, but the\nadapter has not yet acknowledged that the changes have been\npersisted to the backend.\n\nExample\n\n```javascript\nlet record = store.createRecord('model');\nrecord.isSaving; // false\nlet promise = record.save();\nrecord.isSaving; // true\npromise.then(function() {\n record.isSaving; // false\n});\n```", + "itemtype": "property", + "name": "isSaving", + "access": "public", + "tagname": "", + "type": "{Boolean}", + "readonly": "", + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 290, + "description": "If this property is `true` the record is in the `deleted` state\nand has been marked for deletion. When `isDeleted` is true and\n`hasDirtyAttributes` is true, the record is deleted locally but the deletion\nwas not yet persisted. When `isSaving` is true, the change is\nin-flight. When both `hasDirtyAttributes` and `isSaving` are false, the\nchange has persisted.\n\nExample\n\n```javascript\nlet record = store.createRecord('model');\nrecord.isDeleted; // false\nrecord.deleteRecord();\n\n// Locally deleted\nrecord.isDeleted; // true\nrecord.hasDirtyAttributes; // true\nrecord.isSaving; // false\n\n// Persisting the deletion\nlet promise = record.save();\nrecord.isDeleted; // true\nrecord.isSaving; // true\n\n// Deletion Persisted\npromise.then(function() {\n record.isDeleted; // true\n record.isSaving; // false\n record.hasDirtyAttributes; // false\n});\n```", + "itemtype": "property", + "name": "isDeleted", + "access": "public", + "tagname": "", + "type": "{Boolean}", + "readonly": "", + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 333, + "description": "If this property is `true` the record is in the `new` state. A\nrecord will be in the `new` state when it has been created on the\nclient and the adapter has not yet report that it was successfully\nsaved.\n\nExample\n\n```javascript\nlet record = store.createRecord('model');\nrecord.isNew; // true\n\nrecord.save().then(function(model) {\n model.isNew; // false\n});\n```", + "itemtype": "property", + "name": "isNew", + "access": "public", + "tagname": "", + "type": "{Boolean}", + "readonly": "", + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 360, + "description": "If this property is `true` the record is in the `valid` state.\n\nA record will be in the `valid` state when the adapter did not report any\nserver-side validation failures.", + "itemtype": "property", + "name": "isValid", + "access": "public", + "tagname": "", + "type": "{Boolean}", + "readonly": "", + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 376, + "description": "If the record is in the dirty state this property will report what\nkind of change has caused it to move into the dirty\nstate. Possible values are:\n\n- `created` The record has been created by the client and not yet saved to the adapter.\n- `updated` The record has been updated by the client and not yet saved to the adapter.\n- `deleted` The record has been deleted by the client and not yet saved to the adapter.\n\nExample\n\n```javascript\nlet record = store.createRecord('model');\nrecord.dirtyType; // 'created'\n```", + "itemtype": "property", + "name": "dirtyType", + "access": "public", + "tagname": "", + "type": "{String}", + "readonly": "", + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 402, + "description": "If `true` the adapter reported that it was unable to save local\nchanges to the backend for any reason other than a server-side\nvalidation error.\n\nExample\n\n```javascript\nrecord.isError; // false\nrecord.set('foo', 'valid value');\nrecord.save().then(null, function() {\n record.isError; // true\n});\n```", + "itemtype": "property", + "name": "isError", + "access": "public", + "tagname": "", + "type": "{Boolean}", + "readonly": "", + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 432, + "description": "If `true` the store is attempting to reload the record from the adapter.\n\nExample\n\n```javascript\nrecord.isReloading; // false\nrecord.reload();\nrecord.isReloading; // true\n```", + "itemtype": "property", + "name": "isReloading", + "access": "public", + "tagname": "", + "type": "{Boolean}", + "readonly": "", + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 450, + "description": "All ember models have an id property. This is an identifier\nmanaged by an external source. These are always coerced to be\nstrings before being used internally. Note when declaring the\nattributes for a model it is an error to declare an id\nattribute.\n\n```javascript\nlet record = store.createRecord('model');\nrecord.id; // null\n\nstore.findRecord('model', 1).then(function(model) {\n model.id; // '1'\n});\n```", + "itemtype": "property", + "name": "id", + "access": "public", + "tagname": "", + "type": "{String}", + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 503, + "itemtype": "property", + "name": "currentState", + "access": "private", + "tagname": "", + "type": "{Object}", + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 527, + "description": "The store service instance which created this record instance", + "itemtype": "property", + "name": "store", + "access": "public", + "tagname": "", + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 534, + "description": "When the record is in the `invalid` state this object will contain\nany errors returned by the adapter. When present the errors hash\ncontains keys corresponding to the invalid property names\nand values which are arrays of Javascript objects with two keys:\n\n- `message` A string containing the error message from the backend\n- `attribute` The name of the property associated with this error message\n\n```javascript\nrecord.errors.length; // 0\nrecord.set('foo', 'invalid value');\nrecord.save().catch(function() {\n record.errors.foo;\n // [{message: 'foo should be a number.', attribute: 'foo'}]\n});\n```\n\nThe `errors` property is useful for displaying error messages to\nthe user.\n\n```handlebars\n\n{{#each @model.errors.username as |error|}}\n
\n {{error.message}}\n
\n{{/each}}\n\n{{#each @model.errors.email as |error|}}\n
\n {{error.message}}\n
\n{{/each}}\n```\n\n\nYou can also access the special `messages` property on the error\nobject to get an array of all the error strings.\n\n```handlebars\n{{#each @model.errors.messages as |message|}}\n
\n {{message}}\n
\n{{/each}}\n```", + "itemtype": "property", + "name": "errors", + "access": "public", + "tagname": "", + "type": "{Errors}", + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 593, + "description": "This property holds the `AdapterError` object with which\nlast adapter operation was rejected.", + "itemtype": "property", + "name": "adapterError", + "access": "public", + "tagname": "", + "type": "{AdapterError}", + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 609, + "description": "Create a JSON representation of the record, using the serialization\nstrategy of the store's adapter.\n\n `serialize` takes an optional hash as a parameter, currently\nsupported options are:\n\n - `includeId`: `true` if the record's ID should be included in the\n JSON representation.", + "itemtype": "method", + "name": "serialize", + "access": "public", + "tagname": "", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "an object whose values are primitive JSON values only", + "type": "Object" + }, + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 644, + "itemtype": "method", + "description": "Marks the record as deleted but does not save it. You must call\n`save` afterwards if you want to persist it. You might use this\nmethod if you want to allow the user to still `rollbackAttributes()`\nafter a delete was made.\n\nExample\n\n```app/controllers/model/delete.js\nimport Controller from '@ember/controller';\nimport { action } from '@ember/object';\n\nexport default class ModelDeleteController extends Controller {\n @action undo() {\n this.model.rollbackAttributes();\n }\n}\n```\n", + "name": "deleteRecord", + "access": "public", + "tagname": "", + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 684, + "itemtype": "method", + "description": "Same as `deleteRecord`, but saves the record immediately.\n\nExample\n\n```app/controllers/model/delete.js\nimport Controller from '@ember/controller';\nimport { action } from '@ember/object';\n\nexport default class ModelDeleteController extends Controller {\n @action delete() {\n this.model.destroyRecord().then(function() {\n this.transitionToRoute('model.index');\n });\n }\n}\n```\n\nIf you pass an object on the `adapterOptions` property of the options\nargument it will be passed to your adapter via the snapshot\n\n```js\nrecord.destroyRecord({ adapterOptions: { subscribe: false } });\n```\n\n```app/adapters/post.js\nimport MyCustomAdapter from './custom-adapter';\n\nexport default class PostAdapter extends MyCustomAdapter {\n deleteRecord(store, type, snapshot) {\n if (snapshot.adapterOptions.subscribe) {\n // ...\n }\n // ...\n }\n}\n```\n", + "name": "destroyRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "a promise that will be resolved when the adapter returns\nsuccessfully or rejected if the adapter returns with an error.", + "type": "Promise" + }, + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 741, + "description": "Unloads the record from the store. This will not send a delete request\nto your server, it just unloads the record from memory.", + "itemtype": "method", + "name": "unloadRecord", + "access": "public", + "tagname": "", + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 755, + "itemtype": "method", + "name": "_notifyProperties", + "access": "private", + "tagname": "", + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 772, + "itemtype": "method", + "description": "Returns an object, whose keys are changed properties, and value is\nan [oldProp, newProp] array.\n\nThe array represents the diff of the canonical state with the local state\nof the model. Note: if the model is created locally, the canonical state is\nempty since the adapter hasn't acknowledged the attributes yet:\n\nExample\n\n```app/models/mascot.js\nimport Model, { attr } from '@ember-data/model';\n\nexport default class MascotModel extends Model {\n @attr('boolean', {\n defaultValue: false\n })\n isAdmin;\n}\n```\n\n```javascript\nlet mascot = store.createRecord('mascot');\n\nmascot.changedAttributes(); // {}\n\nmascot.set('name', 'Tomster');\nmascot.changedAttributes(); // { name: [undefined, 'Tomster'] }\n\nmascot.set('isAdmin', true);\nmascot.changedAttributes(); // { isAdmin: [undefined, true], name: [undefined, 'Tomster'] }\n\nmascot.save().then(function() {\n mascot.changedAttributes(); // {}\n\n mascot.set('isAdmin', false);\n mascot.changedAttributes(); // { isAdmin: [true, false] }\n});\n```\n", + "name": "changedAttributes", + "access": "public", + "tagname": "", + "return": { + "description": "an object, whose keys are changed properties,\n and value is an [oldProp, newProp] array.", + "type": "Object" + }, + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 822, + "description": "If the model `hasDirtyAttributes` this function will discard any unsaved\nchanges. If the model `isNew` it will be removed from the store.\n\nExample\n\n```javascript\nrecord.name; // 'Untitled Document'\nrecord.set('name', 'Doc 1');\nrecord.name; // 'Doc 1'\nrecord.rollbackAttributes();\nrecord.name; // 'Untitled Document'\n```", + "since": "1.13.0", + "itemtype": "method", + "name": "rollbackAttributes", + "access": "public", + "tagname": "", + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 854, + "itemtype": "method", + "name": "_createSnapshot", + "access": "private", + "tagname": "", + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 870, + "description": "Save the record and persist any changes to the record to an\nexternal source via the adapter.\n\nExample\n\n```javascript\nrecord.set('name', 'Tomster');\nrecord.save().then(function() {\n // Success callback\n}, function() {\n // Error callback\n});\n```\n\n If you pass an object using the `adapterOptions` property of the options\n argument it will be passed to your adapter via the snapshot.\n\n```js\nrecord.save({ adapterOptions: { subscribe: false } });\n```\n\n```app/adapters/post.js\nimport MyCustomAdapter from './custom-adapter';\n\nexport default class PostAdapter extends MyCustomAdapter {\n updateRecord(store, type, snapshot) {\n if (snapshot.adapterOptions.subscribe) {\n // ...\n }\n // ...\n }\n}\n```", + "itemtype": "method", + "name": "save", + "access": "public", + "tagname": "", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "a promise that will be resolved when the adapter returns\nsuccessfully or rejected if the adapter returns with an error.", + "type": "Promise" + }, + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 924, + "itemtype": "method", + "description": "Reload the record from the adapter.\n\nThis will only work if the record has already finished loading.\n\nExample\n\n```app/controllers/model/view.js\nimport Controller from '@ember/controller';\nimport { action } from '@ember/object';\n\nexport default class ViewController extends Controller {\n @action reload() {\n this.model.reload().then(function(model) {\n // do something with the reloaded model\n });\n }\n}\n```\n", + "name": "reload", + "access": "public", + "tagname": "", + "params": [ + { + "name": "options", + "description": "optional, may include `adapterOptions` hash which will be passed to adapter request", + "type": "Object" + } + ], + "return": { + "description": "a promise that will be resolved with the record when the\nadapter returns successfully or rejected if the adapter returns\nwith an error.", + "type": "Promise" + }, + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 985, + "itemtype": "method", + "description": "Get the reference for the specified belongsTo relationship.\n\nExample\n\n```app/models/blog.js\nimport Model, { belongsTo } from '@ember-data/model';\n\nexport default class BlogModel extends Model {\n @belongsto('user', { async: true, inverse: null }) user;\n}\n```\n\n```javascript\nlet blog = store.push({\n data: {\n type: 'blog',\n id: 1,\n relationships: {\n user: {\n data: { type: 'user', id: 1 }\n }\n }\n }\n});\nlet userRef = blog.belongsTo('user');\n\n// check if the user relationship is loaded\nlet isLoaded = userRef.value() !== null;\n\n// get the record of the reference (null if not yet available)\nlet user = userRef.value();\n\n// get the identifier of the reference\nif (userRef.remoteType() === \"id\") {\n let id = userRef.id();\n} else if (userRef.remoteType() === \"link\") {\n let link = userRef.link();\n}\n\n// load user (via store.findRecord or store.findBelongsTo)\nuserRef.load().then(...)\n\n// or trigger a reload\nuserRef.reload().then(...)\n\n// provide data for reference\nuserRef.push({\n type: 'user',\n id: 1,\n attributes: {\n username: \"@user\"\n }\n}).then(function(user) {\n userRef.value() === user;\n});\n```\n", + "name": "belongsTo", + "access": "public", + "tagname": "", + "params": [ + { + "name": "name", + "description": "of the relationship", + "type": "String" + } + ], + "since": "2.5.0", + "return": { + "description": "reference for this relationship", + "type": "BelongsToReference" + }, + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 1053, + "itemtype": "method", + "description": "Get the reference for the specified hasMany relationship.\n\nExample\n\n```app/models/blog.js\nimport Model, { hasMany } from '@ember-data/model';\n\nexport default class BlogModel extends Model {\n @hasmany('comment', { async: true, inverse: null }) comments;\n}\n\nlet blog = store.push({\n data: {\n type: 'blog',\n id: 1,\n relationships: {\n comments: {\n data: [\n { type: 'comment', id: 1 },\n { type: 'comment', id: 2 }\n ]\n }\n }\n }\n});\nlet commentsRef = blog.hasMany('comments');\n\n// check if the comments are loaded already\nlet isLoaded = commentsRef.value() !== null;\n\n// get the records of the reference (null if not yet available)\nlet comments = commentsRef.value();\n\n// get the identifier of the reference\nif (commentsRef.remoteType() === \"ids\") {\n let ids = commentsRef.ids();\n} else if (commentsRef.remoteType() === \"link\") {\n let link = commentsRef.link();\n}\n\n// load comments (via store.findMany or store.findHasMany)\ncommentsRef.load().then(...)\n\n// or trigger a reload\ncommentsRef.reload().then(...)\n\n// provide data for reference\ncommentsRef.push([{ type: 'comment', id: 1 }, { type: 'comment', id: 2 }]).then(function(comments) {\n commentsRef.value() === comments;\n});\n```\n", + "name": "hasMany", + "access": "public", + "tagname": "", + "params": [ + { + "name": "name", + "description": "of the relationship", + "type": "String" + } + ], + "since": "2.5.0", + "return": { + "description": "reference for this relationship", + "type": "HasManyReference" + }, + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 1116, + "description": "Given a callback, iterates over each of the relationships in the model,\ninvoking the callback with the name of each relationship and its relationship\ndescriptor.\n\n\nThe callback method you provide should have the following signature (all\nparameters are optional):\n\n```javascript\nfunction(name, descriptor);\n```\n\n- `name` the name of the current property in the iteration\n- `descriptor` the meta object that describes this relationship\n\nThe relationship descriptor argument is an object with the following properties.\n\n- **key** String the name of this relationship on the Model\n- **kind** String \"hasMany\" or \"belongsTo\"\n- **options** Object the original options hash passed when the relationship was declared\n- **parentType** Model the type of the Model that owns this relationship\n- **type** String the type name of the related Model\n\nNote that in addition to a callback, you can also pass an optional target\nobject that will be set as `this` on the context.\n\nExample\n\n```app/serializers/application.js\nimport JSONSerializer from '@ember-data/serializer/json';\n\nexport default class ApplicationSerializer extends JSONSerializer {\n serialize(record, options) {\n let json = {};\n\n record.eachRelationship(function(name, descriptor) {\n if (descriptor.kind === 'hasMany') {\n let serializedHasManyName = name.toUpperCase() + '_IDS';\n json[serializedHasManyName] = record.get(name).map(r => r.id);\n }\n });\n\n return json;\n }\n }\n```", + "itemtype": "method", + "name": "eachRelationship", + "access": "public", + "tagname": "", + "params": [ + { + "name": "callback", + "description": "the callback to invoke", + "type": "Function" + }, + { + "name": "binding", + "description": "the value to which the callback's `this` should be bound", + "type": "Any" + } + ], + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 1187, + "description": "Create should only ever be called by the store. To create an instance of a\n`Model` in a dirty state use `store.createRecord`.\n\n To create instances of `Model` in a clean state, use `store.push`", + "itemtype": "method", + "name": "create", + "access": "private", + "tagname": "", + "static": 1, + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 1198, + "description": "Represents the model's class name as a string. This can be used to look up the model's class name through\n`Store`'s modelFor method.\n\n`modelName` is generated for you by Ember Data. It will be a lowercased, dasherized string.\nFor example:\n\n```javascript\nstore.modelFor('post').modelName; // 'post'\nstore.modelFor('blog-post').modelName; // 'blog-post'\n```\n\nThe most common place you'll want to access `modelName` is in your serializer's `payloadKeyFromModelName` method. For example, to change payload\nkeys to underscore (instead of dasherized), you might use the following code:\n\n```javascript\nimport RESTSerializer from '@ember-data/serializer/rest';\nimport { underscore } from '/utils/string-utils';\n\nexport default const PostSerializer = RESTSerializer.extend({\n payloadKeyFromModelName(modelName) {\n return underscore(modelName);\n }\n});\n```", + "itemtype": "property", + "name": "modelName", + "access": "public", + "tagname": "", + "type": "String", + "readonly": "", + "static": 1, + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 1248, + "itemtype": "method", + "description": "For a given relationship name, returns the model type of the relationship.\n\nFor example, if you define a model like this:\n\n```app/models/post.js\nimport Model, { hasMany } from '@ember-data/model';\n\nexport default class PostModel extends Model {\n @hasmany('comment') comments;\n}\n```\n\nCalling `store.modelFor('post').typeForRelationship('comments', store)` will return `Comment`.\n", + "name": "typeForRelationship", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "name", + "description": "the name of the relationship", + "type": "String" + }, + { + "name": "store", + "description": "an instance of Store", + "type": "Store" + } + ], + "return": { + "description": "the type of the relationship, or undefined", + "type": "Model" + }, + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 1289, + "itemtype": "method", + "description": "Find the relationship which is the inverse of the one asked for.\n\nFor example, if you define models like this:\n\n```app/models/post.js\nimport Model, { hasMany } from '@ember-data/model';\n\nexport default class PostModel extends Model {\n @hasmany('message') comments;\n }\n```\n\n```app/models/message.js\nimport Model, { belongsTo } from '@ember-data/model';\n\nexport default class MessageModel extends Model {\n @belongsto('post') owner;\n }\n```\n\n``` js\nstore.modelFor('post').inverseFor('comments', store) // { type: App.Message, name: 'owner', kind: 'belongsTo' }\nstore.modelFor('message').inverseFor('owner', store) // { type: App.Post, name: 'comments', kind: 'hasMany' }\n```\n", + "name": "inverseFor", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "name", + "description": "the name of the relationship", + "type": "String" + }, + { + "name": "store", + "description": "", + "type": "Store" + } + ], + "return": { + "description": "the inverse relationship, or null", + "type": "Object" + }, + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 1478, + "itemtype": "property", + "description": "The model's relationships as a map, keyed on the type of the\nrelationship. The value of each entry is an array containing a descriptor\nfor each relationship with that type, describing the name of the relationship\nas well as the type.\n\nFor example, given the following model definition:\n\n```app/models/blog.js\nimport Model, { belongsTo, hasMany } from '@ember-data/model';\n\nexport default class BlogModel extends Model {\n @hasmany('post') posts;\n }\n```\n\nThis computed property would return a map describing these\nrelationships, like this:\n\n```javascript\nimport { get } from '@ember/object';\nimport Blog from 'app/models/blog';\nimport User from 'app/models/user';\nimport Post from 'app/models/post';\n\nlet relationships = Blog.relationships;\nrelationships.user;\n//=> [ { name: 'users', kind: 'hasMany' },\n// { name: 'owner', kind: 'belongsTo' } ]\nrelationships.post;\n//=> [ { name: 'posts', kind: 'hasMany' } ]\n```\n @belongsto('user') owner;\n", + "name": "relationships", + "access": "public", + "tagname": "", + "static": 1, + "type": "Map", + "readonly": "", + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 1544, + "itemtype": "property", + "description": "A hash containing lists of the model's relationships, grouped\nby the relationship kind. For example, given a model with this\ndefinition:\n\n```app/models/blog.js\nimport Model, { belongsTo, hasMany } from '@ember-data/model';\n\nexport default class BlogModel extends Model {\n @hasmany('post') posts;\n }\n```\n\nThis property would contain the following:\n\n```javascript\nimport { get } from '@ember/object';\nimport Blog from 'app/models/blog';\n\nlet relationshipNames = Blog.relationshipNames;\nrelationshipNames.hasMany;\n//=> ['users', 'posts']\nrelationshipNames.belongsTo;\n//=> ['owner']\n```\n @belongsto('user') owner;\n", + "name": "relationshipNames", + "access": "public", + "tagname": "", + "static": 1, + "type": "Object", + "readonly": "", + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 1599, + "itemtype": "property", + "description": "An array of types directly related to a model. Each type will be\nincluded once, regardless of the number of relationships it has with\nthe model.\n\nFor example, given a model with this definition:\n\n```app/models/blog.js\nimport Model, { belongsTo, hasMany } from '@ember-data/model';\n\nexport default class BlogModel extends Model {\n @hasmany('post') posts;\n }\n```\n\nThis property would contain the following:\n\n```javascript\nimport { get } from '@ember/object';\nimport Blog from 'app/models/blog';\n\nlet relatedTypes = Blog.relatedTypes');\n//=> ['user', 'post']\n```\n @belongsto('user') owner;\n", + "name": "relatedTypes", + "access": "public", + "tagname": "", + "static": 1, + "type": "Ember.Array", + "readonly": "", + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 1660, + "itemtype": "property", + "description": "A map whose keys are the relationships of a model and whose values are\nrelationship descriptors.\n\nFor example, given a model with this\ndefinition:\n\n```app/models/blog.js\nimport Model, { belongsTo, hasMany } from '@ember-data/model';\n\nexport default class BlogModel extends Model {\n @hasmany('post') posts;\n }\n```\n\nThis property would contain the following:\n\n```javascript\nimport { get } from '@ember/object';\nimport Blog from 'app/models/blog';\n\nlet relationshipsByName = Blog.relationshipsByName;\nrelationshipsByName.users;\n//=> { key: 'users', kind: 'hasMany', type: 'user', options: Object, isRelationship: true }\nrelationshipsByName.owner;\n//=> { key: 'owner', kind: 'belongsTo', type: 'user', options: Object, isRelationship: true }\n```\n @belongsto('user') owner;\n", + "name": "relationshipsByName", + "access": "public", + "tagname": "", + "static": 1, + "type": "Map", + "readonly": "", + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 1742, + "itemtype": "property", + "description": "A map whose keys are the fields of the model and whose values are strings\ndescribing the kind of the field. A model's fields are the union of all of its\nattributes and relationships.\n\nFor example:\n\n```app/models/blog.js\nimport Model, { attr, belongsTo, hasMany } from '@ember-data/model';\n\nexport default class BlogModel extends Model {\n @hasmany('post') posts;\n @belongsto('user') owner;\n @attr('string') title;\n }\n```\n\n```js\nimport { get } from '@ember/object';\nimport Blog from 'app/models/blog'\n\nlet fields = Blog.fields;\nfields.forEach(function(kind, field) {\n // do thing\n });\n\n// prints:\n// users, hasMany\n// owner, belongsTo\n// posts, hasMany\n// title, attribute\n```\n", + "name": "fields", + "access": "public", + "tagname": "", + "static": 1, + "type": "Map", + "readonly": "", + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 1804, + "description": "Given a callback, iterates over each of the relationships in the model,\ninvoking the callback with the name of each relationship and its relationship\ndescriptor.", + "itemtype": "method", + "name": "eachRelationship", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "callback", + "description": "the callback to invoke", + "type": "Function" + }, + { + "name": "binding", + "description": "the value to which the callback's `this` should be bound", + "type": "Any" + } + ], + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 1826, + "description": "Given a callback, iterates over each of the types related to a model,\ninvoking the callback with the related type's class. Each type will be\nreturned just once, regardless of how many different relationships it has\nwith a model.", + "itemtype": "method", + "name": "eachRelatedType", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "callback", + "description": "the callback to invoke", + "type": "Function" + }, + { + "name": "binding", + "description": "the value to which the callback's `this` should be bound", + "type": "Any" + } + ], + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 1878, + "itemtype": "property", + "description": "A map whose keys are the attributes of the model (properties\ndescribed by attr) and whose values are the meta object for the\nproperty.\n\nExample\n\n```app/models/person.js\nimport Model, { attr } from '@ember-data/model';\n\nexport default class PersonModel extends Model {\n @attr('date') birthday;\n }\n```\n\n```javascript\nimport { get } from '@ember/object';\nimport Person from 'app/models/person'\n\nlet attributes = Person.attributes\n\nattributes.forEach(function(meta, name) {\n // do thing\n });\n\n// prints:\n// firstName {type: \"string\", isAttribute: true, options: Object, parentType: function, name: \"firstName\"}\n// lastName {type: \"string\", isAttribute: true, options: Object, parentType: function, name: \"lastName\"}\n// birthday {type: \"date\", isAttribute: true, options: Object, parentType: function, name: \"birthday\"}\n```\n", + "name": "attributes", + "access": "public", + "tagname": "", + "static": 1, + "type": "{Map}", + "readonly": "", + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 1942, + "itemtype": "property", + "description": "A map whose keys are the attributes of the model (properties\ndescribed by attr) and whose values are type of transformation\napplied to each attribute. This map does not include any\nattributes that do not have an transformation type.\n\nExample\n\n```app/models/person.js\nimport Model, { attr } from '@ember-data/model';\n\nexport default class PersonModel extends Model {\n @attr('date') birthday;\n }\n```\n\n```javascript\nimport { get } from '@ember/object';\nimport Person from 'app/models/person';\n\nlet transformedAttributes = Person.transformedAttributes\n\ntransformedAttributes.forEach(function(field, type) {\n // do thing\n });\n\n// prints:\n// lastName string\n// birthday date\n```\n", + "name": "transformedAttributes", + "access": "public", + "tagname": "", + "static": 1, + "type": "{Map}", + "readonly": "", + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 1999, + "itemtype": "method", + "description": "Iterates through the attributes of the model, calling the passed function on each\nattribute.\n\nThe callback method you provide should have the following signature (all\nparameters are optional):\n\n```javascript\nfunction(name, meta);\n```\n\n- `name` the name of the current property in the iteration\n- `meta` the meta object for the attribute property in the iteration\n\nNote that in addition to a callback, you can also pass an optional target\nobject that will be set as `this` on the context.\n\nExample\n\n```javascript\nimport Model, { attr } from '@ember-data/model';\n\nclass PersonModel extends Model {\n @attr('date') birthday;\n }\n\nPersonModel.eachAttribute(function(name, meta) {\n // do thing\n });\n\n// prints:\n// firstName {type: \"string\", isAttribute: true, options: Object, parentType: function, name: \"firstName\"}\n// lastName {type: \"string\", isAttribute: true, options: Object, parentType: function, name: \"lastName\"}\n// birthday {type: \"date\", isAttribute: true, options: Object, parentType: function, name: \"birthday\"}\n```\n", + "name": "eachAttribute", + "access": "public", + "tagname": "", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "binding", + "description": "the value to which the callback's `this` should be bound", + "type": "Object", + "optional": true + } + ], + "static": 1, + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 2054, + "description": "Iterates through the transformedAttributes of the model, calling\nthe passed function on each attribute. Note the callback will not be\ncalled for any attributes that do not have an transformation type.\n\nThe callback method you provide should have the following signature (all\nparameters are optional):\n\n```javascript\nfunction(name, type);\n```\n\n- `name` the name of the current property in the iteration\n- `type` a string containing the name of the type of transformed\napplied to the attribute\n\nNote that in addition to a callback, you can also pass an optional target\nobject that will be set as `this` on the context.\n\nExample\n\n```javascript\nimport Model, { attr } from '@ember-data/model';\n\nlet Person = Model.extend({\n firstName: attr(),\n lastName: attr('string'),\n birthday: attr('date')\n });\n\nPerson.eachTransformedAttribute(function(name, type) {\n // do thing\n });\n\n// prints:\n// lastName string\n// birthday date\n```", + "itemtype": "method", + "name": "eachTransformedAttribute", + "access": "public", + "tagname": "", + "params": [ + { + "name": "callback", + "description": "The callback to execute", + "type": "Function" + }, + { + "name": "binding", + "description": "the value to which the callback's `this` should be bound", + "type": "Object", + "optional": true + } + ], + "static": 1, + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 2110, + "description": "Returns the name of the model class.", + "itemtype": "method", + "name": "toString", + "access": "public", + "tagname": "", + "static": 1, + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/model.js", + "line": 2133, + "description": "Provides info about the model for debugging purposes\nby grouping the properties into more semantic groups.\n\nMeant to be used by debugging tools such as the Chrome Ember Extension.\n\n- Groups all attributes in \"Attributes\" group.\n- Groups all belongsTo relationships in \"Belongs To\" group.\n- Groups all hasMany relationships in \"Has Many\" group.\n- Groups all flags in \"Flags\" group.\n- Flags relationship CPs as expensive properties.", + "itemtype": "method", + "name": "_debugInfo", + "access": "private", + "tagname": "", + "class": "Model", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/promise-many-array.ts", + "line": 56, + "description": "Retrieve the length of the content", + "itemtype": "property", + "name": "length", + "access": "public", + "tagname": "", + "class": "PromiseManyArray", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/promise-many-array.ts", + "line": 82, + "description": "Iterate the proxied content. Called by the glimmer iterator in #each\nWe do not guarantee that forEach will always be available. This\nmay eventually be made to use Symbol.Iterator once glimmer supports it.", + "itemtype": "method", + "name": "forEach", + "params": [ + { + "name": "cb", + "description": "" + } + ], + "return": { + "description": "" + }, + "access": "private", + "tagname": "", + "class": "PromiseManyArray", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/promise-many-array.ts", + "line": 98, + "description": "Reload the relationship", + "itemtype": "method", + "name": "reload", + "access": "public", + "tagname": "", + "params": [ + { + "name": "options", + "description": "" + } + ], + "return": { + "description": "" + }, + "class": "PromiseManyArray", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/promise-many-array.ts", + "line": 113, + "description": "Whether the loading promise is still pending", + "itemtype": "property", + "name": "isPending", + "type": "Boolean", + "access": "public", + "tagname": "", + "class": "PromiseManyArray", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/promise-many-array.ts", + "line": 120, + "description": "Whether the loading promise rejected", + "itemtype": "property", + "name": "isRejected", + "type": "Boolean", + "access": "public", + "tagname": "", + "class": "PromiseManyArray", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/promise-many-array.ts", + "line": 127, + "description": "Whether the loading promise succeeded", + "itemtype": "property", + "name": "isFulfilled", + "type": "Boolean", + "access": "public", + "tagname": "", + "class": "PromiseManyArray", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/promise-many-array.ts", + "line": 134, + "description": "Whether the loading promise completed (resolved or rejected)", + "itemtype": "property", + "name": "isSettled", + "type": "Boolean", + "access": "public", + "tagname": "", + "class": "PromiseManyArray", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/promise-many-array.ts", + "line": 142, + "description": "chain this promise", + "itemtype": "method", + "name": "then", + "access": "public", + "tagname": "", + "params": [ + { + "name": "success", + "description": "" + }, + { + "name": "fail", + "description": "" + } + ], + "return": { + "description": "Promise" + }, + "class": "PromiseManyArray", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/promise-many-array.ts", + "line": 155, + "description": "catch errors thrown by this promise", + "itemtype": "method", + "name": "catch", + "access": "public", + "tagname": "", + "params": [ + { + "name": "callback", + "description": "" + } + ], + "return": { + "description": "Promise" + }, + "class": "PromiseManyArray", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/promise-many-array.ts", + "line": 166, + "description": "run cleanup after this promise completes", + "itemtype": "method", + "name": "finally", + "access": "public", + "tagname": "", + "params": [ + { + "name": "callback", + "description": "" + } + ], + "return": { + "description": "Promise" + }, + "class": "PromiseManyArray", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/promise-many-array.ts", + "line": 188, + "description": "Retrieve the links for this relationship", + "itemtype": "property", + "name": "links", + "access": "public", + "tagname": "", + "class": "PromiseManyArray", + "module": "@ember-data/model" + }, + { + "file": "../packages/model/src/-private/promise-many-array.ts", + "line": 198, + "description": "Retrieve the meta for this relationship", + "itemtype": "property", + "name": "meta", + "access": "public", + "tagname": "", + "class": "PromiseManyArray", + "module": "@ember-data/model" + }, + { + "file": "../packages/private-build-infra/virtual-packages/debugging.js", + "line": 31, + "description": "log payloads received by the store\nvia `push` or returned from a delete/update/create\noperation.", + "itemtype": "property", + "name": "LOG_PAYLOADS", + "type": "Boolean", + "access": "public", + "tagname": "", + "class": "DebugLogging", + "module": "@ember-data/debug" + }, + { + "file": "../packages/private-build-infra/virtual-packages/debugging.js", + "line": 40, + "description": "log remote-state updates to the cache", + "itemtype": "property", + "name": "LOG_OPERATIONS", + "type": "Boolean", + "access": "public", + "tagname": "", + "class": "DebugLogging", + "module": "@ember-data/debug" + }, + { + "file": "../packages/private-build-infra/virtual-packages/debugging.js", + "line": 47, + "description": "log local-state updates to the cache", + "itemtype": "property", + "name": "LOG_MUTATIONS", + "type": "Boolean", + "access": "public", + "tagname": "", + "class": "DebugLogging", + "module": "@ember-data/debug" + }, + { + "file": "../packages/private-build-infra/virtual-packages/debugging.js", + "line": 54, + "description": "log notifications received by the NotificationManager", + "itemtype": "property", + "name": "LOG_NOTIFICATIONS", + "type": "Boolean", + "access": "public", + "tagname": "", + "class": "DebugLogging", + "module": "@ember-data/debug" + }, + { + "file": "../packages/private-build-infra/virtual-packages/debugging.js", + "line": 61, + "description": "log requests issued by the RequestManager", + "itemtype": "property", + "name": "LOG_REQUESTS", + "type": "Boolean", + "access": "public", + "tagname": "", + "class": "DebugLogging", + "module": "@ember-data/debug" + }, + { + "file": "../packages/private-build-infra/virtual-packages/debugging.js", + "line": 68, + "description": "log updates to requests the store has issued to\nthe network (adapter) to fulfill.", + "itemtype": "property", + "name": "LOG_REQUEST_STATUS", + "type": "Boolean", + "access": "public", + "tagname": "", + "class": "DebugLogging", + "module": "@ember-data/debug" + }, + { + "file": "../packages/private-build-infra/virtual-packages/debugging.js", + "line": 76, + "description": "log peek, generation and updates to\nRecord Identifiers.", + "itemtype": "property", + "name": "LOG_IDENTIFIERS", + "type": "Boolean", + "access": "public", + "tagname": "", + "class": "DebugLogging", + "module": "@ember-data/debug" + }, + { + "file": "../packages/private-build-infra/virtual-packages/debugging.js", + "line": 84, + "description": "log updates received by the graph (relationship pointer storage)", + "itemtype": "property", + "name": "LOG_GRAPH", + "type": "Boolean", + "access": "public", + "tagname": "", + "class": "DebugLogging", + "module": "@ember-data/debug" + }, + { + "file": "../packages/private-build-infra/virtual-packages/debugging.js", + "line": 91, + "description": "log creation/removal of RecordData and Record\ninstances.", + "itemtype": "property", + "name": "LOG_INSTANCE_CACHE", + "type": "Boolean", + "access": "public", + "tagname": "", + "class": "DebugLogging", + "module": "@ember-data/debug" + }, + { + "file": "../packages/private-build-infra/virtual-packages/deprecations.js", + "line": 91, + "description": "**id: ember-data:deprecate-non-strict-types**\n\nCurrently, EmberData expects that the `type` property associated with\na resource follows several conventions.\n\n- The `type` property must be a non-empty string\n- The `type` property must be singular\n- The `type` property must be dasherized\n\nWe are deprecating support for types that do not match this pattern\nin order to unlock future improvements in which we can support `type`\nbeing any string of your choosing.\n\nThe goal is that in the future, you will be able to use any string\nso long as it matches what your configured cache, identifier generation,\nand schemas expect.\n\nE.G. It will matter not that your string is in a specific format like\nsingular, dasherized, etc. so long as everywhere you refer to the type\nyou use the same string.\n\nIf using @ember-data/model, there will always be a restriction that the\n`type` must match the path on disk where the model is defined.\n\ne.g. `app/models/foo/bar-bem.js` must have a type of `foo/bar-bem`", + "itemtype": "property", + "name": "DEPRECATE_NON_STRICT_TYPES", + "since": "5.3", + "until": "6.0", + "access": "public", + "tagname": "", + "class": "CurrentDeprecations", + "module": "@ember-data/deprecations" + }, + { + "file": "../packages/private-build-infra/virtual-packages/deprecations.js", + "line": 125, + "description": "**id: ember-data:deprecate-non-strict-id**\n\nCurrently, EmberData expects that the `id` property associated with\na resource is a string.\n\nHowever, for legacy support in many locations we would accept a number\nwhich would then immediately be coerced into a string.\n\nWe are deprecating this legacy support for numeric IDs.\n\nThe goal is that in the future, you will be able to use any ID format\nso long as everywhere you refer to the ID you use the same format.\n\nHowever, for identifiers we will always use string IDs and so any\ncustom identifier configuration should provide a string ID.", + "itemtype": "property", + "name": "DEPRECATE_NON_STRICT_ID", + "since": "5.3", + "until": "6.0", + "access": "public", + "tagname": "", + "class": "CurrentDeprecations", + "module": "@ember-data/deprecations" + }, + { + "file": "../packages/private-build-infra/virtual-packages/deprecations.js", + "line": 149, + "description": "**id: **\n\nThis is a planned deprecation which will trigger when observer or computed\nchains are used to watch for changes on any EmberData RecordArray, ManyArray\nor PromiseManyArray.\n\nSupport for these chains is currently guarded by the deprecation flag\nlisted here, enabling removal of the behavior if desired.", + "itemtype": "property", + "name": "DEPRECATE_COMPUTED_CHAINS", + "since": "5.0", + "until": "6.0", + "access": "public", + "tagname": "", + "class": "CurrentDeprecations", + "module": "@ember-data/deprecations" + }, + { + "file": "../packages/private-build-infra/virtual-packages/deprecations.js", + "line": 166, + "description": "**id: ember-data:deprecate-legacy-imports**\n\nDeprecates when importing from `ember-data/*` instead of `@ember-data/*`\nin order to prepare for the eventual removal of the legacy `ember-data/*`\n\nAll imports from `ember-data/*` should be updated to `@ember-data/*`\nexcept for `ember-data/store`. When you are using `ember-data` (as opposed to\ninstalling the indivudal packages) you should import from `ember-data/store`\ninstead of `@ember-data/store` in order to receive the appropriate configuration\nof defaults.", + "itemtype": "property", + "name": "DEPRECATE_LEGACY_IMPORTS", + "since": "5.3", + "until": "6.0", + "access": "public", + "tagname": "", + "class": "CurrentDeprecations", + "module": "@ember-data/deprecations" + }, + { + "file": "../packages/private-build-infra/virtual-packages/deprecations.js", + "line": 185, + "description": "**id: ember-data:deprecate-non-unique-collection-payloads**\n\nDeprecates when the data for a hasMany relationship contains\nduplicate identifiers.\n\nPreviously, relationships would silently de-dupe the data\nwhen received, but this behavior is being removed in favor\nof erroring if the same related record is included multiple\ntimes.\n\nFor instance, in JSON:API the below relationship data would\nbe considered invalid:\n\n```json\n{\n \"data\": {\n \"type\": \"article\",\n \"id\": \"1\",\n \"relationships\": {\n \"comments\": {\n \"data\": [\n { \"type\": \"comment\", \"id\": \"1\" },\n { \"type\": \"comment\", \"id\": \"2\" },\n { \"type\": \"comment\", \"id\": \"1\" } // duplicate\n ]\n }\n }\n}\n```\n\nTo resolve this deprecation, either update your server to\nnot include duplicate data, or implement normalization logic\nin either a request handler or serializer which removes\nduplicate data from relationship payloads.", + "itemtype": "property", + "name": "DEPRECATE_NON_UNIQUE_PAYLOADS", + "since": "5.3", + "until": "6.0", + "access": "public", + "tagname": "", + "class": "CurrentDeprecations", + "module": "@ember-data/deprecations" + }, + { + "file": "../packages/private-build-infra/virtual-packages/deprecations.js", + "line": 228, + "itemtype": "property", + "description": "**id: ember-data:deprecate-relationship-remote-update-clearing-local-state**\n\nDeprecates when a relationship is updated remotely and the local state\nis cleared of all changes except for \"new\" records.\n\nInstead, any records not present in the new payload will be considered\n\"removed\" while any records present in the new payload will be considered \"added\".\n\nThis allows us to \"commit\" local additions and removals, preserving any additions\nor removals that are not yet reflected in the remote state.\n\nFor instance, given the following initial state:\n\nremote: A, B, C\nlocal: add D, E\n remove B, C\n=> A, D, E\n\n\nIf after an update, the remote state is now A, B, D, F then the new state will be\n\nremote: A, B, D, F\nlocal: add E\n remove B\n=> A, D, E, F\n\nUnder the old behavior the updated local state would instead have been\n=> A, B, D, F\n\nSimilarly, if a belongsTo remote State was A while its local state was B,\nthen under the old behavior if the remote state changed to C, the local state\nwould be updated to C. Under the new behavior, the local state would remain B.\n\nIf the remote state was A while its local state was `null`, then under the old\nbehavior if the remote state changed to C, the local state would be updated to C.\nUnder the new behavior, the local state would remain `null`.\n\nThus the new correct mental model is that the state of the relationship at any point\nin time is whatever the most recent remote state is, plus any local additions or removals\nyou have made that have not yet been reflected by the remote state.\n\n> Note: The old behavior extended to modifying the inverse of a relationship. So if\n> you had local state not reflected in the new remote state, inverses would be notified\n> and their state reverted as well when \"resetting\" the relationship.\n> Under the new behavior, since the local state is preserved the inverses will also\n> not be reverted.\n\n### Resolving this deprecation\n\nResolving this deprecation can be done individually for each relationship\nor globally for all relationships.\n\nTo resolve it globally, set the `DEPRECATE_RELATIONSHIP_REMOTE_UPDATE_CLEARING_LOCAL_STATE`\nto `false` in ember-cli-build.js\n\n```js\nlet app = new EmberApp(defaults, {\n emberData: {\n deprecations: {\n // set to false to strip the deprecated code (thereby opting into the new behavior)\n DEPRECATE_RELATIONSHIP_REMOTE_UPDATE_CLEARING_LOCAL_STATE: false\n }\n }\n})\n```\n\nTo resolve this deprecation on an individual relationship, adjust the `options` passed to\nthe relationship. For relationships with inverses, both sides MUST be migrated to the new\nbehavior at the same time.\n\n```js\nclass Person extends Model {\n @hasmany('person', {\n async: false,\n inverse: null,\n resetOnRemoteUpdate: false\n }) children;\n @belongsto('person', {\n async: false,\n inverse: null,\n resetOnRemoteUpdate: false\n }) parent;\n}\n```\n\n> Note: false is the only valid value here, all other values (including missing)\n> will be treated as true, where `true` is the legacy behavior that is now deprecated.\n\nOnce you have migrated all relationships, you can remove the the resetOnRemoteUpdate\noption and set the deprecation flag to false in ember-cli-build.\n\n### What if I don't want the new behavior?\n\nEmberData's philosophy is to not make assumptions about your application. Where possible\nwe seek out \"100%\" solutions – solutions that work for all use cases - and where that is\nnot possible we default to \"90%\" solutions – solutions that work for the vast majority of use\ncases. In the case of \"90%\" solutions we look for primitives that allow you to resolve the\n10% case in your application. If no such primitives exist, we provide an escape hatch that\nensures you can build the behavior you need without adopting the cost of the default solution.\n\nIn this case, the old behavior was a \"40%\" solution. The inability for an application developer\nto determine what changes were made locally, and thus what changes should be preserved, made\nit impossible to build certain features easily, or in some cases at all. The proliferation of\nfeature requests, bug reports (from folks surprised by the prior behavior) and addon attempts\nin this space are all evidence of this.\n\nWe believe the new behavior is a \"90%\" solution. It works for the vast majority of use cases,\noften without noticeable changes to existing application behavior, and provides primitives that\nallow you to build the behavior you need for the remaining 10%.\n\nThe great news is that this behavior defaults to trusting your API similar to the old behavior.\nIf your API is correct, you will not need to make any changes to your application to adopt\nthe new behavior.\n\nThis means the 10% cases are those where you can't trust your API to provide the correct\ninformation. In these cases, because you now have cheap access to a diff of the relationship\nstate, there are a few options that weren't available before:\n\n- you can adjust returned API payloads to contain the expected changes that it doesn't include\n- you can modify local state by adding or removing records on the HasMany record array to remove\n any local changes that were not returned by the API.\n- you can use `.mutate(mutation)` to directly modify the local cache state of the relationship\n to match the expected state.\n\nWhat this version (5.3) does not yet provide is a way to directly modify the cache's remote state\nfor the relationship via public APIs other than via the broader action of upserting a response via\n`.put(document)`. However, such an API was sketched in the Cache 2.1 RFC\n`.patch(operation)` and is likely to be added in a future 5.x release of EmberData.\n\nThis version (5.3) also does not yet provide a way to directly modify the graph (a general purpose\nsubset of cache behaviors specific to relationships) via public APIs. However, during the\n5.x release series we will be working on finalizing the Graph API and making it public.\n\nIf none of these options work for you, you can always opt-out more broadly by implementing\na custom Cache with the relationship behaviors you need.\n", + "name": "DEPRECATE_RELATIONSHIP_REMOTE_UPDATE_CLEARING_LOCAL_STATE", + "since": "5.3", + "until": "6.0", + "access": "public", + "tagname": "", + "class": "CurrentDeprecations", + "module": "@ember-data/deprecations" + }, + { + "file": "../packages/request-utils/src/index.ts", + "line": 60, + "description": "Sets the global configuration for `buildBaseURL`\nfor host and namespace values for the application.\n\nThese values may still be overridden by passing\nthem to buildBaseURL directly.\n\nThis method may be called as many times as needed\n\n```ts\ntype BuildURLConfig = {\n host: string;\n namespace: string'\n}\n```", + "itemtype": "method", + "name": "setBuildURLConfig", + "static": 1, + "access": "public", + "tagname": "", + "params": [ + { + "name": "config", + "description": "", + "type": "BuildURLConfig" + } + ], + "return": { + "description": "void" + }, + "class": "@ember-data/request-utils", + "module": "@ember-data/request-utils" + }, + { + "file": "../packages/request-utils/src/index.ts", + "line": 185, + "description": "Builds a URL for a request based on the provided options.\nDoes not include support for building query params (see `buildQueryParams`)\nso that it may be composed cleanly with other query-params strategies.\n\nUsage:\n\n```ts\nimport { buildBaseURL } from '@ember-data/request-utils';\n\nconst url = buildBaseURL({\n host: 'https://api.example.com',\n namespace: 'api/v1',\n resourcePath: 'emberDevelopers',\n op: 'query',\n identifier: { type: 'ember-developer' }\n});\n\n// => 'https://api.example.com/api/v1/emberDevelopers'\n```\n\nOn the surface this may seem like a lot of work to do something simple, but\nit is designed to be composable with other utilities and interfaces that the\naverage product engineer will never need to see or use.\n\nA few notes:\n\n- `resourcePath` is optional, but if it is not provided, `identifier.type` will be used.\n- `host` and `namespace` are optional, but if they are not provided, the values globally\n configured via `setBuildURLConfig` will be used.\n- `op` is required and must be one of the following:\n - 'findRecord' 'query' 'findMany' 'findRelatedCollection' 'findRelatedRecord'` 'createRecord' 'updateRecord' 'deleteRecord'\n- Depending on the value of `op`, `identifier` or `identifiers` will be required.", + "itemtype": "method", + "name": "buildBaseURL", + "static": 1, + "access": "public", + "tagname": "", + "params": [ + { + "name": "urlOptions", + "description": "" + } + ], + "return": { + "description": "string" + }, + "class": "@ember-data/request-utils", + "module": "@ember-data/request-utils" + }, + { + "file": "../packages/request-utils/src/index.ts", + "line": 338, + "description": "filter out keys of an object that have falsy values or point to empty arrays\nreturning a new object with only those keys that have truthy values / non-empty arrays", + "itemtype": "method", + "name": "filterEmpty", + "static": 1, + "access": "public", + "tagname": "", + "params": [ + { + "name": "source", + "description": "object to filter keys with empty values from", + "type": "Record" + } + ], + "return": { + "description": "A new object with the keys that contained empty values removed", + "type": "Record" + }, + "class": "@ember-data/request-utils", + "module": "@ember-data/request-utils" + }, + { + "file": "../packages/request-utils/src/index.ts", + "line": 363, + "description": "Sorts query params by both key and value returning a new URLSearchParams\nobject with the keys inserted in sorted order.\n\nTreats `included` specially, splicing it into an array if it is a string and sorting the array.\n\nOptions:\n- arrayFormat: 'bracket' | 'indices' | 'repeat' | 'comma'\n\n'bracket': appends [] to the key for every value e.g. `&ids[]=1&ids[]=2`\n'indices': appends [i] to the key for every value e.g. `&ids[0]=1&ids[1]=2`\n'repeat': appends the key for every value e.g. `&ids=1&ids=2`\n'comma' (default): appends the key once with a comma separated list of values e.g. `&ids=1,2`", + "itemtype": "method", + "name": "sortQueryParams", + "static": 1, + "access": "public", + "tagname": "", + "params": [ + { + "name": "params", + "description": "", + "type": "URLSearchParams | object" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "A URLSearchParams with keys inserted in sorted order", + "type": "URLSearchParams" + }, + "class": "@ember-data/request-utils", + "module": "@ember-data/request-utils" + }, + { + "file": "../packages/request-utils/src/index.ts", + "line": 445, + "description": "Sorts query params by both key and value, returning a query params string\n\nTreats `included` specially, splicing it into an array if it is a string and sorting the array.\n\nOptions:\n- arrayFormat: 'bracket' | 'indices' | 'repeat' | 'comma'\n\n'bracket': appends [] to the key for every value e.g. `ids[]=1&ids[]=2`\n'indices': appends [i] to the key for every value e.g. `ids[0]=1&ids[1]=2`\n'repeat': appends the key for every value e.g. `ids=1&ids=2`\n'comma' (default): appends the key once with a comma separated list of values e.g. `ids=1,2`", + "itemtype": "method", + "name": "sortQueryParams", + "static": 1, + "access": "public", + "tagname": "", + "params": [ + { + "name": "params", + "description": "", + "type": "URLSearchParams | object" + }, + { + "name": "options", + "description": "", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "A sorted query params string without the leading `?`", + "type": "String" + }, + "class": "@ember-data/request-utils", + "module": "@ember-data/request-utils" + }, + { + "file": "../packages/request-utils/src/index.ts", + "line": 488, + "description": "Parses a string Cache-Control header value into an object with the following structure:\n\n ```ts\n interface CacheControlValue {\n immutable?: boolean;\n 'max-age'?: number;\n 'must-revalidate'?: boolean;\n 'must-understand'?: boolean;\n 'no-cache'?: boolean;\n 'no-store'?: boolean;\n 'no-transform'?: boolean;\n 'only-if-cached'?: boolean;\n private?: boolean;\n 'proxy-revalidate'?: boolean;\n public?: boolean;\n 's-maxage'?: number;\n 'stale-if-error'?: number;\n 'stale-while-revalidate'?: number;\n }\n ```", + "itemtype": "method", + "name": "parseCacheControl", + "static": 1, + "access": "public", + "tagname": "", + "params": [ + { + "name": "header", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "CacheControlValue" + }, + "class": "@ember-data/request-utils", + "module": "@ember-data/request-utils" + }, + { + "file": "../packages/request/src/-private/manager.ts", + "line": 501, + "description": "Register a handler to use for primary cache intercept.\n\nOnly one such handler may exist. If using the same\nRequestManager as the Store instance the Store\nregisters itself as a Cache handler.", + "itemtype": "method", + "name": "useCache", + "access": "public", + "tagname": "", + "params": [ + { + "name": "cacheHandler", + "description": "", + "type": "Handler[]" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "RequestManager", + "module": "@ember-data/request" + }, + { + "file": "../packages/request/src/-private/manager.ts", + "line": 528, + "description": "Register handler(s) to use when a request is issued.\n\nHandlers will be invoked in the order they are registered.\nEach Handler is given the opportunity to handle the request,\ncurry the request, or pass along a modified request.", + "itemtype": "method", + "name": "use", + "access": "public", + "tagname": "", + "params": [ + { + "name": "newHandlers", + "description": "", + "type": "Handler[]" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "RequestManager", + "module": "@ember-data/request" + }, + { + "file": "../packages/request/src/-private/manager.ts", + "line": 562, + "description": "Issue a Request.\n\nReturns a Future that fulfills with a StructuredDocument", + "itemtype": "method", + "name": "request", + "access": "public", + "tagname": "", + "params": [ + { + "name": "request", + "description": "", + "type": "RequestInfo" + } + ], + "return": { + "description": "", + "type": "Future" + }, + "class": "RequestManager", + "module": "@ember-data/request" + }, + { + "file": "../packages/request/src/-private/types.ts", + "line": 76, + "description": "Cancel this request by firing the AbortController's signal.", + "itemtype": "method", + "name": "abort", + "params": [ + { + "name": "reason", + "description": "optional reason for aborting the request", + "type": "String", + "optional": true + } + ], + "access": "public", + "tagname": "", + "return": { + "description": "", + "type": "Void" + }, + "class": "Future", + "module": "@ember-data/request" + }, + { + "file": "../packages/request/src/-private/types.ts", + "line": 85, + "description": "Get the response stream, if any, once made available.", + "itemtype": "method", + "name": "getStream", + "access": "public", + "tagname": "", + "return": { + "description": "", + "type": "Promise" + }, + "class": "Future", + "module": "@ember-data/request" + }, + { + "file": "../packages/request/src/-private/types.ts", + "line": 94, + "description": "Run a callback when this request completes. Use sparingly,\nmostly useful for instrumentation and infrastructure.", + "itemtype": "method", + "name": "onFinalize", + "params": [ + { + "name": "cb", + "description": "the callback to run" + } + ], + "access": "public", + "tagname": "", + "return": { + "description": "void" + }, + "class": "Future", + "module": "@ember-data/request" + }, + { + "file": "../packages/request/src/-private/types.ts", + "line": 318, + "description": "Method to implement to handle requests. Receives the request\ncontext and a nextFn to call to pass-along the request to\nother handlers.", + "itemtype": "method", + "name": "request", + "access": "public", + "tagname": "", + "params": [ + { + "name": "context", + "description": "" + }, + { + "name": "next", + "description": "" + } + ], + "class": " Handler", + "module": "@ember-data/request" + }, + { + "file": "../packages/rest/src/-private/builders/find-record.ts", + "line": 21, + "description": "Builds request options to fetch a single resource by a known id or identifier\nconfigured for the url and header expectations of most REST APIs.\n\n**Basic Usage**\n\n```ts\nimport { findRecord } from '@ember-data/rest/request';\n\nconst data = await store.request(findRecord('person', '1'));\n```\n\n**With Options**\n\n```ts\nimport { findRecord } from '@ember-data/rest/request';\n\nconst options = findRecord('person', '1', { include: ['pets', 'friends'] });\nconst data = await store.request(options);\n```\n\n**With an Identifier**\n\n```ts\nimport { findRecord } from '@ember-data/rest/request';\n\nconst options = findRecord({ type: 'person', id: '1' }, { include: ['pets', 'friends'] });\nconst data = await store.request(options);\n```\n\n**Supplying Options to Modify the Request Behavior**\n\nThe following options are supported:\n\n- `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.\n- `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.\n- `resourcePath` - The resource path to use for the request, defaults to pluralizing and camelCasing the supplied type\n- `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to `false` if none is configured.\n- `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to `false` if none is configured.\n- `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)\n\n```ts\nimport { findRecord } from '@ember-data/rest/request';\n\nconst options = findRecord('person', '1', { include: ['pets', 'friends'] }, { namespace: 'api/v2' });\nconst data = await store.request(options);\n```", + "itemtype": "method", + "name": "findRecord", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/rest/request", + "module": "@ember-data/rest/request" + }, + { + "file": "../packages/rest/src/-private/builders/query.ts", + "line": 13, + "description": "Builds request options to query for resources, usually by a primary\ntype, configured for the url and header expectations of most REST APIs.\n\n**Basic Usage**\n\n```ts\nimport { query } from '@ember-data/rest/request';\n\nconst data = await store.request(query('person'));\n```\n\n**With Query Params**\n\n```ts\nimport { query } from '@ember-data/rest/request';\n\nconst options = query('person', { include: ['pets', 'friends'] });\nconst data = await store.request(options);\n```\n\n**Supplying Options to Modify the Request Behavior**\n\nThe following options are supported:\n\n- `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.\n- `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.\n- `resourcePath` - The resource path to use for the request, defaults to pluralizing and camelCasing the supplied type\n- `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to `false` if none is configured.\n- `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to `false` if none is configured.\n- `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)\n\n```ts\nimport { query } from '@ember-data/rest/request';\n\nconst options = query('person', { include: ['pets', 'friends'] }, { reload: true });\nconst data = await store.request(options);\n```", + "itemtype": "method", + "name": "query", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "query", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/rest/request", + "module": "@ember-data/rest/request" + }, + { + "file": "../packages/rest/src/-private/builders/save-record.ts", + "line": 27, + "description": "Builds request options to delete record for resources,\nconfigured for the url, method and header expectations of REST APIs.\n\n**Basic Usage**\n\n```ts\nimport { deleteRecord } from '@ember-data/rest/request';\n\nconst person = this.store.peekRecord('person', '1');\n\n// mark record as deleted\nstore.deleteRecord(person);\n\n// persist deletion\nconst data = await store.request(deleteRecord(person));\n```\n\n**Supplying Options to Modify the Request Behavior**\n\nThe following options are supported:\n\n- `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.\n- `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.\n- `resourcePath` - The resource path to use for the request, defaults to pluralizing the supplied type\n- `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to `false` if none is configured.\n- `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to `false` if none is configured.\n- `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)\n\n```ts\nimport { deleteRecord } from '@ember-data/rest/request';\n\nconst person = this.store.peekRecord('person', '1');\n\n// mark record as deleted\nstore.deleteRecord(person);\n\n// persist deletion\nconst options = deleteRecord(person, { namespace: 'api/v1' });\nconst data = await store.request(options);\n```", + "itemtype": "method", + "name": "deleteRecord", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "record", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/rest/request", + "module": "@ember-data/rest/request" + }, + { + "file": "../packages/rest/src/-private/builders/save-record.ts", + "line": 107, + "description": "Builds request options to create new record for resources,\nconfigured for the url, method and header expectations of most REST APIs.\n\n**Basic Usage**\n\n```ts\nimport { createRecord } from '@ember-data/rest/request';\n\nconst person = this.store.createRecord('person', { name: 'Ted' });\nconst data = await store.request(createRecord(person));\n```\n\n**Supplying Options to Modify the Request Behavior**\n\nThe following options are supported:\n\n- `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.\n- `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.\n- `resourcePath` - The resource path to use for the request, defaults to pluralizing the supplied type\n- `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to `false` if none is configured.\n- `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to `false` if none is configured.\n- `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)\n\n```ts\nimport { createRecord } from '@ember-data/rest/request';\n\nconst person = this.store.createRecord('person', { name: 'Ted' });\nconst options = createRecord(person, { namespace: 'api/v1' });\nconst data = await store.request(options);\n```", + "itemtype": "method", + "name": "createRecord", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "record", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/rest/request", + "module": "@ember-data/rest/request" + }, + { + "file": "../packages/rest/src/-private/builders/save-record.ts", + "line": 176, + "description": "Builds request options to update existing record for resources,\nconfigured for the url, method and header expectations of most REST APIs.\n\n**Basic Usage**\n\n```ts\nimport { updateRecord } from '@ember-data/rest/request';\n\nconst person = this.store.peekRecord('person', '1');\nperson.name = 'Chris';\nconst data = await store.request(updateRecord(person));\n```\n\n**Supplying Options to Modify the Request Behavior**\n\nThe following options are supported:\n\n- `patch` - Allows caller to specify whether to use a PATCH request instead of a PUT request, defaults to `false`.\n- `host` - The host to use for the request, defaults to the `host` configured with `setBuildURLConfig`.\n- `namespace` - The namespace to use for the request, defaults to the `namespace` configured with `setBuildURLConfig`.\n- `resourcePath` - The resource path to use for the request, defaults to pluralizing the supplied type\n- `reload` - Whether to forcibly reload the request if it is already in the store, not supplying this\n option will delegate to the store's lifetimes service, defaulting to `false` if none is configured.\n- `backgroundReload` - Whether to reload the request if it is already in the store, but to also resolve the\n promise with the cached value, not supplying this option will delegate to the store's lifetimes service,\n defaulting to `false` if none is configured.\n- `urlParamsSetting` - an object containing options for how to serialize the query params (see `buildQueryParams`)\n\n```ts\nimport { updateRecord } from '@ember-data/rest/request';\n\nconst person = this.store.peekRecord('person', '1');\nperson.name = 'Chris';\nconst options = updateRecord(person, { patch: true });\nconst data = await store.request(options);\n```", + "itemtype": "method", + "name": "updateRecord", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "record", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "@ember-data/rest/request", + "module": "@ember-data/rest/request" + }, + { + "file": "../packages/serializer/src/-private/transforms/transform.js", + "line": 82, + "description": "When given a deserialized value from a record attribute this\nmethod must return the serialized value.\n\nExample\n\n```javascript\nserialize(deserialized, options) {\n return deserialized ? null : Number(deserialized);\n}\n```", + "itemtype": "method", + "name": "serialize", + "access": "public", + "tagname": "", + "params": [ + { + "name": "deserialized", + "description": "The deserialized value" + }, + { + "name": "options", + "description": "hash of options passed to `attr`" + } + ], + "return": { + "description": "The serialized value" + }, + "class": "Transform", + "module": "@ember-data/serializer" + }, + { + "file": "../packages/serializer/src/-private/transforms/transform.js", + "line": 100, + "description": "When given a serialized value from a JSON object this method must\nreturn the deserialized value for the record attribute.\n\nExample\n\n```javascript\ndeserialize(serialized, options) {\n return empty(serialized) ? null : Number(serialized);\n}\n```", + "itemtype": "method", + "name": "deserialize", + "access": "public", + "tagname": "", + "params": [ + { + "name": "serialized", + "description": "The serialized value" + }, + { + "name": "options", + "description": "hash of options passed to `attr`" + } + ], + "return": { + "description": "The deserialized value" + }, + "class": "Transform", + "module": "@ember-data/serializer" + }, + { + "file": "../packages/serializer/src/-private/embedded-records-mixin.js", + "line": 105, + "description": "Normalize the record and recursively normalize/extract all the embedded records\nwhile pushing them into the store as they are encountered\n\nA payload with an attr configured for embedded records needs to be extracted:\n\n```js\n{\n \"post\": {\n \"id\": \"1\"\n \"title\": \"Rails is omakase\",\n \"comments\": [{\n \"id\": \"1\",\n \"body\": \"Rails is unagi\"\n }, {\n \"id\": \"2\",\n \"body\": \"Omakase O_o\"\n }]\n }\n}\n```", + "itemtype": "method", + "name": "normalize", + "access": "public", + "tagname": "", + "params": [ + { + "name": "typeClass", + "description": "", + "type": "Model" + }, + { + "name": "hash", + "description": "to be normalized", + "type": "Object" + }, + { + "name": "prop", + "description": "the hash has been referenced by", + "type": "String" + } + ], + "return": { + "description": "the normalized hash", + "type": "Object" + }, + "class": "EmbeddedRecordsMixin", + "module": "@ember-data/serializer/rest" + }, + { + "file": "../packages/serializer/src/-private/embedded-records-mixin.js", + "line": 149, + "description": "Serialize `belongsTo` relationship when it is configured as an embedded object.\n\nThis example of an author model belongs to a post model:\n\n```js\nimport Model, { attr, belongsTo } from '@ember-data/model';\n\nPost = Model.extend({\n title: attr('string'),\n body: attr('string'),\n author: belongsTo('author')\n});\n\nAuthor = Model.extend({\n name: attr('string'),\n post: belongsTo('post')\n});\n```\n\nUse a custom (type) serializer for the post model to configure embedded author\n\n```app/serializers/post.js\nimport RESTSerializer, { EmbeddedRecordsMixin } from '@ember-data/serializer/rest';\n\nexport default class PostSerializer extends RESTSerializer.extend(EmbeddedRecordsMixin) {\n attrs = {\n author: { embedded: 'always' }\n }\n}\n```\n\nA payload with an attribute configured for embedded records can serialize\nthe records together under the root attribute's payload:\n\n```js\n{\n \"post\": {\n \"id\": \"1\"\n \"title\": \"Rails is omakase\",\n \"author\": {\n \"id\": \"2\"\n \"name\": \"dhh\"\n }\n }\n}\n```", + "itemtype": "method", + "name": "serializeBelongsTo", + "access": "public", + "tagname": "", + "params": [ + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "json", + "description": "", + "type": "Object" + }, + { + "name": "relationship", + "description": "", + "type": "Object" + } + ], + "class": "EmbeddedRecordsMixin", + "module": "@ember-data/serializer/rest" + }, + { + "file": "../packages/serializer/src/-private/embedded-records-mixin.js", + "line": 253, + "description": "Serializes `hasMany` relationships when it is configured as embedded objects.\n\nThis example of a post model has many comments:\n\n```js\nimport Model, { attr, belongsTo, hasMany } from '@ember-data/model';\n\nPost = Model.extend({\n title: attr('string'),\n body: attr('string'),\n comments: hasMany('comment')\n});\n\nComment = Model.extend({\n body: attr('string'),\n post: belongsTo('post')\n});\n```\n\nUse a custom (type) serializer for the post model to configure embedded comments\n\n```app/serializers/post.js\nimport RESTSerializer, { EmbeddedRecordsMixin } from '@ember-data/serializer/rest';\n\nexport default class PostSerializer extends RESTSerializer.extend(EmbeddedRecordsMixin) {\n attrs = {\n comments: { embedded: 'always' }\n }\n}\n```\n\nA payload with an attribute configured for embedded records can serialize\nthe records together under the root attribute's payload:\n\n```js\n{\n \"post\": {\n \"id\": \"1\"\n \"title\": \"Rails is omakase\",\n \"body\": \"I want this for my ORM, I want that for my template language...\"\n \"comments\": [{\n \"id\": \"1\",\n \"body\": \"Rails is unagi\"\n }, {\n \"id\": \"2\",\n \"body\": \"Omakase O_o\"\n }]\n }\n}\n```\n\nThe attrs options object can use more specific instruction for extracting and\nserializing. When serializing, an option to embed `ids`, `ids-and-types` or `records` can be set.\nWhen extracting the only option is `records`.\n\nSo `{ embedded: 'always' }` is shorthand for:\n`{ serialize: 'records', deserialize: 'records' }`\n\nTo embed the `ids` for a related object (using a hasMany relationship):\n\n```app/serializers/post.js\nimport RESTSerializer, { EmbeddedRecordsMixin } from '@ember-data/serializer/rest';\n\nexport default class PostSerializer extends RESTSerializer.extend(EmbeddedRecordsMixin) {\n attrs = {\n comments: { serialize: 'ids', deserialize: 'records' }\n }\n}\n```\n\n```js\n{\n \"post\": {\n \"id\": \"1\"\n \"title\": \"Rails is omakase\",\n \"body\": \"I want this for my ORM, I want that for my template language...\"\n \"comments\": [\"1\", \"2\"]\n }\n}\n```\n\nTo embed the relationship as a collection of objects with `id` and `type` keys, set\n`ids-and-types` for the related object.\n\nThis is particularly useful for polymorphic relationships where records don't share\nthe same table and the `id` is not enough information.\n\nFor example having a user that has many pets:\n\n```js\nUser = Model.extend({\n name: attr('string'),\n pets: hasMany('pet', { polymorphic: true })\n});\n\nPet = Model.extend({\n name: attr('string'),\n});\n\nCat = Pet.extend({\n // ...\n});\n\nParrot = Pet.extend({\n // ...\n});\n```\n\n```app/serializers/user.js\nimport RESTSerializer, { EmbeddedRecordsMixin } from '@ember-data/serializer/rest';\n\nexport default class UserSerializer extends RESTSerializer.extend(EmbeddedRecordsMixin) {\n attrs = {\n pets: { serialize: 'ids-and-types', deserialize: 'records' }\n }\n}\n```\n\n```js\n{\n \"user\": {\n \"id\": \"1\"\n \"name\": \"Bertin Osborne\",\n \"pets\": [\n { \"id\": \"1\", \"type\": \"Cat\" },\n { \"id\": \"1\", \"type\": \"Parrot\"}\n ]\n }\n}\n```", + "itemtype": "method", + "name": "serializeHasMany", + "access": "public", + "tagname": "", + "params": [ + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "json", + "description": "", + "type": "Object" + }, + { + "name": "relationship", + "description": "", + "type": "Object" + } + ], + "class": "EmbeddedRecordsMixin", + "module": "@ember-data/serializer/rest" + }, + { + "file": "../packages/serializer/src/-private/embedded-records-mixin.js", + "line": 470, + "description": "When serializing an embedded record, modify the property (in the `JSON` payload)\nthat refers to the parent record (foreign key for the relationship).\n\nSerializing a `belongsTo` relationship removes the property that refers to the\nparent record\n\nSerializing a `hasMany` relationship does not remove the property that refers to\nthe parent record.", + "itemtype": "method", + "name": "removeEmbeddedForeignKey", + "access": "public", + "tagname": "", + "params": [ + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "embeddedSnapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "relationship", + "description": "", + "type": "Object" + }, + { + "name": "json", + "description": "", + "type": "Object" + } + ], + "class": "EmbeddedRecordsMixin", + "module": "@ember-data/serializer/rest" + }, + { + "file": "../packages/serializer/src/-private/embedded-records-mixin.js", + "line": 549, + "itemtype": "method", + "name": "_extractEmbeddedRecords", + "access": "private", + "tagname": "", + "class": "EmbeddedRecordsMixin", + "module": "@ember-data/serializer/rest" + }, + { + "file": "../packages/serializer/src/-private/embedded-records-mixin.js", + "line": 567, + "itemtype": "method", + "name": "_extractEmbeddedHasMany", + "access": "private", + "tagname": "", + "class": "EmbeddedRecordsMixin", + "module": "@ember-data/serializer/rest" + }, + { + "file": "../packages/serializer/src/-private/embedded-records-mixin.js", + "line": 596, + "itemtype": "method", + "name": "_extractEmbeddedBelongsTo", + "access": "private", + "tagname": "", + "class": "EmbeddedRecordsMixin", + "module": "@ember-data/serializer/rest" + }, + { + "file": "../packages/serializer/src/-private/embedded-records-mixin.js", + "line": 619, + "itemtype": "method", + "name": "_normalizeEmbeddedRelationship", + "access": "private", + "tagname": "", + "class": "EmbeddedRecordsMixin", + "module": "@ember-data/serializer/rest" + }, + { + "file": "../packages/serializer/src/index.ts", + "line": 141, + "description": "The `store` property is the application's `store` that contains\nall records. It can be used to look up serializers for other model\ntypes that may be nested inside the payload response.\n\nExample:\n\n```js\nSerializer.extend({\n extractRelationship(relationshipModelName, relationshipHash) {\n let modelClass = this.store.modelFor(relationshipModelName);\n let relationshipSerializer = this.store.serializerFor(relationshipModelName);\n return relationshipSerializer.normalize(modelClass, relationshipHash);\n }\n});\n```", + "itemtype": "property", + "name": "store", + "type": "{Store}", + "access": "public", + "tagname": "", + "class": "Serializer", + "module": "@ember-data/serializer" + }, + { + "file": "../packages/serializer/src/index.ts", + "line": 163, + "description": "The `normalizeResponse` method is used to normalize a payload from the\nserver to a JSON-API Document.\n\nhttp://jsonapi.org/format/#document-structure\n\nExample:\n\n```js\nSerializer.extend({\n normalizeResponse(store, primaryModelClass, payload, id, requestType) {\n if (requestType === 'findRecord') {\n return this.normalize(primaryModelClass, payload);\n } else {\n return payload.reduce(function(documentHash, item) {\n let { data, included } = this.normalize(primaryModelClass, item);\n documentHash.included.push(...included);\n documentHash.data.push(data);\n return documentHash;\n }, { data: [], included: [] })\n }\n }\n});\n```", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "Serializer", + "module": "@ember-data/serializer" + }, + { + "file": "../packages/serializer/src/index.ts", + "line": 199, + "description": "The `serialize` method is used when a record is saved in order to convert\nthe record into the form that your external data source expects.\n\n`serialize` takes an optional `options` hash with a single option:\n\n- `includeId`: If this is `true`, `serialize` should include the ID\n in the serialized object it builds.\n\nExample:\n\n```js\nSerializer.extend({\n serialize(snapshot, options) {\n let json = {\n id: snapshot.id\n };\n\n snapshot.eachAttribute((key, attribute) => {\n json[key] = snapshot.attr(key);\n });\n\n snapshot.eachRelationship((key, relationship) => {\n if (relationship.kind === 'belongsTo') {\n json[key] = snapshot.belongsTo(key, { id: true });\n } else if (relationship.kind === 'hasMany') {\n json[key] = snapshot.hasMany(key, { ids: true });\n }\n });\n\n return json;\n },\n});\n```", + "itemtype": "method", + "name": "serialize", + "access": "public", + "tagname": "", + "params": [ + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "options", + "description": "", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "Serializer", + "module": "@ember-data/serializer" + }, + { + "file": "../packages/serializer/src/index.ts", + "line": 241, + "description": "The `normalize` method is used to convert a payload received from your\nexternal data source into the normalized form `store.push()` expects. You\nshould override this method, munge the hash and return the normalized\npayload.\n\nExample:\n\n```js\nSerializer.extend({\n normalize(modelClass, resourceHash) {\n let data = {\n id: resourceHash.id,\n type: modelClass.modelName,\n attributes: resourceHash\n };\n return { data: data };\n }\n})\n```", + "itemtype": "method", + "name": "normalize", + "access": "public", + "tagname": "", + "params": [ + { + "name": "typeClass", + "description": "", + "type": "Model" + }, + { + "name": "hash", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "Serializer", + "module": "@ember-data/serializer" + }, + { + "file": "../packages/serializer/src/json-api.js", + "line": 139, + "itemtype": "method", + "name": "_normalizeDocumentHelper", + "params": [ + { + "name": "documentHash", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "private", + "tagname": "", + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json-api" + }, + { + "file": "../packages/serializer/src/json-api.js", + "line": 176, + "itemtype": "method", + "name": "_normalizeRelationshipDataHelper", + "params": [ + { + "name": "relationshipDataHash", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "private", + "tagname": "", + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json-api" + }, + { + "file": "../packages/serializer/src/json-api.js", + "line": 188, + "itemtype": "method", + "name": "_normalizeResourceHelper", + "params": [ + { + "name": "resourceHash", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "private", + "tagname": "", + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json-api" + }, + { + "file": "../packages/serializer/src/json-api.js", + "line": 215, + "description": "Normalize some data and push it into the store.", + "itemtype": "method", + "name": "pushPayload", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "payload", + "description": "", + "type": "Object" + } + ], + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json-api" + }, + { + "file": "../packages/serializer/src/json-api.js", + "line": 228, + "itemtype": "method", + "name": "_normalizeResponse", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + }, + { + "name": "isSingle", + "description": "", + "type": "Boolean" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "access": "private", + "tagname": "", + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json-api" + }, + { + "file": "../packages/serializer/src/json-api.js", + "line": 278, + "description": "Returns a relationship formatted as a JSON-API \"relationship object\".\n\nhttp://jsonapi.org/format/#document-resource-object-relationships", + "itemtype": "method", + "name": "extractRelationship", + "access": "public", + "tagname": "", + "params": [ + { + "name": "relationshipHash", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json-api" + }, + { + "file": "../packages/serializer/src/json-api.js", + "line": 305, + "description": "Returns the resource's relationships formatted as a JSON-API \"relationships object\".\n\nhttp://jsonapi.org/format/#document-resource-object-relationships", + "itemtype": "method", + "name": "extractRelationships", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelClass", + "description": "", + "type": "Object" + }, + { + "name": "resourceHash", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json-api" + }, + { + "file": "../packages/serializer/src/json-api.js", + "line": 343, + "itemtype": "method", + "name": "_extractType", + "params": [ + { + "name": "modelClass", + "description": "", + "type": "Model" + }, + { + "name": "resourceHash", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "String" + }, + "access": "private", + "tagname": "", + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json-api" + }, + { + "file": "../packages/serializer/src/json-api.js", + "line": 354, + "description": "Dasherizes and singularizes the model name in the payload to match\nthe format Ember Data uses internally for the model name.\n\nFor example the key `posts` would be converted to `post` and the\nkey `studentAssesments` would be converted to `student-assesment`.", + "itemtype": "method", + "name": "modelNameFromPayloadKey", + "access": "public", + "tagname": "", + "params": [ + { + "name": "key", + "description": "", + "type": "String" + } + ], + "return": { + "description": "the model's modelName", + "type": "String" + }, + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json-api" + }, + { + "file": "../packages/serializer/src/json-api.js", + "line": 370, + "description": "Converts the model name to a pluralized version of the model name.\n\nFor example `post` would be converted to `posts` and\n`student-assesment` would be converted to `student-assesments`.", + "itemtype": "method", + "name": "payloadKeyFromModelName", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "String" + }, + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json-api" + }, + { + "file": "../packages/serializer/src/json-api.js", + "line": 406, + "description": "`keyForAttribute` can be used to define rules for how to convert an\nattribute name in your model to a key in your JSON.\nBy default `JSONAPISerializer` follows the format used on the examples of\nhttp://jsonapi.org/format and uses dashes as the word separator in the JSON\nattribute keys.\n\nThis behaviour can be easily customized by extending this method.\n\nExample\n\n```app/serializers/application.js\nimport JSONAPISerializer from '@ember-data/serializer/json-api';\nimport { dasherize } from '/utils/string-utils';\n\nexport default class ApplicationSerializer extends JSONAPISerializer {\n keyForAttribute(attr, method) {\n return dasherize(attr).toUpperCase();\n }\n}\n```", + "itemtype": "method", + "name": "keyForAttribute", + "access": "public", + "tagname": "", + "params": [ + { + "name": "key", + "description": "", + "type": "String" + }, + { + "name": "method", + "description": "", + "type": "String" + } + ], + "return": { + "description": "normalized key", + "type": "String" + }, + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json-api" + }, + { + "file": "../packages/serializer/src/json-api.js", + "line": 438, + "description": "`keyForRelationship` can be used to define a custom key when\nserializing and deserializing relationship properties.\nBy default `JSONAPISerializer` follows the format used on the examples of\nhttp://jsonapi.org/format and uses dashes as word separators in\nrelationship properties.\n\nThis behaviour can be easily customized by extending this method.\n\nExample\n\n ```app/serializers/post.js\n import JSONAPISerializer from '@ember-data/serializer/json-api';\n import { underscore } from '/utils/string-utils';\n\n export default class ApplicationSerializer extends JSONAPISerializer {\n keyForRelationship(key, relationship, method) {\n return underscore(key);\n }\n }\n ```", + "itemtype": "method", + "name": "keyForRelationship", + "access": "public", + "tagname": "", + "params": [ + { + "name": "key", + "description": "", + "type": "String" + }, + { + "name": "typeClass", + "description": "", + "type": "String" + }, + { + "name": "method", + "description": "", + "type": "String" + } + ], + "return": { + "description": "normalized key", + "type": "String" + }, + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json-api" + }, + { + "file": "../packages/serializer/src/json-api.js", + "line": 470, + "itemtype": "method", + "description": "Called when a record is saved in order to convert the\nrecord into JSON.\n\nFor example, consider this model:\n\n```app/models/comment.js\nimport Model, { attr, belongsTo } from '@ember-data/model';\n\nexport default class CommentModel extends Model {\n @attr body;\n @belongsto('user', { async: false, inverse: null })\n author;\n}\n```\n\nThe default serialization would create a JSON-API resource object like:\n\n```javascript\n{\n \"data\": {\n \"type\": \"comments\",\n \"attributes\": {\n \"title\": \"Rails is unagi\",\n \"body\": \"Rails? Omakase? O_O\",\n },\n \"relationships\": {\n \"author\": {\n \"data\": {\n \"id\": \"12\",\n \"type\": \"users\"\n }\n }\n }\n }\n}\n```\n\nBy default, attributes are passed through as-is, unless\nyou specified an attribute type (`attr('date')`). If\nyou specify a transform, the JavaScript value will be\nserialized when inserted into the attributes hash.\n\nBelongs-to relationships are converted into JSON-API\nresource identifier objects.\n\n## IDs\n\n`serialize` takes an options hash with a single option:\n`includeId`. If this option is `true`, `serialize` will,\nby default include the ID in the JSON object it builds.\n\nThe JSONAPIAdapter passes in `includeId: true` when serializing a record\nfor `createRecord` or `updateRecord`.\n\n## Customization\n\nYour server may expect data in a different format than the\nbuilt-in serialization format.\n\nIn that case, you can implement `serialize` yourself and\nreturn data formatted to match your API's expectations, or override\nthe invoked adapter method and do the serialization in the adapter directly\nby using the provided snapshot.\n\nIf your API's format differs greatly from the JSON:API spec, you should\nconsider authoring your own adapter and serializer instead of extending\nthis class.\n\n```app/serializers/post.js\nimport JSONAPISerializer from '@ember-data/serializer/json-api';\n\nexport default class PostSerializer extends JSONAPISerializer {\n serialize(snapshot, options) {\n let json = {\n POST_TTL: snapshot.attr('title'),\n POST_BDY: snapshot.attr('body'),\n POST_CMS: snapshot.hasMany('comments', { ids: true })\n };\n\n if (options.includeId) {\n json.POST_ID_ = snapshot.id;\n }\n\n return json;\n }\n}\n```\n\n## Customizing an App-Wide Serializer\n\nIf you want to define a serializer for your entire\napplication, you'll probably want to use `eachAttribute`\nand `eachRelationship` on the record.\n\n```app/serializers/application.js\nimport JSONAPISerializer from '@ember-data/serializer/json-api';\nimport { underscore, singularize } from '/utils/string-utils';\n\nexport default class ApplicationSerializer extends JSONAPISerializer {\n serialize(snapshot, options) {\n let json = {};\n\n snapshot.eachAttribute((name) => {\n json[serverAttributeName(name)] = snapshot.attr(name);\n });\n\n snapshot.eachRelationship((name, relationship) => {\n if (relationship.kind === 'hasMany') {\n json[serverHasManyName(name)] = snapshot.hasMany(name, { ids: true });\n }\n });\n\n if (options.includeId) {\n json.ID_ = snapshot.id;\n }\n\n return json;\n }\n}\n\nfunction serverAttributeName(attribute) {\n return underscore(attribute).toUpperCase();\n}\n\nfunction serverHasManyName(name) {\n return serverAttributeName(singularize(name)) + '_IDS';\n}\n```\n\nThis serializer will generate JSON that looks like this:\n\n```javascript\n{\n \"TITLE\": \"Rails is omakase\",\n \"BODY\": \"Yep. Omakase.\",\n \"COMMENT_IDS\": [ \"1\", \"2\", \"3\" ]\n}\n```\n\n## Tweaking the Default Formatting\n\nIf you just want to do some small tweaks on the default JSON:API formatted response,\nyou can call `super.serialize` first and make the tweaks\non the returned object.\n\n```app/serializers/post.js\nimport JSONAPISerializer from '@ember-data/serializer/json-api';\n\nexport default class PostSerializer extends JSONAPISerializer {\n serialize(snapshot, options) {\n let json = super.serialize(...arguments);\n\n json.data.attributes.subject = json.data.attributes.title;\n delete json.data.attributes.title;\n\n return json;\n }\n}\n```\n", + "name": "serialize", + "access": "public", + "tagname": "", + "params": [ + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "json", + "type": "Object" + }, + "class": "JSONAPISerializer", + "module": "@ember-data/serializer/json-api" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 95, + "description": "The `primaryKey` is used when serializing and deserializing\ndata. Ember Data always uses the `id` property to store the id of\nthe record. The external source may not always follow this\nconvention. In these cases it is useful to override the\n`primaryKey` property to match the `primaryKey` of your external\nstore.\n\nExample\n\n```app/serializers/application.js\nimport JSONSerializer from '@ember-data/serializer/json';\n\nexport default class ApplicationSerializer extends JSONSerializer {\n primaryKey = '_id'\n}\n```", + "itemtype": "property", + "name": "primaryKey", + "type": "{String}", + "access": "public", + "tagname": "", + "default": "'id'", + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 120, + "itemtype": "property", + "description": "The `attrs` object can be used to declare a simple mapping between\nproperty names on `Model` records and payload keys in the\nserialized JSON object representing the record. An object with the\nproperty `key` can also be used to designate the attribute's key on\nthe response payload.\n\nExample\n\n```app/models/person.js\nimport Model, { attr } from '@ember-data/model';\n\nexport default class PersonModel extends Model {\n @attr('boolean') admin;\n}\n```\n\n```app/serializers/person.js\nimport JSONSerializer from '@ember-data/serializer/json';\n\nexport default class PersonSerializer extends JSONSerializer {\n attrs = {\n admin: 'is_admin',\n occupation: { key: 'career' }\n }\n}\n```\n\nYou can also remove attributes and relationships by setting the `serialize`\nkey to `false` in your mapping object.\n\nExample\n\n```app/serializers/person.js\nimport JSONSerializer from '@ember-data/serializer/json';\n\nexport default class PostSerializer extends JSONSerializer {\n attrs = {\n admin: { serialize: false },\n occupation: { key: 'career' }\n }\n}\n```\n\nWhen serialized:\n\n```javascript\n{\n \"firstName\": \"Harry\",\n \"lastName\": \"Houdini\",\n \"career\": \"magician\"\n}\n```\n\nNote that the `admin` is now not included in the payload.\n\nSetting `serialize` to `true` enforces serialization for hasMany\nrelationships even if it's neither a many-to-many nor many-to-none\nrelationship.\n", + "name": "attrs", + "access": "public", + "tagname": "", + "type": "{Object}", + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 189, + "description": "Given a subclass of `Model` and a JSON object this method will\niterate through each attribute of the `Model` and invoke the\n`Transform#deserialize` method on the matching property of the\nJSON object. This method is typically called after the\nserializer's `normalize` method.", + "itemtype": "method", + "name": "applyTransforms", + "access": "private", + "tagname": "", + "params": [ + { + "name": "typeClass", + "description": "", + "type": "Model" + }, + { + "name": "data", + "description": "The data to transform", + "type": "Object" + } + ], + "return": { + "description": "data The transformed data object", + "type": "Object" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 218, + "description": "The `normalizeResponse` method is used to normalize a payload from the\nserver to a JSON-API Document.\n\nhttp://jsonapi.org/format/#document-structure\n\nThis method delegates to a more specific normalize method based on\nthe `requestType`.\n\nTo override this method with a custom one, make sure to call\n`return super.normalizeResponse(store, primaryModelClass, payload, id, requestType)` with your\npre-processed data.\n\nHere's an example of using `normalizeResponse` manually:\n\n```javascript\nsocket.on('message', function(message) {\n let data = message.data;\n let modelClass = store.modelFor(data.modelName);\n let serializer = store.serializerFor(data.modelName);\n let normalized = serializer.normalizeSingleResponse(store, modelClass, data, data.id);\n\n store.push(normalized);\n});\n```", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 279, + "description": "Called by the default normalizeResponse implementation when the\ntype of request is `findRecord`", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeFindRecordResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 297, + "description": "Called by the default normalizeResponse implementation when the\ntype of request is `queryRecord`", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeQueryRecordResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 315, + "description": "Called by the default normalizeResponse implementation when the\ntype of request is `findAll`", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeFindAllResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 333, + "description": "Called by the default normalizeResponse implementation when the\ntype of request is `findBelongsTo`", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeFindBelongsToResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 351, + "description": "Called by the default normalizeResponse implementation when the\ntype of request is `findHasMany`", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeFindHasManyResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 369, + "description": "Called by the default normalizeResponse implementation when the\ntype of request is `findMany`", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeFindManyResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 387, + "description": "Called by the default normalizeResponse implementation when the\ntype of request is `query`", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeQueryResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 405, + "description": "Called by the default normalizeResponse implementation when the\ntype of request is `createRecord`", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeCreateRecordResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 423, + "description": "Called by the default normalizeResponse implementation when the\ntype of request is `deleteRecord`", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeDeleteRecordResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 441, + "description": "Called by the default normalizeResponse implementation when the\ntype of request is `updateRecord`", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeUpdateRecordResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 459, + "description": "normalizeUpdateRecordResponse, normalizeCreateRecordResponse and\nnormalizeDeleteRecordResponse delegate to this method by default.", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeSaveResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 477, + "description": "normalizeQueryResponse and normalizeFindRecordResponse delegate to this\nmethod by default.", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeSingleResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 495, + "description": "normalizeQueryResponse, normalizeFindManyResponse, and normalizeFindHasManyResponse delegate\nto this method by default.", + "since": "1.13.0", + "itemtype": "method", + "name": "normalizeArrayResponse", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 513, + "itemtype": "method", + "name": "_normalizeResponse", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + }, + { + "name": "isSingle", + "description": "", + "type": "Boolean" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "access": "private", + "tagname": "", + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 562, + "description": "Normalizes a part of the JSON payload returned by\nthe server. You should override this method, munge the hash\nand call super if you have generic normalization to do.\n\nIt takes the type of the record that is being normalized\n(as a Model class), the property where the hash was\noriginally found, and the hash to normalize.\n\nYou can use this method, for example, to normalize underscored keys to camelized\nor other general-purpose normalizations.\n\nExample\n\n```app/serializers/application.js\nimport JSONSerializer from '@ember-data/serializer/json';\nimport { underscore } from '/utils/string-utils';\nimport { get } from '@ember/object';\n\nexport default class ApplicationSerializer extends JSONSerializer {\n normalize(typeClass, hash) {\n let fields = typeClass.fields;\n\n fields.forEach(function(type, field) {\n let payloadField = underscore(field);\n if (field === payloadField) { return; }\n\n hash[field] = hash[payloadField];\n delete hash[payloadField];\n });\n\n return super.normalize(...arguments);\n }\n}\n```", + "itemtype": "method", + "name": "normalize", + "access": "public", + "tagname": "", + "params": [ + { + "name": "typeClass", + "description": "", + "type": "Model" + }, + { + "name": "hash", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 626, + "description": "Returns the resource's ID.", + "itemtype": "method", + "name": "extractId", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelClass", + "description": "", + "type": "Object" + }, + { + "name": "resourceHash", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "String" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 641, + "description": "Returns the resource's attributes formatted as a JSON-API \"attributes object\".\n\nhttp://jsonapi.org/format/#document-resource-object-attributes", + "itemtype": "method", + "name": "extractAttributes", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelClass", + "description": "", + "type": "Object" + }, + { + "name": "resourceHash", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 666, + "description": "Returns a relationship formatted as a JSON-API \"relationship object\".\n\nhttp://jsonapi.org/format/#document-resource-object-relationships", + "itemtype": "method", + "name": "extractRelationship", + "access": "public", + "tagname": "", + "params": [ + { + "name": "relationshipModelName", + "description": "", + "type": "Object" + }, + { + "name": "relationshipHash", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 701, + "description": "Returns a polymorphic relationship formatted as a JSON-API \"relationship object\".\n\nhttp://jsonapi.org/format/#document-resource-object-relationships\n\n`relationshipOptions` is a hash which contains more information about the\npolymorphic relationship which should be extracted:\n - `resourceHash` complete hash of the resource the relationship should be\n extracted from\n - `relationshipKey` key under which the value for the relationship is\n extracted from the resourceHash\n - `relationshipMeta` meta information about the relationship", + "itemtype": "method", + "name": "extractPolymorphicRelationship", + "access": "public", + "tagname": "", + "params": [ + { + "name": "relationshipModelName", + "description": "", + "type": "Object" + }, + { + "name": "relationshipHash", + "description": "", + "type": "Object" + }, + { + "name": "relationshipOptions", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 725, + "description": "Returns the resource's relationships formatted as a JSON-API \"relationships object\".\n\nhttp://jsonapi.org/format/#document-resource-object-relationships", + "itemtype": "method", + "name": "extractRelationships", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelClass", + "description": "", + "type": "Object" + }, + { + "name": "resourceHash", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 797, + "description": "Dasherizes the model name in the payload", + "itemtype": "method", + "name": "modelNameFromPayloadKey", + "access": "public", + "tagname": "", + "params": [ + { + "name": "key", + "description": "", + "type": "String" + } + ], + "return": { + "description": "the model's modelName", + "type": "String" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 809, + "itemtype": "method", + "name": "normalizeRelationships", + "access": "private", + "tagname": "", + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 832, + "itemtype": "method", + "name": "normalizeUsingDeclaredMapping", + "access": "private", + "tagname": "", + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 865, + "description": "Looks up the property key that was set by the custom `attr` mapping\npassed to the serializer.", + "itemtype": "method", + "name": "_getMappedKey", + "access": "private", + "tagname": "", + "params": [ + { + "name": "key", + "description": "", + "type": "String" + } + ], + "return": { + "description": "key", + "type": "String" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 904, + "description": "Check attrs.key.serialize property to inform if the `key`\ncan be serialized", + "itemtype": "method", + "name": "_canSerialize", + "access": "private", + "tagname": "", + "params": [ + { + "name": "key", + "description": "", + "type": "String" + } + ], + "return": { + "description": "true if the key can be serialized", + "type": "Boolean" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 919, + "description": "When attrs.key.serialize is set to true then\nit takes priority over the other checks and the related\nattribute/relationship will be serialized", + "itemtype": "method", + "name": "_mustSerialize", + "access": "private", + "tagname": "", + "params": [ + { + "name": "key", + "description": "", + "type": "String" + } + ], + "return": { + "description": "true if the key must be serialized", + "type": "Boolean" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 935, + "description": "Check if the given hasMany relationship should be serialized\n\nBy default only many-to-many and many-to-none relationships are serialized.\nThis could be configured per relationship by Serializer's `attrs` object.", + "itemtype": "method", + "name": "shouldSerializeHasMany", + "access": "public", + "tagname": "", + "params": [ + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "key", + "description": "", + "type": "String" + }, + { + "name": "relationship", + "description": "", + "type": "RelationshipSchema" + } + ], + "return": { + "description": "true if the hasMany relationship should be serialized", + "type": "Boolean" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 958, + "itemtype": "method", + "description": "Called when a record is saved in order to convert the\nrecord into JSON.\n\nBy default, it creates a JSON object with a key for\neach attribute and belongsTo relationship.\n\nFor example, consider this model:\n\n```app/models/comment.js\nimport Model, { attr, belongsTo } from '@ember-data/model';\n\nexport default class CommentModel extends Model {\n @attr body;\n @belongsto('user') author;\n}\n```\n\nThe default serialization would create a JSON object like:\n\n```javascript\n{\n \"title\": \"Rails is unagi\",\n \"body\": \"Rails? Omakase? O_O\",\n \"author\": 12\n}\n```\n\nBy default, attributes are passed through as-is, unless\nyou specified an attribute type (`attr('date')`). If\nyou specify a transform, the JavaScript value will be\nserialized when inserted into the JSON hash.\n\nBy default, belongs-to relationships are converted into\nIDs when inserted into the JSON hash.\n\n## IDs\n\n`serialize` takes an options hash with a single option:\n`includeId`. If this option is `true`, `serialize` will,\nby default include the ID in the JSON object it builds.\n\nThe adapter passes in `includeId: true` when serializing\na record for `createRecord`, but not for `updateRecord`.\n\n## Customization\n\nYour server may expect a different JSON format than the\nbuilt-in serialization format.\n\nIn that case, you can implement `serialize` yourself and\nreturn a JSON hash of your choosing.\n\n```app/serializers/post.js\nimport JSONSerializer from '@ember-data/serializer/json';\n\nexport default class PostSerializer extends JSONSerializer {\n serialize(snapshot, options) {\n let json = {\n POST_TTL: snapshot.attr('title'),\n POST_BDY: snapshot.attr('body'),\n POST_CMS: snapshot.hasMany('comments', { ids: true })\n };\n\n if (options.includeId) {\n json.POST_ID_ = snapshot.id;\n }\n\n return json;\n }\n}\n```\n\n## Customizing an App-Wide Serializer\n\nIf you want to define a serializer for your entire\napplication, you'll probably want to use `eachAttribute`\nand `eachRelationship` on the record.\n\n```app/serializers/application.js\nimport JSONSerializer from '@ember-data/serializer/json';\nimport { singularize } from '/utils/string-utils';\n\nexport default class ApplicationSerializer extends JSONSerializer {\n serialize(snapshot, options) {\n let json = {};\n\n snapshot.eachAttribute((name) => {\n json[serverAttributeName(name)] = snapshot.attr(name);\n });\n\n snapshot.eachRelationship((name, relationship) => {\n if (relationship.kind === 'hasMany') {\n json[serverHasManyName(name)] = snapshot.hasMany(name, { ids: true });\n }\n });\n\n if (options.includeId) {\n json.ID_ = snapshot.id;\n }\n\n return json;\n }\n}\n\nfunction serverAttributeName(attribute) {\n return attribute.underscore().toUpperCase();\n}\n\nfunction serverHasManyName(name) {\n return serverAttributeName(singularize(name)) + \"_IDS\";\n}\n```\n\nThis serializer will generate JSON that looks like this:\n\n```javascript\n{\n \"TITLE\": \"Rails is omakase\",\n \"BODY\": \"Yep. Omakase.\",\n \"COMMENT_IDS\": [ \"1\", \"2\", \"3\" ]\n}\n```\n\n## Tweaking the Default JSON\n\nIf you just want to do some small tweaks on the default JSON,\nyou can call `super.serialize` first and make the tweaks on\nthe returned JSON.\n\n```app/serializers/post.js\nimport JSONSerializer from '@ember-data/serializer/json';\n\nexport default class PostSerializer extends JSONSerializer {\n serialize(snapshot, options) {\n let json = super.serialize(...arguments);\n\n json.subject = json.title;\n delete json.title;\n\n return json;\n }\n}\n```\n", + "name": "serialize", + "access": "public", + "tagname": "", + "params": [ + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "json", + "type": "Object" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 1136, + "description": "You can use this method to customize how a serialized record is added to the complete\nJSON hash to be sent to the server. By default the JSON Serializer does not namespace\nthe payload and just sends the raw serialized JSON object.\nIf your server expects namespaced keys, you should consider using the RESTSerializer.\nOtherwise you can override this method to customize how the record is added to the hash.\nThe hash property should be modified by reference.\n\nFor example, your server may expect underscored root objects.\n\n```app/serializers/application.js\nimport RESTSerializer from '@ember-data/serializer/rest';\nimport { decamelize } from '/utils/string-utils';\n\nexport default class ApplicationSerializer extends RESTSerializer {\n serializeIntoHash(data, type, snapshot, options) {\n let root = decamelize(type.modelName);\n data[root] = this.serialize(snapshot, options);\n }\n}\n```", + "itemtype": "method", + "name": "serializeIntoHash", + "access": "public", + "tagname": "", + "params": [ + { + "name": "hash", + "description": "", + "type": "Object" + }, + { + "name": "typeClass", + "description": "", + "type": "Model" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 1169, + "description": "`serializeAttribute` can be used to customize how `attr`\nproperties are serialized\n\nFor example if you wanted to ensure all your attributes were always\nserialized as properties on an `attributes` object you could\nwrite:\n\n```app/serializers/application.js\nimport JSONSerializer from '@ember-data/serializer/json';\n\nexport default class ApplicationSerializer extends JSONSerializer {\n serializeAttribute(snapshot, json, key, attributes) {\n json.attributes = json.attributes || {};\n super.serializeAttribute(snapshot, json.attributes, key, attributes);\n }\n}\n```", + "itemtype": "method", + "name": "serializeAttribute", + "access": "public", + "tagname": "", + "params": [ + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "json", + "description": "", + "type": "Object" + }, + { + "name": "key", + "description": "", + "type": "String" + }, + { + "name": "attribute", + "description": "", + "type": "Object" + } + ], + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 1217, + "description": "`serializeBelongsTo` can be used to customize how `belongsTo`\nproperties are serialized.\n\nExample\n\n```app/serializers/post.js\nimport JSONSerializer from '@ember-data/serializer/json';\n\nexport default class PostSerializer extends JSONSerializer {\n serializeBelongsTo(snapshot, json, relationship) {\n let key = relationship.key;\n let belongsTo = snapshot.belongsTo(key);\n\n key = this.keyForRelationship ? this.keyForRelationship(key, \"belongsTo\", \"serialize\") : key;\n\n json[key] = !belongsTo ? null : belongsTo.record.toJSON();\n }\n}\n```", + "itemtype": "method", + "name": "serializeBelongsTo", + "access": "public", + "tagname": "", + "params": [ + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "json", + "description": "", + "type": "Object" + }, + { + "name": "relationship", + "description": "", + "type": "Object" + } + ], + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 1271, + "description": "`serializeHasMany` can be used to customize how `hasMany`\nproperties are serialized.\n\nExample\n\n```app/serializers/post.js\nimport JSONSerializer from '@ember-data/serializer/json';\n\nexport default class PostSerializer extends JSONSerializer {\n serializeHasMany(snapshot, json, relationship) {\n let key = relationship.key;\n if (key === 'comments') {\n return;\n } else {\n super.serializeHasMany(...arguments);\n }\n }\n}\n```", + "itemtype": "method", + "name": "serializeHasMany", + "access": "public", + "tagname": "", + "params": [ + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "json", + "description": "", + "type": "Object" + }, + { + "name": "relationship", + "description": "", + "type": "Object" + } + ], + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 1318, + "description": "You can use this method to customize how polymorphic objects are\nserialized. Objects are considered to be polymorphic if\n`{ polymorphic: true }` is pass as the second argument to the\n`belongsTo` function.\n\nExample\n\n```app/serializers/comment.js\nimport JSONSerializer from '@ember-data/serializer/json';\n\nexport default class CommentSerializer extends JSONSerializer {\n serializePolymorphicType(snapshot, json, relationship) {\n let key = relationship.key;\n let belongsTo = snapshot.belongsTo(key);\n\n key = this.keyForAttribute ? this.keyForAttribute(key, 'serialize') : key;\n\n if (!belongsTo) {\n json[key + '_type'] = null;\n } else {\n json[key + '_type'] = belongsTo.modelName;\n }\n }\n}\n```", + "itemtype": "method", + "name": "serializePolymorphicType", + "access": "public", + "tagname": "", + "params": [ + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "json", + "description": "", + "type": "Object" + }, + { + "name": "relationship", + "description": "", + "type": "Object" + } + ], + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 1353, + "description": "`extractMeta` is used to deserialize any meta information in the\nadapter payload. By default Ember Data expects meta information to\nbe located on the `meta` property of the payload object.\n\nExample\n\n```app/serializers/post.js\nimport JSONSerializer from '@ember-data/serializer/json';\n\nexport default class PostSerializer extends JSONSerializer {\n extractMeta(store, typeClass, payload) {\n if (payload && payload.hasOwnProperty('_pagination')) {\n let meta = payload._pagination;\n delete payload._pagination;\n return meta;\n }\n }\n}\n```", + "itemtype": "method", + "name": "extractMeta", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "modelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + } + ], + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 1388, + "description": "`extractErrors` is used to extract model errors when a call\nto `Model#save` fails with an `InvalidError`. By default\nEmber Data expects error information to be located on the `errors`\nproperty of the payload object.\n\nThis serializer expects this `errors` object to be an Array similar\nto the following, compliant with the https://jsonapi.org/format/#errors specification:\n\n```js\n{\n \"errors\": [\n {\n \"detail\": \"This username is already taken!\",\n \"source\": {\n \"pointer\": \"data/attributes/username\"\n }\n }, {\n \"detail\": \"Doesn't look like a valid email.\",\n \"source\": {\n \"pointer\": \"data/attributes/email\"\n }\n }\n ]\n}\n```\n\nThe key `detail` provides a textual description of the problem.\nAlternatively, the key `title` can be used for the same purpose.\n\nThe nested keys `source.pointer` detail which specific element\nof the request data was invalid.\n\nNote that JSON-API also allows for object-level errors to be placed\nin an object with pointer `data`, signifying that the problem\ncannot be traced to a specific attribute:\n\n```javascript\n{\n \"errors\": [\n {\n \"detail\": \"Some generic non property error message\",\n \"source\": {\n \"pointer\": \"data\"\n }\n }\n ]\n}\n```\n\nWhen turn into a `Errors` object, you can read these errors\nthrough the property `base`:\n\n```handlebars\n{{#each @model.errors.base as |error|}}\n
\n {{error.message}}\n
\n{{/each}}\n```\n\nExample of alternative implementation, overriding the default\nbehavior to deal with a different format of errors:\n\n```app/serializers/post.js\nimport JSONSerializer from '@ember-data/serializer/json';\n\nexport default class PostSerializer extends JSONSerializer {\n extractErrors(store, typeClass, payload, id) {\n if (payload && typeof payload === 'object' && payload._problems) {\n payload = payload._problems;\n this.normalizeErrors(typeClass, payload);\n }\n return payload;\n }\n}\n```", + "itemtype": "method", + "name": "extractErrors", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "typeClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "(String|Number)" + } + ], + "return": { + "description": "json The deserialized errors", + "type": "Object" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 1523, + "description": "`keyForAttribute` can be used to define rules for how to convert an\nattribute name in your model to a key in your JSON.\n\nExample\n\n```app/serializers/application.js\nimport JSONSerializer from '@ember-data/serializer/json';\nimport { underscore } from '/utils/string-utils';\n\nexport default class ApplicationSerializer extends JSONSerializer {\n keyForAttribute(attr, method) {\n return underscore(attr).toUpperCase();\n }\n}\n```", + "itemtype": "method", + "name": "keyForAttribute", + "access": "public", + "tagname": "", + "params": [ + { + "name": "key", + "description": "", + "type": "String" + }, + { + "name": "method", + "description": "", + "type": "String" + } + ], + "return": { + "description": "normalized key", + "type": "String" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 1550, + "description": "`keyForRelationship` can be used to define a custom key when\nserializing and deserializing relationship properties. By default\n`JSONSerializer` does not provide an implementation of this method.\n\nExample\n\n ```app/serializers/post.js\n import JSONSerializer from '@ember-data/serializer/json';\n import { underscore } from '/utils/string-utils';\n\n export default class PostSerializer extends JSONSerializer {\n keyForRelationship(key, relationship, method) {\n return `rel_${underscore(key)}`;\n }\n }\n ```", + "itemtype": "method", + "name": "keyForRelationship", + "access": "public", + "tagname": "", + "params": [ + { + "name": "key", + "description": "", + "type": "String" + }, + { + "name": "typeClass", + "description": "", + "type": "String" + }, + { + "name": "method", + "description": "", + "type": "String" + } + ], + "return": { + "description": "normalized key", + "type": "String" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 1579, + "description": "`keyForLink` can be used to define a custom key when deserializing link\nproperties.", + "itemtype": "method", + "name": "keyForLink", + "access": "public", + "tagname": "", + "params": [ + { + "name": "key", + "description": "", + "type": "String" + }, + { + "name": "kind", + "description": "`belongsTo` or `hasMany`", + "type": "String" + } + ], + "return": { + "description": "normalized key", + "type": "String" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/json.js", + "line": 1595, + "itemtype": "method", + "name": "transformFor", + "access": "private", + "tagname": "", + "params": [ + { + "name": "attributeType", + "description": "", + "type": "String" + }, + { + "name": "skipAssertion", + "description": "", + "type": "Boolean" + } + ], + "return": { + "description": "transform", + "type": "Transform" + }, + "class": "JSONSerializer", + "module": "@ember-data/serializer/json" + }, + { + "file": "../packages/serializer/src/rest.js", + "line": 71, + "description": "`keyForPolymorphicType` can be used to define a custom key when\nserializing and deserializing a polymorphic type. By default, the\nreturned key is `${key}Type`.\n\nExample\n\n ```app/serializers/post.js\n import RESTSerializer from '@ember-data/serializer/rest';\n\n export default class ApplicationSerializer extends RESTSerializer {\n keyForPolymorphicType(key, relationship) {\n let relationshipKey = this.keyForRelationship(key);\n\n return 'type-' + relationshipKey;\n }\n }\n ```", + "itemtype": "method", + "name": "keyForPolymorphicType", + "access": "public", + "tagname": "", + "params": [ + { + "name": "key", + "description": "", + "type": "String" + }, + { + "name": "typeClass", + "description": "", + "type": "String" + }, + { + "name": "method", + "description": "", + "type": "String" + } + ], + "return": { + "description": "normalized key", + "type": "String" + }, + "class": "RESTSerializer", + "module": "@ember-data/serializer/rest" + }, + { + "file": "../packages/serializer/src/rest.js", + "line": 103, + "description": "Normalizes a part of the JSON payload returned by\nthe server. You should override this method, munge the hash\nand call super if you have generic normalization to do.\n\nIt takes the type of the record that is being normalized\n(as a Model class), the property where the hash was\noriginally found, and the hash to normalize.\n\nFor example, if you have a payload that looks like this:\n\n```js\n{\n \"post\": {\n \"id\": 1,\n \"title\": \"Rails is omakase\",\n \"comments\": [ 1, 2 ]\n },\n \"comments\": [{\n \"id\": 1,\n \"body\": \"FIRST\"\n }, {\n \"id\": 2,\n \"body\": \"Rails is unagi\"\n }]\n}\n```\n\nThe `normalize` method will be called three times:\n\n* With `App.Post`, `\"posts\"` and `{ id: 1, title: \"Rails is omakase\", ... }`\n* With `App.Comment`, `\"comments\"` and `{ id: 1, body: \"FIRST\" }`\n* With `App.Comment`, `\"comments\"` and `{ id: 2, body: \"Rails is unagi\" }`\n\nYou can use this method, for example, to normalize underscored keys to camelized\nor other general-purpose normalizations. You will only need to implement\n`normalize` and manipulate the payload as desired.\n\nFor example, if the `IDs` under `\"comments\"` are provided as `_id` instead of\n`id`, you can specify how to normalize just the comments:\n\n```app/serializers/post.js\nimport RESTSerializer from '@ember-data/serializer/rest';\n\nexport default class ApplicationSerializer extends RESTSerializer {\n normalize(model, hash, prop) {\n if (prop === 'comments') {\n hash.id = hash._id;\n delete hash._id;\n }\n\n return super.normalize(...arguments);\n }\n}\n```\n\nOn each call to the `normalize` method, the third parameter (`prop`) is always\none of the keys that were in the original payload or in the result of another\nnormalization as `normalizeResponse`.", + "itemtype": "method", + "name": "normalize", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelClass", + "description": "", + "type": "Model" + }, + { + "name": "resourceHash", + "description": "", + "type": "Object" + }, + { + "name": "prop", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "RESTSerializer", + "module": "@ember-data/serializer/rest" + }, + { + "file": "../packages/serializer/src/rest.js", + "line": 171, + "description": "Normalizes an array of resource payloads and returns a JSON-API Document\nwith primary data and, if any, included data as `{ data, included }`.", + "itemtype": "method", + "name": "_normalizeArray", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "modelName", + "description": "", + "type": "String" + }, + { + "name": "arrayHash", + "description": "", + "type": "Object" + }, + { + "name": "prop", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "access": "private", + "tagname": "", + "class": "RESTSerializer", + "module": "@ember-data/serializer/rest" + }, + { + "file": "../packages/serializer/src/rest.js", + "line": 222, + "itemtype": "method", + "name": "_normalizeResponse", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "primaryModelClass", + "description": "", + "type": "Model" + }, + { + "name": "payload", + "description": "", + "type": "Object" + }, + { + "name": "id", + "description": "", + "type": "String|Number" + }, + { + "name": "requestType", + "description": "", + "type": "String" + }, + { + "name": "isSingle", + "description": "", + "type": "Boolean" + } + ], + "return": { + "description": "JSON-API Document", + "type": "Object" + }, + "access": "private", + "tagname": "", + "class": "RESTSerializer", + "module": "@ember-data/serializer/rest" + }, + { + "file": "../packages/serializer/src/rest.js", + "line": 364, + "description": "This method allows you to push a payload containing top-level\ncollections of records organized per type.\n\n```js\n{\n \"posts\": [{\n \"id\": \"1\",\n \"title\": \"Rails is omakase\",\n \"author\", \"1\",\n \"comments\": [ \"1\" ]\n }],\n \"comments\": [{\n \"id\": \"1\",\n \"body\": \"FIRST\"\n }],\n \"users\": [{\n \"id\": \"1\",\n \"name\": \"@d2h\"\n }]\n}\n```\n\nIt will first normalize the payload, so you can use this to push\nin data streaming in from your server structured the same way\nthat fetches and saves are structured.", + "itemtype": "method", + "name": "pushPayload", + "access": "public", + "tagname": "", + "params": [ + { + "name": "store", + "description": "", + "type": "Store" + }, + { + "name": "payload", + "description": "", + "type": "Object" + } + ], + "class": "RESTSerializer", + "module": "@ember-data/serializer/rest" + }, + { + "file": "../packages/serializer/src/rest.js", + "line": 425, + "description": "This method is used to convert each JSON root key in the payload\ninto a modelName that it can use to look up the appropriate model for\nthat part of the payload.\n\nFor example, your server may send a model name that does not correspond with\nthe name of the model in your app. Let's take a look at an example model,\nand an example payload:\n\n```app/models/post.js\nimport Model from '@ember-data/model';\n\nexport default class Post extends Model {}\n```\n\n```javascript\n {\n \"blog/post\": {\n \"id\": \"1\n }\n }\n```\n\nEmber Data is going to normalize the payload's root key for the modelName. As a result,\nit will try to look up the \"blog/post\" model. Since we don't have a model called \"blog/post\"\n(or a file called app/models/blog/post.js in ember-cli), Ember Data will throw an error\nbecause it cannot find the \"blog/post\" model.\n\nSince we want to remove this namespace, we can define a serializer for the application that will\nremove \"blog/\" from the payload key whenver it's encountered by Ember Data:\n\n```app/serializers/application.js\nimport RESTSerializer from '@ember-data/serializer/rest';\n\nexport default class ApplicationSerializer extends RESTSerializer {\n modelNameFromPayloadKey(payloadKey) {\n if (payloadKey === 'blog/post') {\n return super.modelNameFromPayloadKey(payloadKey.replace('blog/', ''));\n } else {\n return super.modelNameFromPayloadKey(payloadKey);\n }\n }\n}\n```\n\nAfter refreshing, Ember Data will appropriately look up the \"post\" model.\n\nBy default the modelName for a model is its\nname in dasherized form. This means that a payload key like \"blogPost\" would be\nnormalized to \"blog-post\" when Ember Data looks up the model. Usually, Ember Data\ncan use the correct inflection to do this for you. Most of the time, you won't\nneed to override `modelNameFromPayloadKey` for this purpose.", + "itemtype": "method", + "name": "modelNameFromPayloadKey", + "access": "public", + "tagname": "", + "params": [ + { + "name": "key", + "description": "", + "type": "String" + } + ], + "return": { + "description": "the model's modelName", + "type": "String" + }, + "class": "RESTSerializer", + "module": "@ember-data/serializer/rest" + }, + { + "file": "../packages/serializer/src/rest.js", + "line": 489, + "itemtype": "method", + "description": "Called when a record is saved in order to convert the\nrecord into JSON.\n\nBy default, it creates a JSON object with a key for\neach attribute and belongsTo relationship.\n\nFor example, consider this model:\n\n```app/models/comment.js\nimport Model, { attr, belongsTo } from '@ember-data/model';\n\nexport default class Comment extends Model {\n @attr body\n @belongsto('user') author\n}\n```\n\nThe default serialization would create a JSON object like:\n\n```js\n{\n \"title\": \"Rails is unagi\",\n \"body\": \"Rails? Omakase? O_O\",\n \"author\": 12\n}\n```\n\nBy default, attributes are passed through as-is, unless\nyou specified an attribute type (`attr('date')`). If\nyou specify a transform, the JavaScript value will be\nserialized when inserted into the JSON hash.\n\nBy default, belongs-to relationships are converted into\nIDs when inserted into the JSON hash.\n\n## IDs\n\n`serialize` takes an options hash with a single option:\n`includeId`. If this option is `true`, `serialize` will,\nby default include the ID in the JSON object it builds.\n\nThe adapter passes in `includeId: true` when serializing\na record for `createRecord`, but not for `updateRecord`.\n\n## Customization\n\nYour server may expect a different JSON format than the\nbuilt-in serialization format.\n\nIn that case, you can implement `serialize` yourself and\nreturn a JSON hash of your choosing.\n\n```app/serializers/post.js\nimport RESTSerializer from '@ember-data/serializer/rest';\n\nexport default class ApplicationSerializer extends RESTSerializer {\n serialize(snapshot, options) {\n let json = {\n POST_TTL: snapshot.attr('title'),\n POST_BDY: snapshot.attr('body'),\n POST_CMS: snapshot.hasMany('comments', { ids: true })\n };\n\n if (options.includeId) {\n json.POST_ID_ = snapshot.id;\n }\n\n return json;\n }\n}\n```\n\n## Customizing an App-Wide Serializer\n\nIf you want to define a serializer for your entire\napplication, you'll probably want to use `eachAttribute`\nand `eachRelationship` on the record.\n\n```app/serializers/application.js\nimport RESTSerializer from '@ember-data/serializer/rest';\nimport { pluralize } from '/utils/string-utils';\n\nexport default class ApplicationSerializer extends RESTSerializer {\n serialize(snapshot, options) {\n let json = {};\n\n snapshot.eachAttribute(function(name) {\n json[serverAttributeName(name)] = snapshot.attr(name);\n });\n\n snapshot.eachRelationship(function(name, relationship) {\n if (relationship.kind === 'hasMany') {\n json[serverHasManyName(name)] = snapshot.hasMany(name, { ids: true });\n }\n });\n\n if (options.includeId) {\n json.ID_ = snapshot.id;\n }\n\n return json;\n }\n}\n\nfunction serverAttributeName(attribute) {\n return attribute.underscore().toUpperCase();\n}\n\nfunction serverHasManyName(name) {\n return serverAttributeName(singularize(name)) + \"_IDS\";\n}\n```\n\nThis serializer will generate JSON that looks like this:\n\n```js\n{\n \"TITLE\": \"Rails is omakase\",\n \"BODY\": \"Yep. Omakase.\",\n \"COMMENT_IDS\": [ 1, 2, 3 ]\n}\n```\n\n## Tweaking the Default JSON\n\nIf you just want to do some small tweaks on the default JSON,\nyou can call super first and make the tweaks on the returned\nJSON.\n\n```app/serializers/post.js\nimport RESTSerializer from '@ember-data/serializer/rest';\n\nexport default class ApplicationSerializer extends RESTSerializer {\n serialize(snapshot, options) {\n let json = super.serialize(snapshot, options);\n\n json.subject = json.title;\n delete json.title;\n\n return json;\n }\n}\n```\n", + "name": "serialize", + "access": "public", + "tagname": "", + "params": [ + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "json", + "type": "Object" + }, + "class": "RESTSerializer", + "module": "@ember-data/serializer/rest" + }, + { + "file": "../packages/serializer/src/rest.js", + "line": 646, + "description": "You can use this method to customize the root keys serialized into the JSON.\nThe hash property should be modified by reference (possibly using something like _.extend)\nBy default the REST Serializer sends the modelName of a model, which is a camelized\nversion of the name.\n\nFor example, your server may expect underscored root objects.\n\n```app/serializers/application.js\nimport RESTSerializer from '@ember-data/serializer/rest';\nimport { decamelize } from '/utils/string-utils';\n\nexport default class ApplicationSerializer extends RESTSerializer {\n serializeIntoHash(data, type, record, options) {\n let root = decamelize(type.modelName);\n data[root] = this.serialize(record, options);\n }\n}\n```", + "itemtype": "method", + "name": "serializeIntoHash", + "access": "public", + "tagname": "", + "params": [ + { + "name": "hash", + "description": "", + "type": "Object" + }, + { + "name": "typeClass", + "description": "", + "type": "Model" + }, + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "RESTSerializer", + "module": "@ember-data/serializer/rest" + }, + { + "file": "../packages/serializer/src/rest.js", + "line": 678, + "description": "You can use `payloadKeyFromModelName` to override the root key for an outgoing\nrequest. By default, the RESTSerializer returns a camelized version of the\nmodel's name.\n\nFor a model called TacoParty, its `modelName` would be the string `taco-party`. The RESTSerializer\nwill send it to the server with `tacoParty` as the root key in the JSON payload:\n\n```js\n{\n \"tacoParty\": {\n \"id\": \"1\",\n \"location\": \"Matthew Beale's House\"\n }\n}\n```\n\nFor example, your server may expect dasherized root objects:\n\n```app/serializers/application.js\nimport RESTSerializer from '@ember-data/serializer/rest';\nimport { dasherize } from '/utils/string-utils';\n\nexport default class ApplicationSerializer extends RESTSerializer {\n payloadKeyFromModelName(modelName) {\n return dasherize(modelName);\n }\n}\n```\n\nGiven a `TacoParty` model, calling `save` on it would produce an outgoing\nrequest like:\n\n```js\n{\n \"taco-party\": {\n \"id\": \"1\",\n \"location\": \"Matthew Beale's House\"\n }\n}\n```", + "itemtype": "method", + "name": "payloadKeyFromModelName", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "String" + }, + "class": "RESTSerializer", + "module": "@ember-data/serializer/rest" + }, + { + "file": "../packages/serializer/src/rest.js", + "line": 729, + "description": "You can use this method to customize how polymorphic objects are serialized.\nBy default the REST Serializer creates the key by appending `Type` to\nthe attribute and value from the model's camelcased model name.", + "itemtype": "method", + "name": "serializePolymorphicType", + "access": "public", + "tagname": "", + "params": [ + { + "name": "snapshot", + "description": "", + "type": "Snapshot" + }, + { + "name": "json", + "description": "", + "type": "Object" + }, + { + "name": "relationship", + "description": "", + "type": "Object" + } + ], + "class": "RESTSerializer", + "module": "@ember-data/serializer/rest" + }, + { + "file": "../packages/serializer/src/rest.js", + "line": 752, + "description": "You can use this method to customize how a polymorphic relationship should\nbe extracted.", + "itemtype": "method", + "name": "extractPolymorphicRelationship", + "access": "public", + "tagname": "", + "params": [ + { + "name": "relationshipType", + "description": "", + "type": "Object" + }, + { + "name": "relationshipHash", + "description": "", + "type": "Object" + }, + { + "name": "relationshipOptions", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "RESTSerializer", + "module": "@ember-data/serializer/rest" + }, + { + "file": "../packages/store/src/-private/caches/identifier-cache.ts", + "line": 257, + "description": "Internal hook to allow management of merge conflicts with identifiers.\n\nwe allow late binding of this private internal merge so that\nthe cache can insert itself here to handle elimination of duplicates", + "itemtype": "method", + "name": "__configureMerge", + "access": "private", + "tagname": "", + "class": "IdentifierCache", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/caches/identifier-cache.ts", + "line": 274, + "itemtype": "method", + "name": "_getRecordIdentifier", + "access": "private", + "tagname": "", + "class": "IdentifierCache", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/caches/identifier-cache.ts", + "line": 353, + "description": "allows us to peek without generating when needed\nuseful for the \"create\" case when we need to see if\nwe are accidentally overwritting something", + "itemtype": "method", + "name": "peekRecordIdentifier", + "params": [ + { + "name": "resource", + "description": "" + } + ], + "return": { + "description": "", + "type": "StableRecordIdentifier | undefined" + }, + "access": "private", + "tagname": "", + "class": "IdentifierCache", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/caches/identifier-cache.ts", + "line": 367, + "description": "Returns the DocumentIdentifier for the given Request, creates one if it does not yet exist.\nReturns `null` if the request does not have a `cacheKey` or `url`.", + "itemtype": "method", + "name": "getOrCreateDocumentIdentifier", + "params": [ + { + "name": "request", + "description": "" + } + ], + "return": { + "description": "", + "type": "StableDocumentIdentifier | null" + }, + "access": "public", + "tagname": "", + "class": "IdentifierCache", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/caches/identifier-cache.ts", + "line": 401, + "description": "Returns the Identifier for the given Resource, creates one if it does not yet exist.\n\nSpecifically this means that we:\n\n- validate the `id` `type` and `lid` combo against known identifiers\n- return an object with an `lid` that is stable (repeated calls with the same\n `id` + `type` or `lid` will return the same `lid` value)\n- this referential stability of the object itself is guaranteed", + "itemtype": "method", + "name": "getOrCreateRecordIdentifier", + "params": [ + { + "name": "resource", + "description": "" + } + ], + "return": { + "description": "", + "type": "StableRecordIdentifier" + }, + "access": "public", + "tagname": "", + "class": "IdentifierCache", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/caches/identifier-cache.ts", + "line": 420, + "description": "Returns a new Identifier for the supplied data. Call this method to generate\nan identifier when a new resource is being created local to the client and\npotentially does not have an `id`.\n\nDelegates generation to the user supplied `GenerateMethod` if one has been provided\nwith the signature `generateMethod({ type }, 'record')`.", + "itemtype": "method", + "name": "createIdentifierForNewRecord", + "params": [ + { + "name": "data", + "description": "" + } + ], + "return": { + "description": "", + "type": "StableRecordIdentifier" + }, + "access": "public", + "tagname": "", + "class": "IdentifierCache", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/caches/identifier-cache.ts", + "line": 458, + "description": "Provides the opportunity to update secondary lookup tables for existing identifiers\nCalled after an identifier created with `createIdentifierForNewRecord` has been\ncommitted.\n\nAssigned `id` to an `Identifier` if `id` has not previously existed; however,\nattempting to change the `id` or calling update without providing an `id` when\none is missing will throw an error.\n\n - sets `id` (if `id` was previously `null`)\n - `lid` and `type` MUST NOT be altered post creation\n\n If a merge occurs, it is possible the returned identifier does not match the originally\n provided identifier. In this case the abandoned identifier will go through the usual\n `forgetRecordIdentifier` codepaths.", + "itemtype": "method", + "name": "updateRecordIdentifier", + "params": [ + { + "name": "identifierObject", + "description": "" + }, + { + "name": "data", + "description": "" + } + ], + "return": { + "description": "", + "type": "StableRecordIdentifier" + }, + "access": "public", + "tagname": "", + "class": "IdentifierCache", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/caches/identifier-cache.ts", + "line": 548, + "itemtype": "method", + "name": "_mergeRecordIdentifiers", + "access": "private", + "tagname": "", + "class": "IdentifierCache", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/caches/identifier-cache.ts", + "line": 576, + "description": "Provides the opportunity to eliminate an identifier from secondary lookup tables\nas well as eliminates it from ember-data's own lookup tables and book keeping.\n\nUseful when a record has been deleted and the deletion has been persisted and\nwe do not care about the record anymore. Especially useful when an `id` of a\ndeleted record might be reused later for a new record.", + "itemtype": "method", + "name": "forgetRecordIdentifier", + "params": [ + { + "name": "identifierObject", + "description": "" + } + ], + "access": "public", + "tagname": "", + "class": "IdentifierCache", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/caches/instance-cache.ts", + "line": 34, + "description": "Retrieves the unique referentially-stable [RecordIdentifier](/ember-data/release/classes/StableRecordIdentifier)\nassigned to the given record instance.\n```js\nimport { recordIdentifierFor } from \"@ember-data/store\";\n// ... gain access to a record, for instance with peekRecord or findRecord\nconst record = store.peekRecord(\"user\", \"1\");\n// get the identifier for the record (see docs for StableRecordIdentifier)\nconst identifier = recordIdentifierFor(record);\n// access the identifier's properties.\nconst { id, type, lid } = identifier;\n```", + "itemtype": "method", + "name": "recordIdentifierFor", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "record", + "description": "a record instance previously obstained from the store.", + "type": "Object" + } + ], + "return": { + "description": "", + "type": "StableRecordIdentifier" + }, + "class": "@ember-data/store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/legacy-model-support/record-reference.ts", + "line": 55, + "description": "The `id` of the record that this reference refers to.\n\nTogether, the `type` and `id` properties form a composite key for\nthe identity map.\n\nExample\n\n```javascript\nlet userRef = store.getReference('user', 1);\n\nuserRef.id(); // '1'\n```", + "itemtype": "method", + "name": "id", + "access": "public", + "tagname": "", + "return": { + "description": "The id of the record.", + "type": "String" + }, + "class": "RecordReference", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/legacy-model-support/record-reference.ts", + "line": 78, + "description": "The `identifier` of the record that this reference refers to.\n\nTogether, the `type` and `id` properties form a composite key for\nthe identity map.\n\nExample\n\n```javascript\nlet userRef = store.getReference('user', 1);\n\nuserRef.identifier(); // '1'\n```", + "itemtype": "method", + "name": "identifier", + "access": "public", + "tagname": "", + "return": { + "description": "The identifier of the record.", + "type": "String" + }, + "class": "RecordReference", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/legacy-model-support/record-reference.ts", + "line": 100, + "description": "How the reference will be looked up when it is loaded. Currently\nthis always returns `identity` to signify that a record will be\nloaded by its `type` and `id`.\n\nExample\n\n```javascript\nconst userRef = store.getReference('user', 1);\n\nuserRef.remoteType(); // 'identity'\n```", + "itemtype": "method", + "name": "remoteType", + "access": "public", + "tagname": "", + "return": { + "description": "'identity'", + "type": "String" + }, + "class": "RecordReference", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/legacy-model-support/record-reference.ts", + "line": 121, + "description": "This API allows you to provide a reference with new data. The\nsimplest usage of this API is similar to `store.push`: you provide a\nnormalized hash of data and the object represented by the reference\nwill update.\n\nIf you pass a promise to `push`, Ember Data will not ask the adapter\nfor the data if another attempt to fetch it is made in the\ninterim. When the promise resolves, the underlying object is updated\nwith the new data, and the promise returned by *this function* is resolved\nwith that object.\n\nFor example, `recordReference.push(promise)` will be resolved with a\nrecord.\n\n Example\n\n ```javascript\n let userRef = store.getReference('user', 1);\n\n // provide data for reference\n userRef.push({\n data: {\n id: \"1\",\n type: \"user\",\n attributes: {\n username: \"@user\"\n }\n }\n }).then(function(user) {\n userRef.value() === user;\n });\n ```", + "itemtype": "method", + "name": "push", + "access": "public", + "tagname": "", + "params": [ + { + "name": "objectOrPromise", + "description": "a JSON:API ResourceDocument or a promise resolving to one" + } + ], + "return": { + "description": "a promise for the value (record or relationship)" + }, + "class": "RecordReference", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/legacy-model-support/record-reference.ts", + "line": 167, + "description": "If the entity referred to by the reference is already loaded, it is\npresent as `reference.value`. Otherwise the value returned by this function\nis `null`.\n\n Example\n\n ```javascript\n let userRef = store.getReference('user', 1);\n\n userRef.value(); // user\n ```", + "itemtype": "method", + "name": "value", + "access": "public", + "tagname": "", + "return": { + "description": "the record for this RecordReference", + "type": "Model" + }, + "class": "RecordReference", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/legacy-model-support/record-reference.ts", + "line": 188, + "description": "Triggers a fetch for the backing entity based on its `remoteType`\n(see `remoteType` definitions per reference type).\n\nExample\n\n```javascript\nlet userRef = store.getReference('user', 1);\n\n// load user (via store.find)\nuserRef.load().then(...)\n```", + "itemtype": "method", + "name": "load", + "access": "public", + "tagname": "", + "return": { + "description": "the record for this RecordReference", + "type": "Promise" + }, + "class": "RecordReference", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/legacy-model-support/record-reference.ts", + "line": 213, + "description": "Reloads the record if it is already loaded. If the record is not\nloaded it will load the record via `store.findRecord`\n\nExample\n\n```javascript\nlet userRef = store.getReference('user', 1);\n\n// or trigger a reload\nuserRef.reload().then(...)\n```", + "itemtype": "method", + "name": "reload", + "access": "public", + "tagname": "", + "return": { + "description": "the record for this RecordReference", + "type": "Promise" + }, + "class": "RecordReference", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 51, + "description": "Cache the response to a request\n\nUnlike `store.push` which has UPSERT\nsemantics, `put` has `replace` semantics similar to\nthe `http` method `PUT`\n\nthe individually cacheabl\ne resource data it may contain\nshould upsert, but the document data surrounding it should\nfully replace any existing information\n\nNote that in order to support inserting arbitrary data\nto the cache that did not originate from a request `put`\nshould expect to sometimes encounter a document with only\na `content` member and therefor must not assume the existence\nof `request` and `response` on the document.", + "itemtype": "method", + "name": "put", + "params": [ + { + "name": "doc", + "description": "", + "type": "StructuredDocument" + } + ], + "return": { + "description": "", + "type": "ResourceDocument" + }, + "access": "public", + "tagname": "", + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 78, + "description": "Perform an operation on the cache to update the remote state.\n\nNote: currently the only valid operation is a MergeOperation\nwhich occurs when a collision of identifiers is detected.", + "itemtype": "method", + "name": "patch", + "access": "public", + "tagname": "", + "params": [ + { + "name": "op", + "description": "the operation to perform" + } + ], + "return": { + "description": "", + "type": "Void" + }, + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 93, + "description": "Update resource data with a local mutation. Currently supports operations\non relationships only.", + "itemtype": "method", + "name": "mutate", + "access": "public", + "tagname": "", + "params": [ + { + "name": "mutation", + "description": "" + } + ], + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 105, + "description": "Peek resource data from the Cache.\n\nIn development, if the return value\nis JSON the return value\nwill be deep-cloned and deep-frozen\nto prevent mutation thereby enforcing cache\nImmutability.\n\nThis form of peek is useful for implementations\nthat want to feed raw-data from cache to the UI\nor which want to interact with a blob of data\ndirectly from the presentation cache.\n\nAn implementation might want to do this because\nde-referencing records which read from their own\nblob is generally safer because the record does\nnot require retainining connections to the Store\nand Cache to present data on a per-field basis.\n\nThis generally takes the place of `getAttr` as\nan API and may even take the place of `getRelationship`\ndepending on implementation specifics, though this\nlatter usage is less recommended due to the advantages\nof the Graph handling necessary entanglements and\nnotifications for relational data.", + "itemtype": "method", + "name": "peek", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "", + "type": "StableRecordIdentifier | StableDocumentIdentifier" + } + ], + "return": { + "description": "the known resource data", + "type": "ResourceDocument | ResourceBlob | null" + }, + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 143, + "description": "Peek the Cache for the existing request data associated with\na cacheable request", + "itemtype": "method", + "name": "peekRequest", + "params": [ + { + "name": "UNKNOWN", + "description": "", + "type": "StableDocumentIdentifier" + } + ], + "return": { + "description": "", + "type": "StableDocumentIdentifier | null" + }, + "access": "public", + "tagname": "", + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 156, + "description": "Push resource data from a remote source into the cache for this identifier", + "itemtype": "method", + "name": "upsert", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "data", + "description": "" + }, + { + "name": "hasRecord", + "description": "" + } + ], + "return": { + "description": "if `hasRecord` is true then calculated key changes should be returned", + "type": "Void | string[]" + }, + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 173, + "description": "Create a fork of the cache from the current state.\n\nApplications should typically not call this method themselves,\npreferring instead to fork at the Store level, which will\nutilize this method to fork the cache.", + "itemtype": "method", + "name": "fork", + "access": "public", + "tagname": "", + "return": { + "description": "Promise" + }, + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 188, + "description": "Merge a fork back into a parent Cache.\n\nApplications should typically not call this method themselves,\npreferring instead to merge at the Store level, which will\nutilize this method to merge the caches.", + "itemtype": "method", + "name": "merge", + "params": [ + { + "name": "cache", + "description": "", + "type": "Cache" + } + ], + "access": "public", + "tagname": "", + "return": { + "description": "Promise" + }, + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 204, + "description": "Generate the list of changes applied to all\nrecord in the store.\n\nEach individual resource or document that has\nbeen mutated should be described as an individual\n`Change` entry in the returned array.\n\nA `Change` is described by an object containing up to\nthree properties: (1) the `identifier` of the entity that\nchanged; (2) the `op` code of that change being one of\n`upsert` or `remove`, and if the op is `upsert` a `patch`\ncontaining the data to merge into the cache for the given\nentity.\n\nThis `patch` is opaque to the Store but should be understood\nby the Cache and may expect to be utilized by an Adapter\nwhen generating data during a `save` operation.\n\nIt is generally recommended that the `patch` contain only\nthe updated state, ignoring fields that are unchanged\n\n```ts\ninterface Change {\n identifier: StableRecordIdentifier | StableDocumentIdentifier;\n op: 'upsert' | 'remove';\n patch?: unknown;\n}\n```", + "itemtype": "method", + "name": "diff", + "access": "public", + "tagname": "", + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 244, + "description": "Serialize the entire contents of the Cache into a Stream\nwhich may be fed back into a new instance of the same Cache\nvia `cache.hydrate`.", + "itemtype": "method", + "name": "dump", + "return": { + "description": "", + "type": "Promise" + }, + "access": "public", + "tagname": "", + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 257, + "description": "hydrate a Cache from a Stream with content previously serialized\nfrom another instance of the same Cache, resolving when hydration\nis complete.\n\nThis method should expect to be called both in the context of restoring\nthe Cache during application rehydration after SSR **AND** at unknown\ntimes during the lifetime of an already booted application when it is\ndesired to bulk-load additional information into the cache. This latter\nbehavior supports optimizing pre/fetching of data for route transitions\nvia data-only SSR modes.", + "itemtype": "method", + "name": "hydrate", + "params": [ + { + "name": "stream", + "description": "", + "type": "ReadableStream" + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "access": "public", + "tagname": "", + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 284, + "description": "[LIFECYLCE] Signal to the cache that a new record has been instantiated on the client\n\nIt returns properties from options that should be set on the record during the create\nprocess. This return value behavior is deprecated.", + "itemtype": "method", + "name": "clientDidCreate", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "options", + "description": "" + } + ], + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 299, + "description": "[LIFECYCLE] Signals to the cache that a resource\nwill be part of a save transaction.", + "itemtype": "method", + "name": "willCommit", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 311, + "description": "[LIFECYCLE] Signals to the cache that a resource\nwas successfully updated as part of a save transaction.", + "itemtype": "method", + "name": "didCommit", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "data", + "description": "" + } + ], + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 324, + "description": "[LIFECYCLE] Signals to the cache that a resource\nwas update via a save transaction failed.", + "itemtype": "method", + "name": "commitWasRejected", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "errors", + "description": "" + } + ], + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 337, + "description": "[LIFECYCLE] Signals to the cache that all data for a resource\nshould be cleared.", + "itemtype": "method", + "name": "unloadRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 352, + "description": "Retrieve the data for an attribute from the cache", + "itemtype": "method", + "name": "getAttr", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "propertyName", + "description": "" + } + ], + "return": { + "description": "", + "type": "Unknown" + }, + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 365, + "description": "Mutate the data for an attribute in the cache", + "itemtype": "method", + "name": "setAttr", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "propertyName", + "description": "" + }, + { + "name": "value", + "description": "" + } + ], + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 378, + "description": "Query the cache for the changed attributes of a resource.", + "itemtype": "method", + "name": "changedAttrs", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "return": { + "description": "" + }, + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 390, + "description": "Query the cache for whether any mutated attributes exist", + "itemtype": "method", + "name": "hasChangedAttrs", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 402, + "description": "Tell the cache to discard any uncommitted mutations to attributes", + "itemtype": "method", + "name": "rollbackAttrs", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "return": { + "description": "the names of attributes that were restored" + }, + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 417, + "description": "Query the cache for the changes to relationships of a resource.\n\nReturns a map of relationship names to RelationshipDiff objects.\n\n```ts\ntype RelationshipDiff =\n | {\n kind: 'collection';\n remoteState: StableRecordIdentifier[];\n additions: Set;\n removals: Set;\n localState: StableRecordIdentifier[];\n reordered: boolean;\n }\n | {\n kind: 'resource';\n remoteState: StableRecordIdentifier | null;\n localState: StableRecordIdentifier | null;\n };\n ```", + "itemtype": "method", + "name": "changedRelationships", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "", + "type": "StableRecordIdentifier" + } + ], + "return": { + "description": "", + "type": "Map" + }, + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 448, + "description": "Query the cache for whether any mutated attributes exist", + "itemtype": "method", + "name": "hasChangedRelationships", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "", + "type": "StableRecordIdentifier" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 460, + "description": "Tell the cache to discard any uncommitted mutations to relationships.\n\nThis will also discard the change on any appropriate inverses.\n\nThis method is a candidate to become a mutation", + "itemtype": "method", + "name": "rollbackRelationships", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "", + "type": "StableRecordIdentifier" + } + ], + "return": { + "description": "the names of relationships that were restored", + "type": "String[]" + }, + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 476, + "description": "Query the cache for the current state of a relationship property", + "itemtype": "method", + "name": "getRelationship", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "propertyName", + "description": "" + } + ], + "return": { + "description": "resource relationship object" + }, + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 495, + "description": "Update the cache state for the given resource to be marked as locally deleted,\nor remove such a mark.", + "itemtype": "method", + "name": "setIsDeleted", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "isDeleted", + "description": "" + } + ], + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 508, + "description": "Query the cache for any validation errors applicable to the given resource.", + "itemtype": "method", + "name": "getErrors", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "return": { + "description": "" + }, + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 520, + "description": "Query the cache for whether a given resource has any available data", + "itemtype": "method", + "name": "isEmpty", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 532, + "description": "Query the cache for whether a given resource was created locally and not\nyet persisted.", + "itemtype": "method", + "name": "isNew", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 545, + "description": "Query the cache for whether a given resource is marked as deleted (but not\nnecessarily persisted yet).", + "itemtype": "method", + "name": "isDeleted", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/cache-manager.ts", + "line": 558, + "description": "Query the cache for whether a given resource has been deleted and that deletion\nhas also been persisted.", + "itemtype": "method", + "name": "isDeletionCommitted", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "" + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "CacheManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/notification-manager.ts", + "line": 102, + "description": "Subscribe to changes for a given resource identifier, resource addition/removal, or document addition/removal.\n\n```ts\nexport type CacheOperation = 'added' | 'removed' | 'updated' | 'state';\n\nexport interface NotificationCallback {\n (identifier: StableRecordIdentifier, notificationType: 'attributes' | 'relationships', key?: string): void;\n (identifier: StableRecordIdentifier, notificationType: 'errors' | 'meta' | 'identity' | 'state'): void;\n (identifier: StableRecordIdentifier, notificationType: NotificationType, key?: string): void;\n}\nexport interface ResourceOperationCallback {\n // resource updates\n (identifier: StableRecordIdentifier, notificationType: CacheOperation): void;\n}\nexport interface DocumentOperationCallback {\n // document updates\n (identifier: StableDocumentIdentifier, notificationType: CacheOperation): void;\n}\n```", + "itemtype": "method", + "name": "subscribe", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "", + "type": "StableDocumentIdentifier | StableRecordIdentifier | 'resource' | 'document'" + }, + { + "name": "callback", + "description": "", + "type": "NotificationCallback | ResourceOperationCallback | DocumentOperationCallback" + } + ], + "return": { + "description": "an opaque token to be used with unsubscribe", + "type": "UnsubscribeToken" + }, + "class": "NotificationManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/notification-manager.ts", + "line": 157, + "description": "remove a previous subscription", + "itemtype": "method", + "name": "unsubscribe", + "access": "public", + "tagname": "", + "params": [ + { + "name": "token", + "description": "", + "type": "UnsubscribeToken" + } + ], + "class": "NotificationManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/managers/notification-manager.ts", + "line": 170, + "description": "Custom Caches and Application Code should not call this method directly.", + "itemtype": "method", + "name": "notify", + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "value", + "description": "" + }, + { + "name": "key", + "description": "" + } + ], + "return": { + "description": "whether a notification was delivered to any subscribers", + "type": "Boolean" + }, + "access": "private", + "tagname": "", + "class": "NotificationManager", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/network/request-cache.ts", + "line": 167, + "description": "Subscribe to requests for a given resource identity.\n\nThe callback will receive the current state of the request.\n\n```ts\ninterface RequestState {\n state: 'pending' | 'fulfilled' | 'rejected';\n type: 'query' | 'mutation';\n request: Request;\n response?: { data: unknown };\n}\n```\n\nNote: It should be considered dangerous to use this API for more than simple\nstate derivation or debugging. The `request` and `response` properties are poorly\nspec'd and may change unexpectedly when shifting what Handlers are in use or how\nrequests are issued from the Store.\n\nWe expect to revisit this API in the near future as we continue to refine the\nRequestManager ergonomics, as a simpler but more powerful direct integration\nwith the RequestManager for these purposes is likely to be a better long-term\ndesign.", + "itemtype": "method", + "name": "subscribeForRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "", + "type": "StableRecordIdentifier" + }, + { + "name": "callback", + "description": "", + "type": "(state: RequestState) => void" + } + ], + "class": "RequestStateService", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/network/request-cache.ts", + "line": 205, + "description": "Retrieve all active requests for a given resource identity.", + "itemtype": "method", + "name": "getPendingRequestsForRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "", + "type": "StableRecordIdentifier" + } + ], + "return": { + "description": "an array of request states for any pending requests for the given identifier", + "type": "RequestState[]" + }, + "class": "RequestStateService", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/network/request-cache.ts", + "line": 217, + "description": "Retrieve the last completed request for a given resource identity.", + "itemtype": "method", + "name": "getLastRequestForRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "identifier", + "description": "", + "type": "StableRecordIdentifier" + } + ], + "return": { + "description": "the state of the most recent request for the given identifier", + "type": "RequestState | null" + }, + "class": "RequestStateService", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/record-arrays/identifier-array.ts", + "line": 173, + "description": "The flag to signal a `RecordArray` is currently loading data.\nExample\n```javascript\nlet people = store.peekAll('person');\npeople.isUpdating; // false\npeople.update();\npeople.isUpdating; // true\n```", + "itemtype": "property", + "name": "isUpdating", + "access": "public", + "tagname": "", + "type": "Boolean", + "class": "RecordArray", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/record-arrays/identifier-array.ts", + "line": 202, + "description": "The store that created this record array.", + "itemtype": "property", + "name": "store", + "access": "private", + "tagname": "", + "type": "Store", + "class": "RecordArray", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/record-arrays/identifier-array.ts", + "line": 441, + "description": "Used to get the latest version of all of the records in this array\nfrom the adapter.\n\nExample\n\n```javascript\nlet people = store.peekAll('person');\npeople.isUpdating; // false\n\npeople.update().then(function() {\n people.isUpdating; // false\n});\n\npeople.isUpdating; // true\n```", + "itemtype": "method", + "name": "update", + "access": "public", + "tagname": "", + "class": "RecordArray", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/record-arrays/identifier-array.ts", + "line": 492, + "description": "Saves all of the records in the `RecordArray`.\n\nExample\n\n```javascript\nlet messages = store.peekAll('message');\nmessages.forEach(function(message) {\n message.hasBeenSeen = true;\n});\nmessages.save();\n```", + "itemtype": "method", + "name": "save", + "access": "public", + "tagname": "", + "return": { + "description": "promise", + "type": "Promise" + }, + "class": "RecordArray", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 105, + "description": "Provides access to the NotificationManager associated\nwith this Store instance.\n\nThe NotificationManager can be used to subscribe to\nchanges to the cache.", + "itemtype": "property", + "name": "notifications", + "type": "NotificationManager", + "access": "public", + "tagname": "", + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 117, + "description": "Provides access to the SchemaService instance\nfor this Store instance.\n\nThe SchemaService can be used to query for\ninformation about the schema of a resource.", + "itemtype": "property", + "name": "schema", + "type": "SchemaService", + "access": "public", + "tagname": "", + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 132, + "description": "Provides access to the IdentifierCache instance\nfor this store.\n\nThe IdentifierCache can be used to generate or\nretrieve a stable unique identifier for any resource.", + "itemtype": "property", + "name": "identifierCache", + "type": "IdentifierCache", + "access": "public", + "tagname": "", + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 143, + "description": "Provides access to the requestManager instance associated\nwith this Store instance.\n\nWhen using `ember-data` this property is automatically\nset to an instance of `RequestManager`. When not using `ember-data`\nyou must configure this property yourself, either by declaring\nit as a service or by initializing it.\n\n```ts\nimport Store, { CacheHandler } from '@ember-data/store';\nimport RequestManager from '@ember-data/request';\nimport Fetch from '@ember/data/request/fetch';\n\nclass extends Store {\n constructor() {\n super(...arguments);\n this.requestManager = new RequestManager();\n this.requestManager.use([Fetch]);\n this.requestManager.useCache(CacheHandler);\n }\n}\n```", + "access": "public", + "tagname": "", + "itemtype": "property", + "name": "requestManager", + "type": "RequestManager", + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 172, + "description": "A Property which an App may set to provide a Lifetimes Service\nto control when a cached request becomes stale.\n\nNote, when defined, these methods will only be invoked if a\ncache key exists for the request, either because the request\ncontains `cacheOptions.key` or because the [IdentifierCache](/ember-data/release/classes/IdentifierCache)\nwas able to generate a key for the request using the configured\n[generation method](/ember-data/release/functions/@ember-data%2Fstore/setIdentifierGenerationMethod).\n\n`isSoftExpired` will only be invoked if `isHardExpired` returns `false`.\n\n```ts\nstore.lifetimes = {\n // make the request and ignore the current cache state\n isHardExpired(identifier: StableDocumentIdentifier): boolean {\n return false;\n }\n\n // make the request in the background if true, return cache state\n isSoftExpired(identifier: StableDocumentIdentifier): boolean {\n return false;\n }\n}\n```", + "access": "public", + "tagname": "", + "itemtype": "property", + "name": "lifetimes", + "type": "LivetimesService|undefined", + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 235, + "itemtype": "method", + "name": "init", + "access": "private", + "tagname": "", + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 309, + "description": "Retrieve the RequestStateService instance\nassociated with this Store.\n\nThis can be used to query the status of requests\nthat have been initiated for a given identifier.", + "itemtype": "method", + "name": "getRequestStateService", + "return": { + "description": "", + "type": "RequestStateService" + }, + "access": "public", + "tagname": "", + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 341, + "description": "Issue a request via the configured RequestManager,\ninserting the response into the cache and handing\nback a Future which resolves to a ResponseDocument\n\nResource data is always updated in the cache.\n\nOnly GET requests have the request result and document\ncached by default when a cache key is present.\n\nThe cache key used is `requestConfig.cacheOptions.key`\nif present, falling back to `requestconfig.url`.\n\nParams are not serialized as part of the cache-key, so\neither ensure they are already in the url or utilize\n`requestConfig.cacheOptions.key`. For queries issued\nvia the `POST` method `requestConfig.cacheOptions.key`\nMUST be supplied for the document to be cached.", + "itemtype": "method", + "name": "request", + "params": [ + { + "name": "requestConfig", + "description": "", + "type": "StoreRequestInput" + } + ], + "return": { + "description": "", + "type": "Future" + }, + "access": "public", + "tagname": "", + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 428, + "description": "A hook which an app or addon may implement. Called when\nthe Store is attempting to create a Record Instance for\na resource.\n\nThis hook can be used to select or instantiate any desired\nmechanism of presentating cache data to the ui for access\nmutation, and interaction.", + "itemtype": "method", + "name": "instantiateRecord (hook)", + "params": [ + { + "name": "identifier", + "description": "" + }, + { + "name": "createRecordArgs", + "description": "" + }, + { + "name": "recordDataFor", + "description": "deprecated use this.cache" + }, + { + "name": "notificationManager", + "description": "deprecated use this.notifications" + } + ], + "return": { + "description": "A record instance" + }, + "access": "public", + "tagname": "", + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 446, + "description": "A hook which an app or addon may implement. Called when\nthe Store is destroying a Record Instance. This hook should\nbe used to teardown any custom record instances instantiated\nwith `instantiateRecord`.", + "itemtype": "method", + "name": "teardownRecord (hook)", + "access": "public", + "tagname": "", + "params": [ + { + "name": "record", + "description": "" + } + ], + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 457, + "description": "Provides access to the SchemaDefinitionService instance\nfor this Store instance.\n\nThe SchemaDefinitionService can be used to query for\ninformation about the schema of a resource.", + "itemtype": "method", + "name": "getSchemaDefinitionService", + "access": "public", + "tagname": "", + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 472, + "description": "DEPRECATED - Use `registerSchema` instead.\n\nAllows an app to register a custom SchemaService\nfor use when information about a resource's schema needs\nto be queried.\n\nThis method can only be called more than once, but only one schema\ndefinition service may exist. Therefore if you wish to chain services\nyou must lookup the existing service and close over it with the new\nservice by accessing `store.schema` prior to registration.\n\nFor Example:\n\n```ts\nimport Store from '@ember-data/store';\n\nclass SchemaDelegator {\n constructor(schema) {\n this._schema = schema;\n }\n\n doesTypeExist(type: string): boolean {\n if (AbstractSchemas.has(type)) {\n return true;\n }\n return this._schema.doesTypeExist(type);\n }\n\n attributesDefinitionFor(identifier: RecordIdentifier | { type: string }): AttributesSchema {\n return this._schema.attributesDefinitionFor(identifier);\n }\n\n relationshipsDefinitionFor(identifier: RecordIdentifier | { type: string }): RelationshipsSchema {\n const schema = AbstractSchemas.get(identifier.type);\n return schema || this._schema.relationshipsDefinitionFor(identifier);\n }\n}\n\nexport default class extends Store {\n constructor(...args) {\n super(...args);\n\n const schema = this.schema;\n this.registerSchemaDefinitionService(new SchemaDelegator(schema));\n }\n}\n```", + "itemtype": "method", + "name": "registerSchemaDefinitionService", + "params": [ + { + "name": "schema", + "description": "", + "type": "SchemaService" + } + ], + "deprecated": true, + "access": "public", + "tagname": "", + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 529, + "description": "Allows an app to register a custom SchemaService\nfor use when information about a resource's schema needs\nto be queried.\n\nThis method can only be called more than once, but only one schema\ndefinition service may exist. Therefore if you wish to chain services\nyou must lookup the existing service and close over it with the new\nservice by accessing `store.schema` prior to registration.\n\nFor Example:\n\n```ts\nimport Store from '@ember-data/store';\n\nclass SchemaDelegator {\n constructor(schema) {\n this._schema = schema;\n }\n\n doesTypeExist(type: string): boolean {\n if (AbstractSchemas.has(type)) {\n return true;\n }\n return this._schema.doesTypeExist(type);\n }\n\n attributesDefinitionFor(identifier: RecordIdentifier | { type: string }): AttributesSchema {\n return this._schema.attributesDefinitionFor(identifier);\n }\n\n relationshipsDefinitionFor(identifier: RecordIdentifier | { type: string }): RelationshipsSchema {\n const schema = AbstractSchemas.get(identifier.type);\n return schema || this._schema.relationshipsDefinitionFor(identifier);\n }\n}\n\nexport default class extends Store {\n constructor(...args) {\n super(...args);\n\n const schema = this.schema;\n this.registerSchema(new SchemaDelegator(schema));\n }\n}\n```", + "itemtype": "method", + "name": "registerSchema", + "params": [ + { + "name": "schema", + "description": "", + "type": "SchemaService" + } + ], + "access": "public", + "tagname": "", + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 584, + "description": "Returns the schema for a particular `modelName`.\n\nWhen used with Model from @ember-data/model the return is the model class,\nbut this is not guaranteed.\n\nIf looking to query attribute or relationship information it is\nrecommended to use `getSchemaDefinitionService` instead. This method\nshould be considered legacy and exists primarily to continue to support\nAdapter/Serializer APIs which expect it's return value in their method\nsignatures.\n\nThe class of a model might be useful if you want to get a list of all the\nrelationship names of the model, see\n[`relationshipNames`](/ember-data/release/classes/Model?anchor=relationshipNames)\nfor example.", + "itemtype": "method", + "name": "modelFor", + "access": "public", + "tagname": "", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "ModelSchema" + }, + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 621, + "description": "Create a new record in the current store. The properties passed\nto this method are set on the newly created record.\n\nTo create a new instance of a `Post`:\n\n```js\nstore.createRecord('post', {\n title: 'Ember is awesome!'\n});\n```\n\nTo create a new instance of a `Post` that has a relationship with a `User` record:\n\n```js\nlet user = this.store.peekRecord('user', 1);\nstore.createRecord('post', {\n title: 'Ember is awesome!',\n user: user\n});\n```", + "itemtype": "method", + "name": "createRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelName", + "description": "", + "type": "String" + }, + { + "name": "inputProperties", + "description": "a hash of properties to set on the\n newly created record.", + "type": "Object" + } + ], + "return": { + "description": "record", + "type": "Model" + }, + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 709, + "description": "For symmetry, a record can be deleted via the store.\n\nExample\n\n```javascript\nlet post = store.createRecord('post', {\n title: 'Ember is awesome!'\n});\n\nstore.deleteRecord(post);\n```", + "itemtype": "method", + "name": "deleteRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "record", + "description": "", + "type": "Model" + } + ], + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 743, + "description": "For symmetry, a record can be unloaded via the store.\nThis will cause the record to be destroyed and freed up for garbage collection.\n\nExample\n\n```javascript\nstore.findRecord('post', 1).then(function(post) {\n store.unloadRecord(post);\n});\n```", + "itemtype": "method", + "name": "unloadRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "record", + "description": "", + "type": "Model" + } + ], + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 769, + "description": "This method returns a record for a given identifier or type and id combination.\n\nThe `findRecord` method will always resolve its promise with the same\nobject for a given identifier or type and `id`.\n\nThe `findRecord` method will always return a **promise** that will be\nresolved with the record.\n\n**Example 1**\n\n```app/routes/post.js\nimport Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n model({ post_id }) {\n return this.store.findRecord('post', post_id);\n }\n}\n```\n\n**Example 2**\n\n`findRecord` can be called with a single identifier argument instead of the combination\nof `type` (modelName) and `id` as separate arguments. You may recognize this combo as\nthe typical pairing from [JSON:API](https://jsonapi.org/format/#document-resource-object-identification)\n\n```app/routes/post.js\nimport Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n model({ post_id: id }) {\n return this.store.findRecord({ type: 'post', id });\n }\n}\n```\n\n**Example 3**\n\nIf you have previously received an lid via an Identifier for this record, and the record\nhas already been assigned an id, you can find the record again using just the lid.\n\n```app/routes/post.js\nstore.findRecord({ lid });\n```\n\nIf the record is not yet available, the store will ask the adapter's `findRecord`\nmethod to retrieve and supply the necessary data. If the record is already present\nin the store, it depends on the reload behavior _when_ the returned promise\nresolves.\n\n### Preloading\n\nYou can optionally `preload` specific attributes and relationships that you know of\nby passing them via the passed `options`.\n\nFor example, if your Ember route looks like `/posts/1/comments/2` and your API route\nfor the comment also looks like `/posts/1/comments/2` if you want to fetch the comment\nwithout also fetching the post you can pass in the post to the `findRecord` call:\n\n```app/routes/post-comments.js\nimport Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n model({ post_id, comment_id: id }) {\n return this.store.findRecord({ type: 'comment', id, { preload: { post: post_id }} });\n }\n}\n```\n\nIn your adapter you can then access this id without triggering a network request via the\nsnapshot:\n\n```app/adapters/application.js\nimport EmberObject from '@ember/object';\n\nexport default class Adapter extends EmberObject {\n\n findRecord(store, schema, id, snapshot) {\n let type = schema.modelName;\n\n if (type === 'comment')\n let postId = snapshot.belongsTo('post', { id: true });\n\n return fetch(`./posts/${postId}/comments/${id}`)\n .then(response => response.json())\n }\n }\n}\n```\n\nThis could also be achieved by supplying the post id to the adapter via the adapterOptions\nproperty on the options hash.\n\n```app/routes/post-comments.js\nimport Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n model({ post_id, comment_id: id }) {\n return this.store.findRecord({ type: 'comment', id, { adapterOptions: { post: post_id }} });\n }\n}\n```\n\n```app/adapters/application.js\nimport EmberObject from '@ember/object';\n\nexport default class Adapter extends EmberObject {\n\n findRecord(store, schema, id, snapshot) {\n let type = schema.modelName;\n\n if (type === 'comment')\n let postId = snapshot.adapterOptions.post;\n\n return fetch(`./posts/${postId}/comments/${id}`)\n .then(response => response.json())\n }\n }\n}\n```\n\nIf you have access to the post model you can also pass the model itself to preload:\n\n```javascript\nlet post = await store.findRecord('post', 1);\nlet comment = await store.findRecord('comment', 2, { post: myPostModel });\n```\n\n### Reloading\n\nThe reload behavior is configured either via the passed `options` hash or\nthe result of the adapter's `shouldReloadRecord`.\n\nIf `{ reload: true }` is passed or `adapter.shouldReloadRecord` evaluates\nto `true`, then the returned promise resolves once the adapter returns\ndata, regardless if the requested record is already in the store:\n\n```js\nstore.push({\n data: {\n id: 1,\n type: 'post',\n revision: 1\n }\n});\n\n// adapter#findRecord resolves with\n// [\n// {\n// id: 1,\n// type: 'post',\n// revision: 2\n// }\n// ]\nstore.findRecord('post', 1, { reload: true }).then(function(post) {\n post.revision; // 2\n});\n```\n\nIf no reload is indicated via the above mentioned ways, then the promise\nimmediately resolves with the cached version in the store.\n\n### Background Reloading\n\nOptionally, if `adapter.shouldBackgroundReloadRecord` evaluates to `true`,\nthen a background reload is started, which updates the records' data, once\nit is available:\n\n```js\n// app/adapters/post.js\nimport ApplicationAdapter from \"./application\";\n\nexport default class PostAdapter extends ApplicationAdapter {\n shouldReloadRecord(store, snapshot) {\n return false;\n },\n\n shouldBackgroundReloadRecord(store, snapshot) {\n return true;\n }\n});\n\n// ...\n\nstore.push({\n data: {\n id: 1,\n type: 'post',\n revision: 1\n }\n});\n\nlet blogPost = store.findRecord('post', 1).then(function(post) {\n post.revision; // 1\n});\n\n// later, once adapter#findRecord resolved with\n// [\n// {\n// id: 1,\n// type: 'post',\n// revision: 2\n// }\n// ]\n\nblogPost.revision; // 2\n```\n\nIf you would like to force or prevent background reloading, you can set a\nboolean value for `backgroundReload` in the options object for\n`findRecord`.\n\n```app/routes/post/edit.js\nimport Route from '@ember/routing/route';\n\nexport default class PostEditRoute extends Route {\n model(params) {\n return this.store.findRecord('post', params.post_id, { backgroundReload: false });\n }\n}\n```\n\nIf you pass an object on the `adapterOptions` property of the options\nargument it will be passed to your adapter via the snapshot\n\n```app/routes/post/edit.js\nimport Route from '@ember/routing/route';\n\nexport default class PostEditRoute extends Route {\n model(params) {\n return this.store.findRecord('post', params.post_id, {\n adapterOptions: { subscribe: false }\n });\n }\n}\n```\n\n```app/adapters/post.js\nimport MyCustomAdapter from './custom-adapter';\n\nexport default class PostAdapter extends MyCustomAdapter {\n findRecord(store, type, id, snapshot) {\n if (snapshot.adapterOptions.subscribe) {\n // ...\n }\n // ...\n }\n}\n```\n\nSee [peekRecord](../methods/peekRecord?anchor=peekRecord) to get the cached version of a record.\n\n### Retrieving Related Model Records\n\nIf you use an adapter such as Ember's default\n[`JSONAPIAdapter`](/ember-data/release/classes/JSONAPIAdapter)\nthat supports the [JSON API specification](http://jsonapi.org/) and if your server\nendpoint supports the use of an\n['include' query parameter](http://jsonapi.org/format/#fetching-includes),\nyou can use `findRecord()` or `findAll()` to automatically retrieve additional records related to\nthe one you request by supplying an `include` parameter in the `options` object.\n\nFor example, given a `post` model that has a `hasMany` relationship with a `comment`\nmodel, when we retrieve a specific post we can have the server also return that post's\ncomments in the same request:\n\n```app/routes/post.js\nimport Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n model(params) {\n return this.store.findRecord('post', params.post_id, { include: 'comments' });\n }\n}\n```\n\n```app/adapters/application.js\nimport EmberObject from '@ember/object';\n\nexport default class Adapter extends EmberObject {\n\n findRecord(store, schema, id, snapshot) {\n let type = schema.modelName;\n\n if (type === 'post')\n let includes = snapshot.adapterOptions.include;\n\n return fetch(`./posts/${postId}?include=${includes}`)\n .then(response => response.json())\n }\n }\n}\n```\n\nIn this case, the post's comments would then be available in your template as\n`model.comments`.\n\nMultiple relationships can be requested using an `include` parameter consisting of a\ncomma-separated list (without white-space) while nested relationships can be specified\nusing a dot-separated sequence of relationship names. So to request both the post's\ncomments and the authors of those comments the request would look like this:\n\n```app/routes/post.js\nimport Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n model(params) {\n return this.store.findRecord('post', params.post_id, { include: 'comments,comments.author' });\n }\n}\n```\n\n### Retrieving Specific Fields by Type\n\nIf your server endpoint supports the use of a ['fields' query parameter](https://jsonapi.org/format/#fetching-sparse-fieldsets),\nyou can use pass those fields through to your server. At this point in time, this requires a few manual steps on your part.\n\n1. Implement `buildQuery` in your adapter.\n\n```app/adapters/application.js\nbuildQuery(snapshot) {\n let query = super.buildQuery(...arguments);\n\n let { fields } = snapshot.adapterOptions;\n\n if (fields) {\n query.fields = fields;\n }\n\n return query;\n}\n```\n\n2. Then pass through the applicable fields to your `findRecord` request.\n\nGiven a `post` model with attributes body, title, publishDate and meta, you can retrieve a filtered list of attributes.\n\n```app/routes/post.js\nimport Route from '@ember/routing/route';\nexport default Route.extend({\n model(params) {\n return this.store.findRecord('post', params.post_id, { adapterOptions: { fields: { post: 'body,title' } });\n }\n});\n```\n\nMoreover, you can filter attributes on related models as well. If a `post` has a `belongsTo` relationship to a user,\njust include the relationship key and attributes.\n\n```app/routes/post.js\nimport Route from '@ember/routing/route';\nexport default Route.extend({\n model(params) {\n return this.store.findRecord('post', params.post_id, { adapterOptions: { fields: { post: 'body,title', user: 'name,email' } });\n }\n});\n```", + "since": "1.13.0", + "itemtype": "method", + "name": "findRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelName", + "description": "- either a string representing the modelName or a ResourceIdentifier object containing both the type (a string) and the id (a string) for the record or an lid (a string) of an existing record", + "type": "String|object" + }, + { + "name": "id", + "description": "- optional object with options for the request only if the first param is a ResourceIdentifier, else the string id of the record to be retrieved", + "type": "(String|Integer|Object)" + }, + { + "name": "options", + "description": "- if the first param is a string this will be the optional options for the request. See examples for available options.", + "type": "Object", + "optional": true + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 1192, + "description": "Get the reference for the specified record.\n\nExample\n\n```javascript\nlet userRef = store.getReference('user', 1);\n\n// check if the user is loaded\nlet isLoaded = userRef.value() !== null;\n\n// get the record of the reference (null if not yet available)\nlet user = userRef.value();\n\n// get the identifier of the reference\nif (userRef.remoteType() === 'id') {\nlet id = userRef.id();\n}\n\n// load user (via store.find)\nuserRef.load().then(...)\n\n// or trigger a reload\nuserRef.reload().then(...)\n\n// provide data for reference\nuserRef.push({ id: 1, username: '@user' }).then(function(user) {\n userRef.value() === user;\n});\n```", + "itemtype": "method", + "name": "getReference", + "access": "public", + "tagname": "", + "params": [ + { + "name": "resource", + "description": "- modelName (string) or Identifier (object)", + "type": "String|object" + }, + { + "name": "id", + "description": "", + "type": "String|Integer" + } + ], + "since": "2.5.0", + "return": { + "description": "", + "type": "RecordReference" + }, + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 1255, + "description": "Get a record by a given type and ID without triggering a fetch.\n\nThis method will synchronously return the record if it is available in the store,\notherwise it will return `null`. A record is available if it has been fetched earlier, or\npushed manually into the store.\n\nSee [findRecord](../methods/findRecord?anchor=findRecord) if you would like to request this record from the backend.\n\n_Note: This is a synchronous method and does not return a promise._\n\n**Example 1**\n\n```js\nlet post = store.peekRecord('post', 1);\n\npost.id; // 1\n```\n\n`peekRecord` can be called with a single identifier argument instead of the combination\nof `type` (modelName) and `id` as separate arguments. You may recognize this combo as\nthe typical pairing from [JSON:API](https://jsonapi.org/format/#document-resource-object-identification)\n\n**Example 2**\n\n```js\nlet post = store.peekRecord({ type: 'post', id });\npost.id; // 1\n```\n\nIf you have previously received an lid from an Identifier for this record, you can lookup the record again using\njust the lid.\n\n**Example 3**\n\n```js\nlet post = store.peekRecord({ lid });\npost.id; // 1\n```", + "since": "1.13.0", + "itemtype": "method", + "name": "peekRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelName", + "description": "- either a string representing the modelName or a ResourceIdentifier object containing both the type (a string) and the id (a string) for the record or an lid (a string) of an existing record", + "type": "String|object" + }, + { + "name": "id", + "description": "- optional only if the first param is a ResourceIdentifier, else the string id of the record to be retrieved.", + "type": "String|Integer" + } + ], + "return": { + "description": "record", + "type": "Model|null" + }, + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 1335, + "description": "This method delegates a query to the adapter. This is the one place where\nadapter-level semantics are exposed to the application.\n\nEach time this method is called a new request is made through the adapter.\n\nExposing queries this way seems preferable to creating an abstract query\nlanguage for all server-side queries, and then require all adapters to\nimplement them.\n\n---\n\nIf you do something like this:\n\n```javascript\nstore.query('person', { page: 1 });\n```\n\nThe request made to the server will look something like this:\n\n```\nGET \"/api/v1/person?page=1\"\n```\n\n---\n\nIf you do something like this:\n\n```javascript\nstore.query('person', { ids: [1, 2, 3] });\n```\n\nThe request made to the server will look something like this:\n\n```\nGET \"/api/v1/person?ids%5B%5D=1&ids%5B%5D=2&ids%5B%5D=3\"\ndecoded: \"/api/v1/person?ids[]=1&ids[]=2&ids[]=3\"\n```\n\nThis method returns a promise, which is resolved with a\n[`Collection`](/ember-data/release/classes/Collection)\nonce the server returns.", + "since": "1.13.0", + "itemtype": "method", + "name": "query", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelName", + "description": "", + "type": "String" + }, + { + "name": "query", + "description": "an opaque query to be used by the adapter", + "type": "Any" + }, + { + "name": "options", + "description": "optional, may include `adapterOptions` hash which will be passed to adapter.query", + "type": "Object" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 1414, + "description": "This method makes a request for one record, where the `id` is not known\nbeforehand (if the `id` is known, use [`findRecord`](../methods/findRecord?anchor=findRecord)\ninstead).\n\nThis method can be used when it is certain that the server will return a\nsingle object for the primary data.\n\nEach time this method is called a new request is made through the adapter.\n\nLet's assume our API provides an endpoint for the currently logged in user\nvia:\n\n```\n// GET /api/current_user\n{\n user: {\n id: 1234,\n username: 'admin'\n }\n}\n```\n\nSince the specific `id` of the `user` is not known beforehand, we can use\n`queryRecord` to get the user:\n\n```javascript\nstore.queryRecord('user', {}).then(function(user) {\n let username = user.username;\n // do thing\n});\n```\n\nThe request is made through the adapters' `queryRecord`:\n\n```app/adapters/user.js\nimport Adapter from '@ember-data/adapter';\nimport $ from 'jquery';\n\nexport default class UserAdapter extends Adapter {\n queryRecord(modelName, query) {\n return $.getJSON('/api/current_user');\n }\n}\n```\n\nNote: the primary use case for `store.queryRecord` is when a single record\nis queried and the `id` is not known beforehand. In all other cases\n`store.query` and using the first item of the array is likely the preferred\nway:\n\n```\n// GET /users?username=unique\n{\n data: [{\n id: 1234,\n type: 'user',\n attributes: {\n username: \"unique\"\n }\n }]\n}\n```\n\n```javascript\nstore.query('user', { username: 'unique' }).then(function(users) {\n return users.firstObject;\n}).then(function(user) {\n let id = user.id;\n});\n```\n\nThis method returns a promise, which resolves with the found record.\n\nIf the adapter returns no data for the primary data of the payload, then\n`queryRecord` resolves with `null`:\n\n```\n// GET /users?username=unique\n{\n data: null\n}\n```\n\n```javascript\nstore.queryRecord('user', { username: 'unique' }).then(function(user) {\n // user is null\n});\n```", + "since": "1.13.0", + "itemtype": "method", + "name": "queryRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelName", + "description": "", + "type": "String" + }, + { + "name": "query", + "description": "an opaque query to be used by the adapter", + "type": "Any" + }, + { + "name": "options", + "description": "optional, may include `adapterOptions` hash which will be passed to adapter.queryRecord", + "type": "Object" + } + ], + "return": { + "description": "promise which resolves with the found record or `null`", + "type": "Promise" + }, + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 1536, + "description": "`findAll` asks the adapter's `findAll` method to find the records for the\ngiven type, and returns a promise which will resolve with all records of\nthis type present in the store, even if the adapter only returns a subset\nof them.\n\n```app/routes/authors.js\nimport Route from '@ember/routing/route';\n\nexport default class AuthorsRoute extends Route {\n model(params) {\n return this.store.findAll('author');\n }\n}\n```\n\n_When_ the returned promise resolves depends on the reload behavior,\nconfigured via the passed `options` hash and the result of the adapter's\n`shouldReloadAll` method.\n\n### Reloading\n\nIf `{ reload: true }` is passed or `adapter.shouldReloadAll` evaluates to\n`true`, then the returned promise resolves once the adapter returns data,\nregardless if there are already records in the store:\n\n```js\nstore.push({\n data: {\n id: 'first',\n type: 'author'\n }\n});\n\n// adapter#findAll resolves with\n// [\n// {\n// id: 'second',\n// type: 'author'\n// }\n// ]\nstore.findAll('author', { reload: true }).then(function(authors) {\n authors.getEach('id'); // ['first', 'second']\n});\n```\n\nIf no reload is indicated via the above mentioned ways, then the promise\nimmediately resolves with all the records currently loaded in the store.\n\n### Background Reloading\n\nOptionally, if `adapter.shouldBackgroundReloadAll` evaluates to `true`,\nthen a background reload is started. Once this resolves, the array with\nwhich the promise resolves, is updated automatically so it contains all the\nrecords in the store:\n\n```app/adapters/application.js\nimport Adapter from '@ember-data/adapter';\n\nexport default class ApplicationAdapter extends Adapter {\n shouldReloadAll(store, snapshotsArray) {\n return false;\n },\n\n shouldBackgroundReloadAll(store, snapshotsArray) {\n return true;\n }\n});\n\n// ...\n\nstore.push({\n data: {\n id: 'first',\n type: 'author'\n }\n});\n\nlet allAuthors;\nstore.findAll('author').then(function(authors) {\n authors.getEach('id'); // ['first']\n\n allAuthors = authors;\n});\n\n// later, once adapter#findAll resolved with\n// [\n// {\n// id: 'second',\n// type: 'author'\n// }\n// ]\n\nallAuthors.getEach('id'); // ['first', 'second']\n```\n\nIf you would like to force or prevent background reloading, you can set a\nboolean value for `backgroundReload` in the options object for\n`findAll`.\n\n```app/routes/post/edit.js\nimport Route from '@ember/routing/route';\n\nexport default class PostEditRoute extends Route {\n model() {\n return this.store.findAll('post', { backgroundReload: false });\n }\n}\n```\n\nIf you pass an object on the `adapterOptions` property of the options\nargument it will be passed to you adapter via the `snapshotRecordArray`\n\n```app/routes/posts.js\nimport Route from '@ember/routing/route';\n\nexport default class PostsRoute extends Route {\n model(params) {\n return this.store.findAll('post', {\n adapterOptions: { subscribe: false }\n });\n }\n}\n```\n\n```app/adapters/post.js\nimport MyCustomAdapter from './custom-adapter';\n\nexport default class UserAdapter extends MyCustomAdapter {\n findAll(store, type, sinceToken, snapshotRecordArray) {\n if (snapshotRecordArray.adapterOptions.subscribe) {\n // ...\n }\n // ...\n }\n}\n```\n\nSee [peekAll](../methods/peekAll?anchor=peekAll) to get an array of current records in the\nstore, without waiting until a reload is finished.\n\n### Retrieving Related Model Records\n\nIf you use an adapter such as Ember's default\n[`JSONAPIAdapter`](/ember-data/release/classes/JSONAPIAdapter)\nthat supports the [JSON API specification](http://jsonapi.org/) and if your server\nendpoint supports the use of an\n['include' query parameter](http://jsonapi.org/format/#fetching-includes),\nyou can use `findAll()` to automatically retrieve additional records related to\nthose requested by supplying an `include` parameter in the `options` object.\n\nFor example, given a `post` model that has a `hasMany` relationship with a `comment`\nmodel, when we retrieve all of the post records we can have the server also return\nall of the posts' comments in the same request:\n\n```app/routes/posts.js\nimport Route from '@ember/routing/route';\n\nexport default class PostsRoute extends Route {\n model() {\n return this.store.findAll('post', { include: 'comments' });\n }\n}\n```\nMultiple relationships can be requested using an `include` parameter consisting of a\ncomma-separated list (without white-space) while nested relationships can be specified\nusing a dot-separated sequence of relationship names. So to request both the posts'\ncomments and the authors of those comments the request would look like this:\n\n```app/routes/posts.js\nimport Route from '@ember/routing/route';\n\nexport default class PostsRoute extends Route {\n model() {\n return this.store.findAll('post', { include: 'comments,comments.author' });\n }\n}\n```\n\nSee [query](../methods/query?anchor=query) to only get a subset of records from the server.", + "since": "1.13.0", + "itemtype": "method", + "name": "findAll", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "promise", + "type": "Promise" + }, + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 1746, + "description": "This method returns a filtered array that contains all of the\nknown records for a given type in the store.\n\nNote that because it's just a filter, the result will contain any\nlocally created records of the type, however, it will not make a\nrequest to the backend to retrieve additional records. If you\nwould like to request all the records from the backend please use\n[store.findAll](../methods/findAll?anchor=findAll).\n\nAlso note that multiple calls to `peekAll` for a given type will always\nreturn the same `RecordArray`.\n\nExample\n\n```javascript\nlet localPosts = store.peekAll('post');\n```", + "since": "1.13.0", + "itemtype": "method", + "name": "peekAll", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "RecordArray" + }, + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 1785, + "description": "This method unloads all records in the store.\nIt schedules unloading to happen during the next run loop.\n\nOptionally you can pass a type which unload all records for a given type.\n\n```javascript\nstore.unloadAll();\nstore.unloadAll('post');\n```", + "itemtype": "method", + "name": "unloadAll", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelName", + "description": "", + "type": "String" + } + ], + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 1827, + "itemtype": "method", + "description": "Push some data for a given type into the store.\n\nThis method expects normalized [JSON API](http://jsonapi.org/) document. This means you have to follow [JSON API specification](http://jsonapi.org/format/) with few minor adjustments:\n- record's `type` should always be in singular, dasherized form\n- members (properties) should be camelCased\n\n[Your primary data should be wrapped inside `data` property](http://jsonapi.org/format/#document-top-level):\n\n```js\nstore.push({\n data: {\n // primary data for single record of type `Person`\n id: '1',\n type: 'person',\n attributes: {\n firstName: 'Daniel',\n lastName: 'Kmak'\n }\n }\n});\n```\n\n[Demo.](http://ember-twiddle.com/fb99f18cd3b4d3e2a4c7)\n\n`data` property can also hold an array (of records):\n\n```js\nstore.push({\n data: [\n // an array of records\n {\n id: '1',\n type: 'person',\n attributes: {\n firstName: 'Daniel',\n lastName: 'Kmak'\n }\n },\n {\n id: '2',\n type: 'person',\n attributes: {\n firstName: 'Tom',\n lastName: 'Dale'\n }\n }\n ]\n});\n```\n\n[Demo.](http://ember-twiddle.com/69cdbeaa3702159dc355)\n\nThere are some typical properties for `JSONAPI` payload:\n* `id` - mandatory, unique record's key\n* `type` - mandatory string which matches `model`'s dasherized name in singular form\n* `attributes` - object which holds data for record attributes - `attr`'s declared in model\n* `relationships` - object which must contain any of the following properties under each relationships' respective key (example path is `relationships.achievements.data`):\n - [`links`](http://jsonapi.org/format/#document-links)\n - [`data`](http://jsonapi.org/format/#document-resource-object-linkage) - place for primary data\n - [`meta`](http://jsonapi.org/format/#document-meta) - object which contains meta-information about relationship\n\nFor this model:\n\n```app/models/person.js\nimport Model, { attr, hasMany } from '@ember-data/model';\n\nexport default class PersonRoute extends Route {\n @attr('string') lastName;\n @hasmany('person') children;\n}\n```\n\nTo represent the children as IDs:\n\n```js\n{\n data: {\n id: '1',\n type: 'person',\n attributes: {\n firstName: 'Tom',\n lastName: 'Dale'\n },\n relationships: {\n children: {\n data: [\n {\n id: '2',\n type: 'person'\n },\n {\n id: '3',\n type: 'person'\n },\n {\n id: '4',\n type: 'person'\n }\n ]\n }\n }\n }\n}\n```\n\n[Demo.](http://ember-twiddle.com/343e1735e034091f5bde)\n\nTo represent the children relationship as a URL:\n\n```js\n{\n data: {\n id: '1',\n type: 'person',\n attributes: {\n firstName: 'Tom',\n lastName: 'Dale'\n },\n relationships: {\n children: {\n links: {\n related: '/people/1/children'\n }\n }\n }\n }\n}\n```\n\nIf you're streaming data or implementing an adapter, make sure\nthat you have converted the incoming data into this form. The\nstore's [normalize](../methods/normalize?anchor=normalize) method is a convenience\nhelper for converting a json payload into the form Ember Data\nexpects.\n\n```js\nstore.push(store.normalize('person', data));\n```\n\nThis method can be used both to push in brand new\nrecords, as well as to update existing records.\n", + "name": "push", + "access": "public", + "tagname": "", + "params": [ + { + "name": "data", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "the record(s) that was created or\n updated." + }, + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 1999, + "description": "Push some data in the form of a json-api document into the store,\nwithout creating materialized records.", + "itemtype": "method", + "name": "_push", + "access": "private", + "tagname": "", + "params": [ + { + "name": "jsonApiDoc", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "identifiers for the primary records that had data loaded", + "type": "StableRecordIdentifier|Array|null" + }, + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 2039, + "description": "Push some raw data into the store.\n\nThis method can be used both to push in brand new\nrecords, as well as to update existing records. You\ncan push in more than one type of object at once.\nAll objects should be in the format expected by the\nserializer.\n\n```app/serializers/application.js\nimport RESTSerializer from '@ember-data/serializer/rest';\n\nexport default class ApplicationSerializer extends RESTSerializer;\n```\n\n```js\nlet pushData = {\n posts: [\n { id: 1, postTitle: \"Great post\", commentIds: [2] }\n ],\n comments: [\n { id: 2, commentBody: \"Insightful comment\" }\n ]\n}\n\nstore.pushPayload(pushData);\n```\n\nBy default, the data will be deserialized using a default\nserializer (the application serializer if it exists).\n\nAlternatively, `pushPayload` will accept a model type which\nwill determine which serializer will process the payload.\n\n```app/serializers/application.js\nimport RESTSerializer from '@ember-data/serializer/rest';\n\n export default class ApplicationSerializer extends RESTSerializer;\n```\n\n```app/serializers/post.js\nimport JSONSerializer from '@ember-data/serializer/json';\n\nexport default JSONSerializer;\n```\n\n```js\nstore.pushPayload(pushData); // Will use the application serializer\nstore.pushPayload('post', pushData); // Will use the post serializer\n```", + "itemtype": "method", + "name": "pushPayload", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelName", + "description": "Optionally, a model type used to determine which serializer will be used", + "type": "String" + }, + { + "name": "inputPayload", + "description": "", + "type": "Object" + } + ], + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 2112, + "description": "Trigger a save for a Record.", + "itemtype": "method", + "name": "saveRecord", + "access": "public", + "tagname": "", + "params": [ + { + "name": "record", + "description": "", + "type": "RecordInstance" + }, + { + "name": "options", + "description": "" + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 2169, + "description": "Instantiation hook allowing applications or addons to configure the store\nto utilize a custom Cache implementation.\n\nThis hook should not be called directly by consuming applications or libraries.\nUse `Store.cache` to access the Cache instance.", + "itemtype": "method", + "name": "createCache (hook)", + "access": "public", + "tagname": "", + "params": [ + { + "name": "storeWrapper", + "description": "" + } + ], + "return": { + "description": "", + "type": "Cache" + }, + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 2182, + "description": "Returns the cache instance associated to this Store, instantiates the Cache\nif necessary via `Store.createCache`", + "itemtype": "property", + "name": "cache", + "type": "Cache", + "access": "public", + "tagname": "", + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 2200, + "description": "`normalize` converts a json payload into the normalized form that\n[push](../methods/push?anchor=push) expects.\n\nExample\n\n```js\nsocket.on('message', function(message) {\n let modelName = message.model;\n let data = message.data;\n store.push(store.normalize(modelName, data));\n});\n```", + "itemtype": "method", + "name": "normalize", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelName", + "description": "The name of the model type for this payload", + "type": "String" + }, + { + "name": "payload", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "The normalized payload", + "type": "Object" + }, + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 2240, + "description": "Returns an instance of the adapter for a given type. For\nexample, `adapterFor('person')` will return an instance of\nthe adapter located at `app/adapters/person.js`\n\nIf no `person` adapter is found, this method will look\nfor an `application` adapter (the default adapter for\nyour entire application).", + "itemtype": "method", + "name": "adapterFor", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "Adapter" + }, + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/store/src/-private/store-service.ts", + "line": 2298, + "description": "Returns an instance of the serializer for a given type. For\nexample, `serializerFor('person')` will return an instance of\n`App.PersonSerializer`.\n\nIf no `App.PersonSerializer` is found, this method will look\nfor an `App.ApplicationSerializer` (the default serializer for\nyour entire application).\n\nIf a serializer cannot be found on the adapter, it will fall back\nto an instance of `JSONSerializer`.", + "itemtype": "method", + "name": "serializerFor", + "access": "public", + "tagname": "", + "params": [ + { + "name": "modelName", + "description": "the record to serialize", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Serializer" + }, + "class": "Store", + "module": "@ember-data/store" + }, + { + "file": "../packages/tracking/src/-private.ts", + "line": 150, + "description": "Run `method` without subscribing to any tracked properties\ncontrolled by EmberData.\n\nThis should rarely be used except by libraries that really\nknow what they are doing. It is most useful for wrapping\ncertain kinds of fetch/query logic from within a `Resource`\n`hook` or other similar pattern.", + "itemtype": "method", + "name": "untracked", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "method", + "description": "" + } + ], + "return": { + "description": "result of invoking method" + }, + "class": "@ember-data/tracking", + "module": "@ember-data/tracking" + }, + { + "file": "../packages/tracking/src/-private.ts", + "line": 173, + "description": "Run the method, subscribing to any tracked properties\nmanaged by EmberData that were accessed or written during\nthe method's execution as per-normal but while allowing\ninterleaving of reads and writes.\n\nThis is useful when for instance you want to perform\na mutation based on existing state that must be read first.", + "itemtype": "method", + "name": "transact", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "method", + "description": "" + } + ], + "return": { + "description": "result of invoking method" + }, + "class": "@ember-data/tracking", + "module": "@ember-data/tracking" + }, + { + "file": "../packages/tracking/src/-private.ts", + "line": 196, + "description": "A helpful utility for creating a new function that\nalways runs in a transaction. E.G. this \"memoizes\"\ncalling `transact(fn)`, currying args as necessary.", + "itemtype": "method", + "name": "memoTransact", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "method", + "description": "" + } + ], + "return": { + "description": "a function that will invoke method in a transaction with any provided args and return its result" + }, + "class": "@ember-data/tracking", + "module": "@ember-data/tracking" + } + ], + "warnings": [ + { + "message": "replacing incorrect tag: returns with return", + "line": " ../ember-data-types/cache/cache.ts:53" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../ember-data-types/cache/cache.ts:77" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../ember-data-types/cache/cache.ts:91" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../ember-data-types/cache/cache.ts:101" + }, + { + "message": "param name missing: {StableDocumentIdentifier}", + "line": " ../ember-data-types/cache/cache.ts:136" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../ember-data-types/cache/cache.ts:136" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../ember-data-types/cache/cache.ts:147" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../ember-data-types/cache/cache.ts:162" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../ember-data-types/cache/cache.ts:175" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../ember-data-types/cache/cache.ts:227" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../ember-data-types/cache/cache.ts:238" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../ember-data-types/cache/cache.ts:321" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../ember-data-types/cache/cache.ts:345" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../ember-data-types/cache/cache.ts:361" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../ember-data-types/cache/cache.ts:371" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../ember-data-types/cache/cache.ts:383" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../ember-data-types/cache/cache.ts:412" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../ember-data-types/cache/cache.ts:422" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../ember-data-types/cache/cache.ts:436" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../ember-data-types/cache/cache.ts:467" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../ember-data-types/cache/cache.ts:477" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../ember-data-types/cache/cache.ts:487" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../ember-data-types/cache/cache.ts:498" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../ember-data-types/cache/cache.ts:509" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../ember-data-types/q/cache-store-wrapper.ts:73" + }, + { + "message": "unknown tag: recommended", + "line": " ../ember-data-types/q/ember-data-json-api.ts:35" + }, + { + "message": "unknown tag: ignored", + "line": " ../ember-data-types/q/ember-data-json-api.ts:53" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../ember-data-types/q/minimum-serializer-interface.ts:45" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../ember-data-types/q/minimum-serializer-interface.ts:112" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../ember-data-types/q/minimum-serializer-interface.ts:168" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../ember-data-types/q/minimum-serializer-interface.ts:210" + }, + { + "message": "unknown tag: service", + "line": " ../ember-data-types/q/schema-service.ts:8" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../ember-data-types/q/schema-service.ts:59" + }, + { + "message": "unknown tag: attr", + "line": " ../ember-data-types/q/schema-service.ts:69" + }, + { + "message": "unknown tag: attr", + "line": " ../ember-data-types/q/schema-service.ts:69" + }, + { + "message": "unknown tag: attr", + "line": " ../ember-data-types/q/schema-service.ts:69" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../ember-data-types/q/schema-service.ts:69" + }, + { + "message": "unknown tag: belongsto", + "line": " ../ember-data-types/q/schema-service.ts:112" + }, + { + "message": "unknown tag: hasmany", + "line": " ../ember-data-types/q/schema-service.ts:112" + }, + { + "message": "unknown tag: hasmany", + "line": " ../ember-data-types/q/schema-service.ts:112" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../ember-data-types/q/schema-service.ts:112" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/adapter/src/error.js:119" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/adapter/src/error.js:119" + }, + { + "message": "unknown tag: action", + "line": " ../packages/adapter/src/error.js:183" + }, + { + "message": "unknown tag: action", + "line": " ../packages/adapter/src/error.js:230" + }, + { + "message": "unknown tag: service", + "line": " ../packages/adapter/src/error.js:279" + }, + { + "message": "unknown tag: action", + "line": " ../packages/adapter/src/error.js:279" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/adapter/src/rest.ts:1464" + }, + { + "message": "unknown tag: hasmany", + "line": " ../packages/graph/src/-private/-edge-definition.ts:14" + }, + { + "message": "unknown tag: belongsto", + "line": " ../packages/graph/src/-private/-edge-definition.ts:14" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/json-api/src/-private/cache.ts:135" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/json-api/src/-private/cache.ts:319" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/json-api/src/-private/cache.ts:352" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/json-api/src/-private/cache.ts:374" + }, + { + "message": "param name missing: {StableDocumentIdentifier}", + "line": " ../packages/json-api/src/-private/cache.ts:448" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/json-api/src/-private/cache.ts:448" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/json-api/src/-private/cache.ts:461" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/json-api/src/-private/cache.ts:534" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/json-api/src/-private/cache.ts:549" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/json-api/src/-private/cache.ts:605" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/json-api/src/-private/cache.ts:618" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/json-api/src/-private/cache.ts:1012" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/json-api/src/-private/cache.ts:1067" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/json-api/src/-private/cache.ts:1080" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/json-api/src/-private/cache.ts:1097" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/json-api/src/-private/cache.ts:1141" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/json-api/src/-private/cache.ts:1172" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/json-api/src/-private/cache.ts:1184" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/json-api/src/-private/cache.ts:1205" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/json-api/src/-private/cache.ts:1242" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/json-api/src/-private/cache.ts:1254" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/json-api/src/-private/cache.ts:1267" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/json-api/src/-private/cache.ts:1281" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/json-api/src/-private/cache.ts:1295" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/json-api/src/-private/cache.ts:1309" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/json-api/src/-private/cache.ts:1324" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/json-api/src/-private/cache.ts:1342" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/json-api/src/-private/serialize.ts:10" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/json-api/src/-private/serialize.ts:47" + }, + { + "message": "unknown tag: belongsto", + "line": " ../packages/model/src/-private/references/belongs-to.ts:135" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/model/src/-private/references/belongs-to.ts:229" + }, + { + "message": "unknown tag: hasmany", + "line": " ../packages/model/src/-private/references/belongs-to.ts:297" + }, + { + "message": "unknown tag: belongsto", + "line": " ../packages/model/src/-private/references/belongs-to.ts:347" + }, + { + "message": "unknown tag: belongsto", + "line": " ../packages/model/src/-private/references/belongs-to.ts:420" + }, + { + "message": "unknown tag: belongsto", + "line": " ../packages/model/src/-private/references/belongs-to.ts:475" + }, + { + "message": "unknown tag: belongsto", + "line": " ../packages/model/src/-private/references/belongs-to.ts:548" + }, + { + "message": "unknown tag: hasmany", + "line": " ../packages/model/src/-private/references/has-many.ts:154" + }, + { + "message": "unknown tag: hasmany", + "line": " ../packages/model/src/-private/references/has-many.ts:205" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/model/src/-private/references/has-many.ts:294" + }, + { + "message": "unknown tag: hasmany", + "line": " ../packages/model/src/-private/references/has-many.ts:356" + }, + { + "message": "unknown tag: hasmany", + "line": " ../packages/model/src/-private/references/has-many.ts:460" + }, + { + "message": "unknown tag: hasmany", + "line": " ../packages/model/src/-private/references/has-many.ts:518" + }, + { + "message": "unknown tag: hasmany", + "line": " ../packages/model/src/-private/references/has-many.ts:593" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/model/src/-private/attr.js:14" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/model/src/-private/attr.js:14" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/model/src/-private/attr.js:14" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/model/src/-private/attr.js:14" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/model/src/-private/attr.js:14" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/model/src/-private/attr.js:14" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/model/src/-private/attr.js:14" + }, + { + "message": "unknown tag: belongsto", + "line": " ../packages/model/src/-private/belongs-to.js:13" + }, + { + "message": "unknown tag: belongsto", + "line": " ../packages/model/src/-private/belongs-to.js:13" + }, + { + "message": "unknown tag: hasmany", + "line": " ../packages/model/src/-private/belongs-to.js:13" + }, + { + "message": "unknown tag: belongsto", + "line": " ../packages/model/src/-private/belongs-to.js:13" + }, + { + "message": "unknown tag: belongsto", + "line": " ../packages/model/src/-private/belongs-to.js:13" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/model/src/-private/errors.ts:29" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/model/src/-private/errors.ts:29" + }, + { + "message": "unknown tag: action", + "line": " ../packages/model/src/-private/errors.ts:398" + }, + { + "message": "unknown tag: hasmany", + "line": " ../packages/model/src/-private/has-many.js:41" + }, + { + "message": "unknown tag: belongsto", + "line": " ../packages/model/src/-private/has-many.js:41" + }, + { + "message": "unknown tag: hasmany", + "line": " ../packages/model/src/-private/has-many.js:41" + }, + { + "message": "unknown tag: hasmany", + "line": " ../packages/model/src/-private/has-many.js:41" + }, + { + "message": "unknown tag: hasmany", + "line": " ../packages/model/src/-private/has-many.js:41" + }, + { + "message": "unknown tag: belongsto", + "line": " ../packages/model/src/-private/has-many.js:41" + }, + { + "message": "unknown tag: belongsto", + "line": " ../packages/model/src/-private/has-many.js:41" + }, + { + "message": "unknown tag: belongsto", + "line": " ../packages/model/src/-private/has-many.js:41" + }, + { + "message": "unknown tag: belongsto", + "line": " ../packages/model/src/-private/has-many.js:41" + }, + { + "message": "unknown tag: hasmany", + "line": " ../packages/model/src/-private/has-many.js:41" + }, + { + "message": "unknown tag: hasmany", + "line": " ../packages/model/src/-private/has-many.js:41" + }, + { + "message": "unknown tag: hasmany", + "line": " ../packages/model/src/-private/many-array.ts:43" + }, + { + "message": "unknown tag: belongsto", + "line": " ../packages/model/src/-private/many-array.ts:43" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/model/src/-private/model.js:99" + }, + { + "message": "unknown tag: action", + "line": " ../packages/model/src/-private/model.js:644" + }, + { + "message": "unknown tag: action", + "line": " ../packages/model/src/-private/model.js:644" + }, + { + "message": "unknown tag: action", + "line": " ../packages/model/src/-private/model.js:644" + }, + { + "message": "unknown tag: action", + "line": " ../packages/model/src/-private/model.js:684" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/model/src/-private/model.js:772" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/model/src/-private/model.js:772" + }, + { + "message": "unknown tag: action", + "line": " ../packages/model/src/-private/model.js:924" + }, + { + "message": "unknown tag: belongsto", + "line": " ../packages/model/src/-private/model.js:985" + }, + { + "message": "unknown tag: hasmany", + "line": " ../packages/model/src/-private/model.js:1053" + }, + { + "message": "unknown tag: hasmany", + "line": " ../packages/model/src/-private/model.js:1248" + }, + { + "message": "unknown tag: hasmany", + "line": " ../packages/model/src/-private/model.js:1289" + }, + { + "message": "unknown tag: belongsto", + "line": " ../packages/model/src/-private/model.js:1289" + }, + { + "message": "unknown tag: hasmany", + "line": " ../packages/model/src/-private/model.js:1478" + }, + { + "message": "unknown tag: belongsto", + "line": " ../packages/model/src/-private/model.js:1478" + }, + { + "message": "unknown tag: hasmany", + "line": " ../packages/model/src/-private/model.js:1478" + }, + { + "message": "unknown tag: hasmany", + "line": " ../packages/model/src/-private/model.js:1544" + }, + { + "message": "unknown tag: belongsto", + "line": " ../packages/model/src/-private/model.js:1544" + }, + { + "message": "unknown tag: hasmany", + "line": " ../packages/model/src/-private/model.js:1544" + }, + { + "message": "unknown tag: hasmany", + "line": " ../packages/model/src/-private/model.js:1599" + }, + { + "message": "unknown tag: belongsto", + "line": " ../packages/model/src/-private/model.js:1599" + }, + { + "message": "unknown tag: hasmany", + "line": " ../packages/model/src/-private/model.js:1599" + }, + { + "message": "unknown tag: hasmany", + "line": " ../packages/model/src/-private/model.js:1660" + }, + { + "message": "unknown tag: belongsto", + "line": " ../packages/model/src/-private/model.js:1660" + }, + { + "message": "unknown tag: hasmany", + "line": " ../packages/model/src/-private/model.js:1660" + }, + { + "message": "unknown tag: hasmany", + "line": " ../packages/model/src/-private/model.js:1742" + }, + { + "message": "unknown tag: belongsto", + "line": " ../packages/model/src/-private/model.js:1742" + }, + { + "message": "unknown tag: hasmany", + "line": " ../packages/model/src/-private/model.js:1742" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/model/src/-private/model.js:1742" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/model/src/-private/model.js:1878" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/model/src/-private/model.js:1878" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/model/src/-private/model.js:1878" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/model/src/-private/model.js:1942" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/model/src/-private/model.js:1942" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/model/src/-private/model.js:1942" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/model/src/-private/model.js:1999" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/model/src/-private/model.js:1999" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/model/src/-private/model.js:1999" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/model/src/-private/promise-many-array.ts:82" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/model/src/-private/promise-many-array.ts:98" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/model/src/-private/promise-many-array.ts:142" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/model/src/-private/promise-many-array.ts:155" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/model/src/-private/promise-many-array.ts:166" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/model/src/index.ts:1" + }, + { + "message": "unknown tag: belongsto", + "line": " ../packages/model/src/index.ts:1" + }, + { + "message": "unknown tag: hasmany", + "line": " ../packages/model/src/index.ts:1" + }, + { + "message": "unknown tag: until", + "line": " ../packages/private-build-infra/virtual-packages/deprecations.js:91" + }, + { + "message": "unknown tag: until", + "line": " ../packages/private-build-infra/virtual-packages/deprecations.js:125" + }, + { + "message": "unknown tag: until", + "line": " ../packages/private-build-infra/virtual-packages/deprecations.js:149" + }, + { + "message": "unknown tag: until", + "line": " ../packages/private-build-infra/virtual-packages/deprecations.js:166" + }, + { + "message": "unknown tag: until", + "line": " ../packages/private-build-infra/virtual-packages/deprecations.js:185" + }, + { + "message": "unknown tag: hasmany", + "line": " ../packages/private-build-infra/virtual-packages/deprecations.js:228" + }, + { + "message": "unknown tag: belongsto", + "line": " ../packages/private-build-infra/virtual-packages/deprecations.js:228" + }, + { + "message": "unknown tag: until", + "line": " ../packages/private-build-infra/virtual-packages/deprecations.js:228" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/request-utils/src/index.ts:60" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/request-utils/src/index.ts:185" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/request-utils/src/index.ts:338" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/request-utils/src/index.ts:363" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/request-utils/src/index.ts:445" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/request-utils/src/index.ts:488" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/request/src/-private/manager.ts:501" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/request/src/-private/manager.ts:528" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/request/src/-private/manager.ts:562" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/request/src/-private/types.ts:76" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/request/src/-private/types.ts:85" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/request/src/-private/types.ts:94" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/serializer/src/-private/transforms/boolean.js:5" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/serializer/src/-private/transforms/boolean.js:5" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/serializer/src/-private/transforms/boolean.js:5" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/serializer/src/-private/transforms/boolean.js:5" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/serializer/src/-private/transforms/boolean.js:5" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/serializer/src/-private/transforms/boolean.js:5" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/serializer/src/-private/transforms/date.js:5" + }, + { + "message": "unknown tag: belongsto", + "line": " ../packages/serializer/src/-private/transforms/date.js:5" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/serializer/src/-private/transforms/date.js:5" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/serializer/src/-private/transforms/number.js:9" + }, + { + "message": "unknown tag: belongsto", + "line": " ../packages/serializer/src/-private/transforms/number.js:9" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/serializer/src/-private/transforms/number.js:9" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/serializer/src/-private/transforms/string.js:5" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/serializer/src/-private/transforms/string.js:5" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/serializer/src/-private/transforms/string.js:5" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/serializer/src/-private/transforms/transform.js:5" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/serializer/src/-private/transforms/transform.js:5" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/serializer/src/-private/transforms/transform.js:5" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/serializer/src/-private/transforms/transform.js:5" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/serializer/src/json-api.js:13" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/serializer/src/json-api.js:13" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/serializer/src/json-api.js:13" + }, + { + "message": "unknown tag: belongsto", + "line": " ../packages/serializer/src/json-api.js:13" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/serializer/src/json-api.js:13" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/serializer/src/json-api.js:13" + }, + { + "message": "unknown tag: hasmany", + "line": " ../packages/serializer/src/json-api.js:13" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/serializer/src/json-api.js:470" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/serializer/src/json-api.js:470" + }, + { + "message": "unknown tag: belongsto", + "line": " ../packages/serializer/src/json-api.js:470" + }, + { + "message": "unknown tag: hasmany", + "line": " ../packages/serializer/src/json.js:17" + }, + { + "message": "unknown tag: belongsto", + "line": " ../packages/serializer/src/json.js:17" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/serializer/src/json.js:17" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/serializer/src/json.js:120" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/serializer/src/json.js:120" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/serializer/src/json.js:120" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/serializer/src/json.js:120" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/serializer/src/json.js:958" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/serializer/src/json.js:958" + }, + { + "message": "unknown tag: belongsto", + "line": " ../packages/serializer/src/json.js:958" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/serializer/src/rest.js:489" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/serializer/src/rest.js:489" + }, + { + "message": "unknown tag: belongsto", + "line": " ../packages/serializer/src/rest.js:489" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/store/src/-private/caches/identifier-cache.ts:353" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/store/src/-private/caches/identifier-cache.ts:367" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/store/src/-private/caches/identifier-cache.ts:401" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/store/src/-private/caches/identifier-cache.ts:420" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/store/src/-private/caches/identifier-cache.ts:458" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/store/src/-private/caches/instance-cache.ts:34" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/store/src/-private/managers/cache-manager.ts:51" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/store/src/-private/managers/cache-manager.ts:78" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/store/src/-private/managers/cache-manager.ts:105" + }, + { + "message": "param name missing: {StableDocumentIdentifier}", + "line": " ../packages/store/src/-private/managers/cache-manager.ts:143" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/store/src/-private/managers/cache-manager.ts:143" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/store/src/-private/managers/cache-manager.ts:156" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/store/src/-private/managers/cache-manager.ts:173" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/store/src/-private/managers/cache-manager.ts:188" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/store/src/-private/managers/cache-manager.ts:244" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/store/src/-private/managers/cache-manager.ts:257" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/store/src/-private/managers/cache-manager.ts:352" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/store/src/-private/managers/cache-manager.ts:378" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/store/src/-private/managers/cache-manager.ts:390" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/store/src/-private/managers/cache-manager.ts:402" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/store/src/-private/managers/cache-manager.ts:417" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/store/src/-private/managers/cache-manager.ts:448" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/store/src/-private/managers/cache-manager.ts:460" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/store/src/-private/managers/cache-manager.ts:476" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/store/src/-private/managers/cache-manager.ts:508" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/store/src/-private/managers/cache-manager.ts:520" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/store/src/-private/managers/cache-manager.ts:532" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/store/src/-private/managers/cache-manager.ts:545" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/store/src/-private/managers/cache-manager.ts:558" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/store/src/-private/managers/notification-manager.ts:102" + }, + { + "message": "replacing incorrect tag: function with method", + "line": " ../packages/store/src/-private/managers/record-array-manager.ts:22" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/store/src/-private/network/request-cache.ts:205" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/store/src/-private/network/request-cache.ts:217" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/store/src/-private/store-service.ts:309" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/store/src/-private/store-service.ts:341" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/store/src/-private/store-service.ts:428" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/store/src/-private/store-service.ts:1827" + }, + { + "message": "unknown tag: attr", + "line": " ../packages/store/src/-private/store-service.ts:1827" + }, + { + "message": "unknown tag: hasmany", + "line": " ../packages/store/src/-private/store-service.ts:1827" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/store/src/-private/store-service.ts:2112" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/store/src/-private/store-service.ts:2169" + }, + { + "message": "unknown tag: service", + "line": " ../packages/store/src/index.ts:1" + }, + { + "message": "replacing incorrect tag: function with method", + "line": " ../packages/tracking/src/-private.ts:150" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/tracking/src/-private.ts:150" + }, + { + "message": "replacing incorrect tag: function with method", + "line": " ../packages/tracking/src/-private.ts:173" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/tracking/src/-private.ts:173" + }, + { + "message": "replacing incorrect tag: returns with return", + "line": " ../packages/tracking/src/-private.ts:196" + }, + { + "message": "Missing item type\nA hash of changed attributes with the key being the attribute name and the value being an\narray of `[oldValue, newValue]`.", + "line": " ../ember-data-types/q/cache.ts:9" + }, + { + "message": "Missing item type\nServes as a reference to a `Resource` but does not contain\nany data itself.\n\nUsed to establish relationship linkages between `Resources` and\nto address data that may not be available synchronously.\n\n[JSON:API Spec](https://jsonapi.org/format/#document-resource-identifier-objects)", + "line": " ../ember-data-types/q/ember-data-json-api.ts:21" + }, + { + "message": "Missing item type\nWhile not officially part of the `JSON:API` spec,\n`ember-data` allows the use of `lid` as a local\nidentifier for a `Resource`.", + "line": " ../ember-data-types/q/ember-data-json-api.ts:35" + }, + { + "message": "Missing item type\nWhile valid in the `JSON:API` spec,\n`ember-data` ignores `meta` on `ResourceIdentifierObjects`", + "line": " ../ember-data-types/q/ember-data-json-api.ts:53" + }, + { + "message": "Missing item type\nServes as a reference to a resource created on the client\nbut not yet persisted.", + "line": " ../ember-data-types/q/ember-data-json-api.ts:63" + }, + { + "message": "Missing item type\nResources newly created on the client _may_\nnot have an `id` available to them prior\nto completion of their first successful `save`.\n\n`id` will be `null` in this case.", + "line": " ../ember-data-types/q/ember-data-json-api.ts:70" + }, + { + "message": "Missing item type\nResources newly created on the client _will always_\nhave an `lid` assigned immediately and available.", + "line": " ../ember-data-types/q/ember-data-json-api.ts:82" + }, + { + "message": "Missing item type\nContains the data for an existing resource in JSON:API format", + "line": " ../ember-data-types/q/ember-data-json-api.ts:112" + }, + { + "message": "Missing item type\nAn Identifier specific to a record which may or may not\nbe present in the cache.\n\nThe absence of an `id` DOES NOT indicate that this\nIdentifier is for a new client-created record as it\nmay also indicate that it was generated for a secondary\nindex and the primary `id` index is not yet known.", + "line": " ../ember-data-types/q/identifier.ts:33" + }, + { + "message": "Missing item type\nUsed when an Identifier is known to be the stable version", + "line": " ../ember-data-types/q/identifier.ts:46" + }, + { + "message": "Missing item type\nUsed when a StableRecordIdentifier was not created locally as part\nof a call to store.createRecord\n\nDistinguishing between this Identifier and one for a client created\nrecord that was created with an ID is generally speaking not possible\nat runtime, so anything with an ID typically narrows to this.", + "line": " ../ember-data-types/q/identifier.ts:55" + }, + { + "message": "Missing item type\nUsed when a StableRecordIdentifier was created locally\n(by a call to store.createRecord).\n\nIt is possible in rare circumstances to have a StableRecordIdentifier\nthat is not for a new record but does not have an ID. This would\nhappen if a user intentionally created one for use with a secondary-index\nprior to the record having been fully loaded.", + "line": " ../ember-data-types/q/identifier.ts:72" + }, + { + "message": "Missing item type", + "line": " ../ember-data-types/q/record-data-schemas.ts:8" + }, + { + "message": "Missing item type", + "line": " ../ember-data-types/q/record-data-schemas.ts:32" + }, + { + "message": "Missing item type\nThe field name on `this` record", + "line": " ../packages/graph/src/-private/-edge-definition.ts:79" + }, + { + "message": "Missing item type\nThe `type` of the related record", + "line": " ../packages/graph/src/-private/-edge-definition.ts:85" + }, + { + "message": "Missing item type\nThe field name on the opposing record", + "line": " ../packages/graph/src/-private/-edge-definition.ts:98" + }, + { + "message": "Missing item type\nThe `type` of `this` record", + "line": " ../packages/graph/src/-private/-edge-definition.ts:103" + }, + { + "message": "Missing item type\nWhether this relationship points back at the same type.\n\nIf the relationship is polymorphic, this will be true if\nit points back at the same abstract type.", + "line": " ../packages/graph/src/-private/-edge-definition.ts:131" + }, + { + "message": "Missing item type\nIf this is a reflexive relationship, this is true\nif the relationship also points back at the same\nfield.", + "line": " ../packages/graph/src/-private/-edge-definition.ts:141" + }, + { + "message": "Missing item type\nThis method is called by `record.save`, and gets passed a\nresolver for the promise that `record.save` returns.\n\nIt schedules saving to happen at the end of the run loop.", + "line": " ../packages/legacy-compat/src/legacy-network-handler/fetch-manager.ts:74" + }, + { + "message": "Missing item type\nThis is a helper method that validates a JSON API top-level document\n\nThe format of a document is described here:\nhttp://jsonapi.org/format/#document-top-level", + "line": " ../packages/legacy-compat/src/legacy-network-handler/serializer-response.ts:10" + }, + { + "message": "Missing item type\nTag provides a cache for a getter\nthat recomputes only when a specific\ntracked property that it manages is dirtied.\n\nThis allows us to bust the cache for a value\nthat otherwise doesn't access anything tracked\nas well as control the timing of that notification.", + "line": " ../packages/model/src/-private/record-state.ts:24" + }, + { + "message": "Missing item type\nA decorattor that caches a getter while\nproviding the ability to bust that cache\nwhen we so choose in a way that notifies\nglimmer's tracking system.", + "line": " ../packages/model/src/-private/record-state.ts:86" + }, + { + "message": "Missing item type\nHistorically EmberData managed a state machine\nfor each record, the localState for which\nwas reflected onto Model.\n\nThis implements the flags and stateName for backwards compat\nwith the state tree that used to be possible (listed below).\n\nstateName and dirtyType are candidates for deprecation.\n\nroot\n empty\n deleted // hidden from stateName\n preloaded // hidden from stateName\n\n loading\n empty // hidden from stateName\n preloaded // hidden from stateName\n\n loaded\n saved\n updated\n uncommitted\n invalid\n inFlight\n created\n uncommitted\n invalid\n inFlight\n\n deleted\n saved\n new // hidden from stateName\n uncommitted\n invalid\n inFlight", + "line": " ../packages/model/src/-private/record-state.ts:116" + } + ] +} diff --git a/s3-docs/v5.3.0/ember-docs.json b/s3-docs/v5.3.0/ember-docs.json new file mode 100644 index 000000000..9bc0441ff --- /dev/null +++ b/s3-docs/v5.3.0/ember-docs.json @@ -0,0 +1,19739 @@ +{ + "project": { + "name": "The Ember API", + "description": "The Ember API: a framework for building ambitious web applications", + "url": "https://emberjs.com/", + "version": "v5.3.0" + }, + "files": { + "node_modules/rsvp/lib/rsvp/promise/all.js": { + "name": "node_modules/rsvp/lib/rsvp/promise/all.js", + "modules": {}, + "classes": {}, + "fors": { + "Promise": 1 + }, + "namespaces": {} + }, + "node_modules/rsvp/lib/rsvp/promise/race.js": { + "name": "node_modules/rsvp/lib/rsvp/promise/race.js", + "modules": {}, + "classes": {}, + "fors": { + "Promise": 1 + }, + "namespaces": {} + }, + "node_modules/rsvp/lib/rsvp/promise/reject.js": { + "name": "node_modules/rsvp/lib/rsvp/promise/reject.js", + "modules": {}, + "classes": {}, + "fors": { + "Promise": 1 + }, + "namespaces": {} + }, + "node_modules/rsvp/lib/rsvp/promise/resolve.js": { + "name": "node_modules/rsvp/lib/rsvp/promise/resolve.js", + "modules": {}, + "classes": {}, + "fors": { + "Promise": 1 + }, + "namespaces": {} + }, + "node_modules/rsvp/lib/rsvp/all-settled.js": { + "name": "node_modules/rsvp/lib/rsvp/all-settled.js", + "modules": { + "rsvp": 1 + }, + "classes": {}, + "fors": { + "rsvp": 1 + }, + "namespaces": {} + }, + "node_modules/rsvp/lib/rsvp/all.js": { + "name": "node_modules/rsvp/lib/rsvp/all.js", + "modules": {}, + "classes": {}, + "fors": { + "rsvp": 1 + }, + "namespaces": {} + }, + "node_modules/rsvp/lib/rsvp/defer.js": { + "name": "node_modules/rsvp/lib/rsvp/defer.js", + "modules": {}, + "classes": {}, + "fors": { + "rsvp": 1 + }, + "namespaces": {} + }, + "node_modules/rsvp/lib/rsvp/events.js": { + "name": "node_modules/rsvp/lib/rsvp/events.js", + "modules": {}, + "classes": { + "EventTarget": 1 + }, + "fors": { + "rsvp": 1, + "EventTarget": 1 + }, + "namespaces": {} + }, + "node_modules/rsvp/lib/rsvp/filter.js": { + "name": "node_modules/rsvp/lib/rsvp/filter.js", + "modules": {}, + "classes": {}, + "fors": { + "rsvp": 1 + }, + "namespaces": {} + }, + "node_modules/rsvp/lib/rsvp/hash-settled.js": { + "name": "node_modules/rsvp/lib/rsvp/hash-settled.js", + "modules": {}, + "classes": {}, + "fors": { + "rsvp": 1 + }, + "namespaces": {} + }, + "node_modules/rsvp/lib/rsvp/hash.js": { + "name": "node_modules/rsvp/lib/rsvp/hash.js", + "modules": {}, + "classes": {}, + "fors": { + "rsvp": 1 + }, + "namespaces": {} + }, + "node_modules/rsvp/lib/rsvp/map.js": { + "name": "node_modules/rsvp/lib/rsvp/map.js", + "modules": {}, + "classes": {}, + "fors": { + "rsvp": 1 + }, + "namespaces": {} + }, + "node_modules/rsvp/lib/rsvp/node.js": { + "name": "node_modules/rsvp/lib/rsvp/node.js", + "modules": {}, + "classes": {}, + "fors": { + "rsvp": 1 + }, + "namespaces": {} + }, + "node_modules/rsvp/lib/rsvp/promise.js": { + "name": "node_modules/rsvp/lib/rsvp/promise.js", + "modules": {}, + "classes": { + "Promise": 1 + }, + "fors": {}, + "namespaces": {} + }, + "node_modules/rsvp/lib/rsvp/race.js": { + "name": "node_modules/rsvp/lib/rsvp/race.js", + "modules": {}, + "classes": {}, + "fors": { + "rsvp": 1 + }, + "namespaces": {} + }, + "node_modules/rsvp/lib/rsvp/reject.js": { + "name": "node_modules/rsvp/lib/rsvp/reject.js", + "modules": {}, + "classes": {}, + "fors": { + "rsvp": 1 + }, + "namespaces": {} + }, + "node_modules/rsvp/lib/rsvp/resolve.js": { + "name": "node_modules/rsvp/lib/rsvp/resolve.js", + "modules": {}, + "classes": {}, + "fors": { + "rsvp": 1 + }, + "namespaces": {} + }, + "node_modules/rsvp/lib/rsvp/rethrow.js": { + "name": "node_modules/rsvp/lib/rsvp/rethrow.js", + "modules": {}, + "classes": {}, + "fors": { + "rsvp": 1 + }, + "namespaces": {} + }, + "packages/@ember/-internals/container/lib/container.ts": { + "name": "packages/@ember/-internals/container/lib/container.ts", + "modules": {}, + "classes": { + "Container": 1 + }, + "fors": {}, + "namespaces": {} + }, + "packages/@ember/-internals/container/lib/registry.ts": { + "name": "packages/@ember/-internals/container/lib/registry.ts", + "modules": {}, + "classes": { + "Registry": 1 + }, + "fors": {}, + "namespaces": {} + }, + "packages/@ember/-internals/environment/lib/env.ts": { + "name": "packages/@ember/-internals/environment/lib/env.ts", + "modules": {}, + "classes": { + "EmberENV": 1 + }, + "fors": { + "EmberENV": 1 + }, + "namespaces": {} + }, + "packages/@ember/-internals/glimmer/lib/components/abstract-input.ts": { + "name": "packages/@ember/-internals/glimmer/lib/components/abstract-input.ts", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "packages/@ember/-internals/glimmer/lib/components/input.ts": { + "name": "packages/@ember/-internals/glimmer/lib/components/input.ts", + "modules": {}, + "classes": {}, + "fors": { + "Ember.Templates.helpers": 1, + "@ember/component": 1, + "Ember.Templates.components": 1 + }, + "namespaces": {} + }, + "packages/@ember/-internals/glimmer/lib/components/internal.ts": { + "name": "packages/@ember/-internals/glimmer/lib/components/internal.ts", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "packages/@ember/-internals/glimmer/lib/components/link-to.ts": { + "name": "packages/@ember/-internals/glimmer/lib/components/link-to.ts", + "modules": { + "@ember/routing": 1 + }, + "classes": {}, + "fors": { + "Ember.Templates.components": 1, + "Ember.Templates.helpers": 1, + "@ember/routing": 1 + }, + "namespaces": {} + }, + "packages/@ember/-internals/glimmer/lib/components/textarea.ts": { + "name": "packages/@ember/-internals/glimmer/lib/components/textarea.ts", + "modules": {}, + "classes": {}, + "fors": { + "Ember.Templates.components": 1, + "Ember.Templates.helpers": 1, + "@ember/component": 1 + }, + "namespaces": {} + }, + "packages/@ember/-internals/glimmer/lib/helpers/-disallow-dynamic-resolution.ts": { + "name": "packages/@ember/-internals/glimmer/lib/helpers/-disallow-dynamic-resolution.ts", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "packages/@ember/-internals/glimmer/lib/helpers/-resolve.ts": { + "name": "packages/@ember/-internals/glimmer/lib/helpers/-resolve.ts", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "packages/@ember/-internals/glimmer/lib/helpers/-track-array.ts": { + "name": "packages/@ember/-internals/glimmer/lib/helpers/-track-array.ts", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "packages/@ember/-internals/glimmer/lib/helpers/action.ts": { + "name": "packages/@ember/-internals/glimmer/lib/helpers/action.ts", + "modules": {}, + "classes": {}, + "fors": { + "Ember.Templates.helpers": 1 + }, + "namespaces": {} + }, + "packages/@ember/-internals/glimmer/lib/helpers/array.ts": { + "name": "packages/@ember/-internals/glimmer/lib/helpers/array.ts", + "modules": {}, + "classes": {}, + "fors": { + "@ember/helper": 1 + }, + "namespaces": {} + }, + "packages/@ember/-internals/glimmer/lib/helpers/component.ts": { + "name": "packages/@ember/-internals/glimmer/lib/helpers/component.ts", + "modules": {}, + "classes": {}, + "fors": { + "Ember.Templates.helpers": 1 + }, + "namespaces": {} + }, + "packages/@ember/-internals/glimmer/lib/helpers/concat.ts": { + "name": "packages/@ember/-internals/glimmer/lib/helpers/concat.ts", + "modules": {}, + "classes": {}, + "fors": { + "@ember/helper": 1 + }, + "namespaces": {} + }, + "packages/@ember/-internals/glimmer/lib/helpers/each-in.ts": { + "name": "packages/@ember/-internals/glimmer/lib/helpers/each-in.ts", + "modules": {}, + "classes": {}, + "fors": { + "Ember.Templates.helpers": 1 + }, + "namespaces": {} + }, + "packages/@ember/-internals/glimmer/lib/helpers/fn.ts": { + "name": "packages/@ember/-internals/glimmer/lib/helpers/fn.ts", + "modules": {}, + "classes": {}, + "fors": { + "@ember/helper": 1 + }, + "namespaces": {} + }, + "packages/@ember/-internals/glimmer/lib/helpers/get.ts": { + "name": "packages/@ember/-internals/glimmer/lib/helpers/get.ts", + "modules": {}, + "classes": {}, + "fors": { + "@ember/helper": 1 + }, + "namespaces": {} + }, + "packages/@ember/-internals/glimmer/lib/helpers/hash.ts": { + "name": "packages/@ember/-internals/glimmer/lib/helpers/hash.ts", + "modules": {}, + "classes": {}, + "fors": { + "@ember/helper": 1 + }, + "namespaces": {} + }, + "packages/@ember/-internals/glimmer/lib/helpers/helper.ts": { + "name": "packages/@ember/-internals/glimmer/lib/helpers/helper.ts", + "modules": {}, + "classes": {}, + "fors": { + "Ember.Templates.helpers": 1 + }, + "namespaces": {} + }, + "packages/@ember/-internals/glimmer/lib/helpers/if-unless.ts": { + "name": "packages/@ember/-internals/glimmer/lib/helpers/if-unless.ts", + "modules": {}, + "classes": {}, + "fors": { + "Ember.Templates.helpers": 1 + }, + "namespaces": {} + }, + "packages/@ember/-internals/glimmer/lib/helpers/log.ts": { + "name": "packages/@ember/-internals/glimmer/lib/helpers/log.ts", + "modules": {}, + "classes": {}, + "fors": { + "Ember.Templates.helpers": 1 + }, + "namespaces": {} + }, + "packages/@ember/-internals/glimmer/lib/helpers/modifier.ts": { + "name": "packages/@ember/-internals/glimmer/lib/helpers/modifier.ts", + "modules": {}, + "classes": {}, + "fors": { + "Ember.Templates.helpers": 1 + }, + "namespaces": {} + }, + "packages/@ember/-internals/glimmer/lib/helpers/mut.ts": { + "name": "packages/@ember/-internals/glimmer/lib/helpers/mut.ts", + "modules": {}, + "classes": {}, + "fors": { + "Ember.Templates.helpers": 1 + }, + "namespaces": {} + }, + "packages/@ember/-internals/glimmer/lib/helpers/page-title.ts": { + "name": "packages/@ember/-internals/glimmer/lib/helpers/page-title.ts", + "modules": {}, + "classes": {}, + "fors": { + "Ember.Templates.helpers": 1 + }, + "namespaces": {} + }, + "packages/@ember/-internals/glimmer/lib/helpers/readonly.ts": { + "name": "packages/@ember/-internals/glimmer/lib/helpers/readonly.ts", + "modules": {}, + "classes": {}, + "fors": { + "Ember.Templates.helpers": 1 + }, + "namespaces": {} + }, + "packages/@ember/-internals/glimmer/lib/helpers/unbound.ts": { + "name": "packages/@ember/-internals/glimmer/lib/helpers/unbound.ts", + "modules": {}, + "classes": {}, + "fors": { + "Ember.Templates.helpers": 1 + }, + "namespaces": {} + }, + "packages/@ember/-internals/glimmer/lib/helpers/unique-id.ts": { + "name": "packages/@ember/-internals/glimmer/lib/helpers/unique-id.ts", + "modules": {}, + "classes": {}, + "fors": { + "Ember.Templates.helpers": 1 + }, + "namespaces": {} + }, + "packages/@ember/-internals/glimmer/lib/modifiers/on.ts": { + "name": "packages/@ember/-internals/glimmer/lib/modifiers/on.ts", + "modules": {}, + "classes": {}, + "fors": { + "Ember.Templates.helpers": 1 + }, + "namespaces": {} + }, + "packages/@ember/-internals/glimmer/lib/syntax/in-element.ts": { + "name": "packages/@ember/-internals/glimmer/lib/syntax/in-element.ts", + "modules": {}, + "classes": {}, + "fors": { + "Ember.Templates.helpers": 1 + }, + "namespaces": {} + }, + "packages/@ember/-internals/glimmer/lib/syntax/let.ts": { + "name": "packages/@ember/-internals/glimmer/lib/syntax/let.ts", + "modules": {}, + "classes": {}, + "fors": { + "Ember.Templates.helpers": 1 + }, + "namespaces": {} + }, + "packages/@ember/-internals/glimmer/lib/syntax/mount.ts": { + "name": "packages/@ember/-internals/glimmer/lib/syntax/mount.ts", + "modules": {}, + "classes": {}, + "fors": { + "Ember.Templates.helpers": 1 + }, + "namespaces": {} + }, + "packages/@ember/-internals/glimmer/lib/syntax/outlet.ts": { + "name": "packages/@ember/-internals/glimmer/lib/syntax/outlet.ts", + "modules": {}, + "classes": {}, + "fors": { + "Ember.Templates.helpers": 1 + }, + "namespaces": {} + }, + "packages/@ember/-internals/glimmer/lib/utils/curly-component-state-bucket.ts": { + "name": "packages/@ember/-internals/glimmer/lib/utils/curly-component-state-bucket.ts", + "modules": {}, + "classes": { + "ComponentStateBucket": 1 + }, + "fors": {}, + "namespaces": {} + }, + "packages/@ember/-internals/glimmer/lib/utils/managers.ts": { + "name": "packages/@ember/-internals/glimmer/lib/utils/managers.ts", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "packages/@ember/-internals/glimmer/lib/utils/outlet.ts": { + "name": "packages/@ember/-internals/glimmer/lib/utils/outlet.ts", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "packages/@ember/-internals/glimmer/lib/utils/string.ts": { + "name": "packages/@ember/-internals/glimmer/lib/utils/string.ts", + "modules": { + "@ember/template": 1 + }, + "classes": { + "SafeString": 1 + }, + "fors": { + "@ember/template": 1 + }, + "namespaces": {} + }, + "packages/@ember/-internals/glimmer/lib/views/outlet.ts": { + "name": "packages/@ember/-internals/glimmer/lib/views/outlet.ts", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "packages/@ember/-internals/glimmer/lib/component.ts": { + "name": "packages/@ember/-internals/glimmer/lib/component.ts", + "modules": {}, + "classes": { + "Component": 1 + }, + "fors": {}, + "namespaces": {} + }, + "packages/@ember/-internals/glimmer/lib/glimmer-component-docs.ts": { + "name": "packages/@ember/-internals/glimmer/lib/glimmer-component-docs.ts", + "modules": { + "@glimmer/component": 1 + }, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "packages/@ember/-internals/glimmer/lib/glimmer-tracking-docs.ts": { + "name": "packages/@ember/-internals/glimmer/lib/glimmer-tracking-docs.ts", + "modules": { + "@glimmer/tracking": 1 + }, + "classes": {}, + "fors": { + "@glimmer/tracking": 1 + }, + "namespaces": {} + }, + "packages/@ember/-internals/glimmer/lib/helper.ts": { + "name": "packages/@ember/-internals/glimmer/lib/helper.ts", + "modules": {}, + "classes": { + "Helper": 1 + }, + "fors": { + "@ember/component/helper": 1 + }, + "namespaces": {} + }, + "packages/@ember/-internals/glimmer/lib/renderer.ts": { + "name": "packages/@ember/-internals/glimmer/lib/renderer.ts", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "packages/@ember/-internals/glimmer/tests/integration/custom-helper-test.js": { + "name": "packages/@ember/-internals/glimmer/tests/integration/custom-helper-test.js", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "packages/@ember/-internals/glimmer/index.ts": { + "name": "packages/@ember/-internals/glimmer/index.ts", + "modules": { + "@ember/component": 1 + }, + "classes": { + "Ember.Templates.helpers": 1 + }, + "fors": { + "Ember.Templates.helpers": 1 + }, + "namespaces": {} + }, + "packages/@ember/-internals/meta/lib/meta.ts": { + "name": "packages/@ember/-internals/meta/lib/meta.ts", + "modules": {}, + "classes": {}, + "fors": { + "Ember": 1 + }, + "namespaces": {} + }, + "packages/@ember/-internals/metal/lib/cache.ts": { + "name": "packages/@ember/-internals/metal/lib/cache.ts", + "modules": { + "@glimmer/tracking/primitives/cache": 1 + }, + "classes": {}, + "fors": { + "@glimmer/tracking/primitives/cache": 1 + }, + "namespaces": {} + }, + "packages/@ember/-internals/metal/lib/computed.ts": { + "name": "packages/@ember/-internals/metal/lib/computed.ts", + "modules": {}, + "classes": { + "ComputedProperty": 1 + }, + "fors": { + "@ember/object": 1, + "@ember/debug": 1 + }, + "namespaces": {} + }, + "packages/@ember/-internals/metal/lib/decorator.ts": { + "name": "packages/@ember/-internals/metal/lib/decorator.ts", + "modules": {}, + "classes": { + "Descriptor": 1 + }, + "fors": {}, + "namespaces": {} + }, + "packages/@ember/-internals/metal/lib/deprecate_property.ts": { + "name": "packages/@ember/-internals/metal/lib/deprecate_property.ts", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "packages/@ember/-internals/metal/lib/events.ts": { + "name": "packages/@ember/-internals/metal/lib/events.ts", + "modules": {}, + "classes": {}, + "fors": { + "@ember/object/events": 1, + "@ember/object/evented": 1 + }, + "namespaces": {} + }, + "packages/@ember/-internals/metal/lib/expand_properties.ts": { + "name": "packages/@ember/-internals/metal/lib/expand_properties.ts", + "modules": {}, + "classes": {}, + "fors": { + "@ember/object/computed": 1 + }, + "namespaces": {} + }, + "packages/@ember/-internals/metal/lib/get_properties.ts": { + "name": "packages/@ember/-internals/metal/lib/get_properties.ts", + "modules": {}, + "classes": {}, + "fors": { + "@ember/object": 1 + }, + "namespaces": {} + }, + "packages/@ember/-internals/metal/lib/injected_property.ts": { + "name": "packages/@ember/-internals/metal/lib/injected_property.ts", + "modules": {}, + "classes": { + "Ember.InjectedProperty": 1 + }, + "fors": {}, + "namespaces": { + "Ember": 1 + } + }, + "packages/@ember/-internals/metal/lib/libraries.ts": { + "name": "packages/@ember/-internals/metal/lib/libraries.ts", + "modules": {}, + "classes": { + "Libraries": 1 + }, + "fors": {}, + "namespaces": {} + }, + "packages/@ember/-internals/metal/lib/observer.ts": { + "name": "packages/@ember/-internals/metal/lib/observer.ts", + "modules": {}, + "classes": {}, + "fors": { + "@ember/object/observers": 1 + }, + "namespaces": {} + }, + "packages/@ember/-internals/metal/lib/properties.ts": { + "name": "packages/@ember/-internals/metal/lib/properties.ts", + "modules": {}, + "classes": {}, + "fors": { + "@ember/object": 1 + }, + "namespaces": {} + }, + "packages/@ember/-internals/metal/lib/property_events.ts": { + "name": "packages/@ember/-internals/metal/lib/property_events.ts", + "modules": {}, + "classes": {}, + "fors": { + "@ember/object": 1 + }, + "namespaces": {} + }, + "packages/@ember/-internals/metal/lib/property_get.ts": { + "name": "packages/@ember/-internals/metal/lib/property_get.ts", + "modules": {}, + "classes": {}, + "fors": { + "@ember/object": 1 + }, + "namespaces": {} + }, + "packages/@ember/-internals/metal/lib/property_set.ts": { + "name": "packages/@ember/-internals/metal/lib/property_set.ts", + "modules": {}, + "classes": {}, + "fors": { + "@ember/object": 1 + }, + "namespaces": {} + }, + "packages/@ember/-internals/metal/lib/set_properties.ts": { + "name": "packages/@ember/-internals/metal/lib/set_properties.ts", + "modules": {}, + "classes": {}, + "fors": { + "@ember/object": 1 + }, + "namespaces": {} + }, + "packages/@ember/-internals/metal/lib/tracked.ts": { + "name": "packages/@ember/-internals/metal/lib/tracked.ts", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "packages/@ember/-internals/owner/index.ts": { + "name": "packages/@ember/-internals/owner/index.ts", + "modules": {}, + "classes": { + "FullName": 1, + "BasicRegistry": 1, + "BasicContainer": 1, + "Owner": 1, + "RegisterOptions": 1, + "Factory": 1, + "FactoryManager": 1, + "Resolver": 1, + "InternalFactory": 1, + "ContainerProxy": 1, + "RegistryProxy": 1 + }, + "fors": { + "@ember/owner": 1 + }, + "namespaces": {} + }, + "packages/@ember/-internals/runtime/lib/mixins/-proxy.ts": { + "name": "packages/@ember/-internals/runtime/lib/mixins/-proxy.ts", + "modules": {}, + "classes": { + "Ember.ProxyMixin": 1 + }, + "fors": {}, + "namespaces": { + "Ember": 1 + } + }, + "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts": { + "name": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "modules": {}, + "classes": { + "Ember.ActionHandler": 1 + }, + "fors": {}, + "namespaces": { + "Ember": 1 + } + }, + "packages/@ember/-internals/runtime/lib/mixins/comparable.ts": { + "name": "packages/@ember/-internals/runtime/lib/mixins/comparable.ts", + "modules": {}, + "classes": { + "Ember.Comparable": 1 + }, + "fors": {}, + "namespaces": { + "Ember": 1 + } + }, + "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts": { + "name": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "modules": {}, + "classes": { + "ContainerProxyMixin": 1 + }, + "fors": {}, + "namespaces": {} + }, + "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts": { + "name": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "modules": {}, + "classes": { + "RegistryProxyMixin": 1 + }, + "fors": {}, + "namespaces": {} + }, + "packages/@ember/-internals/runtime/lib/mixins/target_action_support.ts": { + "name": "packages/@ember/-internals/runtime/lib/mixins/target_action_support.ts", + "modules": {}, + "classes": { + "Ember.TargetActionSupport": 1 + }, + "fors": {}, + "namespaces": { + "Ember": 1 + } + }, + "packages/@ember/-internals/string/index.ts": { + "name": "packages/@ember/-internals/string/index.ts", + "modules": {}, + "classes": { + "Ember.String": 1 + }, + "fors": {}, + "namespaces": {} + }, + "packages/@ember/-internals/utils/lib/guid.ts": { + "name": "packages/@ember/-internals/utils/lib/guid.ts", + "modules": {}, + "classes": {}, + "fors": { + "Ember": 1, + "@ember/object/internals": 1 + }, + "namespaces": {} + }, + "packages/@ember/-internals/utils/lib/intern.ts": { + "name": "packages/@ember/-internals/utils/lib/intern.ts", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "packages/@ember/-internals/utils/lib/invoke.ts": { + "name": "packages/@ember/-internals/utils/lib/invoke.ts", + "modules": {}, + "classes": {}, + "fors": { + "Ember": 1 + }, + "namespaces": {} + }, + "packages/@ember/-internals/utils/lib/spec.ts": { + "name": "packages/@ember/-internals/utils/lib/spec.ts", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "packages/@ember/-internals/utils/lib/super.ts": { + "name": "packages/@ember/-internals/utils/lib/super.ts", + "modules": {}, + "classes": {}, + "fors": { + "Ember": 1 + }, + "namespaces": {} + }, + "packages/@ember/-internals/views/lib/mixins/action_support.ts": { + "name": "packages/@ember/-internals/views/lib/mixins/action_support.ts", + "modules": {}, + "classes": { + "Ember.ActionSupport": 1 + }, + "fors": {}, + "namespaces": { + "Ember": 1 + } + }, + "packages/@ember/-internals/views/lib/mixins/child_views_support.ts": { + "name": "packages/@ember/-internals/views/lib/mixins/child_views_support.ts", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "packages/@ember/-internals/views/lib/mixins/class_names_support.ts": { + "name": "packages/@ember/-internals/views/lib/mixins/class_names_support.ts", + "modules": {}, + "classes": { + "Ember.ClassNamesSupport": 1 + }, + "fors": {}, + "namespaces": { + "Ember": 1 + } + }, + "packages/@ember/-internals/views/lib/mixins/view_state_support.ts": { + "name": "packages/@ember/-internals/views/lib/mixins/view_state_support.ts", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "packages/@ember/-internals/views/lib/mixins/view_support.ts": { + "name": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "modules": {}, + "classes": { + "Ember.ViewMixin": 1 + }, + "fors": {}, + "namespaces": { + "Ember": 1 + } + }, + "packages/@ember/-internals/views/lib/system/action_manager.ts": { + "name": "packages/@ember/-internals/views/lib/system/action_manager.ts", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "packages/@ember/-internals/views/lib/system/event_dispatcher.ts": { + "name": "packages/@ember/-internals/views/lib/system/event_dispatcher.ts", + "modules": {}, + "classes": { + "Ember.EventDispatcher": 1 + }, + "fors": {}, + "namespaces": { + "Ember": 1 + } + }, + "packages/@ember/-internals/views/lib/system/utils.ts": { + "name": "packages/@ember/-internals/views/lib/system/utils.ts", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "packages/@ember/-internals/views/lib/views/core_view.ts": { + "name": "packages/@ember/-internals/views/lib/views/core_view.ts", + "modules": {}, + "classes": { + "Ember.CoreView": 1 + }, + "fors": {}, + "namespaces": { + "Ember": 1 + } + }, + "packages/@ember/application/lib/lazy_load.ts": { + "name": "packages/@ember/application/lib/lazy_load.ts", + "modules": { + "@ember/application": 1 + }, + "classes": {}, + "fors": { + "@ember/application": 1 + }, + "namespaces": {} + }, + "packages/@ember/application/index.ts": { + "name": "packages/@ember/application/index.ts", + "modules": {}, + "classes": { + "Application": 1 + }, + "fors": {}, + "namespaces": {} + }, + "packages/@ember/application/instance.ts": { + "name": "packages/@ember/application/instance.ts", + "modules": {}, + "classes": { + "ApplicationInstance": 1, + "ApplicationInstance.BootOptions": 1 + }, + "fors": {}, + "namespaces": { + "ApplicationInstance": 1 + } + }, + "packages/@ember/application/namespace.ts": { + "name": "packages/@ember/application/namespace.ts", + "modules": { + "@ember/application/namespace": 1 + }, + "classes": { + "Namespace": 1 + }, + "fors": {}, + "namespaces": {} + }, + "packages/@ember/array/lib/make-array.ts": { + "name": "packages/@ember/array/lib/make-array.ts", + "modules": { + "@ember/array": 1 + }, + "classes": {}, + "fors": { + "@ember/array": 1 + }, + "namespaces": {} + }, + "packages/@ember/array/index.ts": { + "name": "packages/@ember/array/index.ts", + "modules": {}, + "classes": { + "EmberArray": 1, + "MutableArray": 1, + "Ember.NativeArray": 1 + }, + "fors": { + "@ember/array": 1 + }, + "namespaces": {} + }, + "packages/@ember/array/proxy.ts": { + "name": "packages/@ember/array/proxy.ts", + "modules": { + "@ember/array/proxy": 1 + }, + "classes": { + "ArrayProxy": 1 + }, + "fors": {}, + "namespaces": {} + }, + "packages/@ember/canary-features/index.ts": { + "name": "packages/@ember/canary-features/index.ts", + "modules": { + "@ember/canary-features": 1 + }, + "classes": { + "FEATURES": 1 + }, + "fors": {}, + "namespaces": {} + }, + "packages/@ember/component/template-only.ts": { + "name": "packages/@ember/component/template-only.ts", + "modules": { + "@ember/component/template-only": 1 + }, + "classes": {}, + "fors": { + "@ember/component/template-only": 1 + }, + "namespaces": {} + }, + "packages/@ember/controller/index.ts": { + "name": "packages/@ember/controller/index.ts", + "modules": { + "@ember/controller": 1 + }, + "classes": { + "Ember.ControllerMixin": 1, + "Ember.Controller": 1 + }, + "fors": { + "Ember.ControllerMixin": 1, + "@ember/controller": 1 + }, + "namespaces": { + "Ember": 1 + } + }, + "packages/@ember/debug/lib/capture-render-tree.ts": { + "name": "packages/@ember/debug/lib/capture-render-tree.ts", + "modules": {}, + "classes": {}, + "fors": { + "@ember/debug": 1 + }, + "namespaces": {} + }, + "packages/@ember/debug/lib/deprecate.ts": { + "name": "packages/@ember/debug/lib/deprecate.ts", + "modules": {}, + "classes": {}, + "fors": { + "@ember/debug": 1 + }, + "namespaces": {} + }, + "packages/@ember/debug/lib/inspect.ts": { + "name": "packages/@ember/debug/lib/inspect.ts", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "packages/@ember/debug/lib/warn.ts": { + "name": "packages/@ember/debug/lib/warn.ts", + "modules": {}, + "classes": {}, + "fors": { + "@ember/debug": 1 + }, + "namespaces": {} + }, + "packages/@ember/debug/container-debug-adapter.ts": { + "name": "packages/@ember/debug/container-debug-adapter.ts", + "modules": { + "@ember/debug/container-debug-adapter": 1 + }, + "classes": { + "ContainerDebugAdapter": 1 + }, + "fors": {}, + "namespaces": {} + }, + "packages/@ember/debug/data-adapter.ts": { + "name": "packages/@ember/debug/data-adapter.ts", + "modules": { + "@ember/debug/data-adapter": 1 + }, + "classes": { + "DataAdapter": 1 + }, + "fors": {}, + "namespaces": {} + }, + "packages/@ember/debug/index.ts": { + "name": "packages/@ember/debug/index.ts", + "modules": { + "@ember/debug": 1 + }, + "classes": {}, + "fors": { + "@ember/debug": 1 + }, + "namespaces": {} + }, + "packages/@ember/destroyable/index.ts": { + "name": "packages/@ember/destroyable/index.ts", + "modules": { + "@ember/destroyable": 1 + }, + "classes": {}, + "fors": { + "@ember/destroyable": 1 + }, + "namespaces": {} + }, + "packages/@ember/engine/lib/engine-parent.ts": { + "name": "packages/@ember/engine/lib/engine-parent.ts", + "modules": { + "@ember/engine": 1 + }, + "classes": {}, + "fors": { + "@ember/engine": 1 + }, + "namespaces": {} + }, + "packages/@ember/engine/index.ts": { + "name": "packages/@ember/engine/index.ts", + "modules": {}, + "classes": { + "Engine": 1 + }, + "fors": {}, + "namespaces": {} + }, + "packages/@ember/engine/instance.ts": { + "name": "packages/@ember/engine/instance.ts", + "modules": {}, + "classes": { + "EngineInstance": 1 + }, + "fors": {}, + "namespaces": {} + }, + "packages/@ember/enumerable/index.ts": { + "name": "packages/@ember/enumerable/index.ts", + "modules": { + "@ember/enumerable": 1 + }, + "classes": { + "Enumerable": 1 + }, + "fors": {}, + "namespaces": {} + }, + "packages/@ember/enumerable/mutable.ts": { + "name": "packages/@ember/enumerable/mutable.ts", + "modules": {}, + "classes": { + "Ember.MutableEnumerable": 1 + }, + "fors": {}, + "namespaces": { + "Ember": 1 + } + }, + "packages/@ember/helper/index.ts": { + "name": "packages/@ember/helper/index.ts", + "modules": { + "@ember/helper": 1 + }, + "classes": {}, + "fors": { + "@ember/helper": 1 + }, + "namespaces": {} + }, + "packages/@ember/instrumentation/index.ts": { + "name": "packages/@ember/instrumentation/index.ts", + "modules": { + "@ember/instrumentation": 1 + }, + "classes": { + "Instrumentation": 1 + }, + "fors": { + "@ember/instrumentation": 1 + }, + "namespaces": {} + }, + "packages/@ember/object/lib/computed/computed_macros.ts": { + "name": "packages/@ember/object/lib/computed/computed_macros.ts", + "modules": {}, + "classes": {}, + "fors": { + "@ember/object/computed": 1 + }, + "namespaces": {} + }, + "packages/@ember/object/lib/computed/reduce_computed_macros.ts": { + "name": "packages/@ember/object/lib/computed/reduce_computed_macros.ts", + "modules": {}, + "classes": {}, + "fors": { + "@ember/object/computed": 1 + }, + "namespaces": {} + }, + "packages/@ember/object/type-tests/core/index.test.ts": { + "name": "packages/@ember/object/type-tests/core/index.test.ts", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "packages/@ember/object/type-tests/ember-object.test.ts": { + "name": "packages/@ember/object/type-tests/ember-object.test.ts", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "packages/@ember/object/compat.ts": { + "name": "packages/@ember/object/compat.ts", + "modules": {}, + "classes": {}, + "fors": { + "@ember/object/compat": 1 + }, + "namespaces": {} + }, + "packages/@ember/object/core.ts": { + "name": "packages/@ember/object/core.ts", + "modules": { + "@ember/object/core": 1 + }, + "classes": { + "CoreObject": 1 + }, + "fors": { + "@ember/object": 1 + }, + "namespaces": {} + }, + "packages/@ember/object/evented.ts": { + "name": "packages/@ember/object/evented.ts", + "modules": { + "@ember/object/evented": 1 + }, + "classes": { + "Evented": 1 + }, + "fors": {}, + "namespaces": {} + }, + "packages/@ember/object/index.ts": { + "name": "packages/@ember/object/index.ts", + "modules": { + "@ember/object": 1 + }, + "classes": { + "EmberObject": 1 + }, + "fors": { + "@ember/object": 1 + }, + "namespaces": {} + }, + "packages/@ember/object/mixin.ts": { + "name": "packages/@ember/object/mixin.ts", + "modules": { + "@ember/object/mixin": 1 + }, + "classes": { + "Mixin": 1 + }, + "fors": { + "@ember/object/mixin": 1 + }, + "namespaces": {} + }, + "packages/@ember/object/observable.ts": { + "name": "packages/@ember/object/observable.ts", + "modules": { + "@ember/object/observable": 1 + }, + "classes": { + "Observable": 1 + }, + "fors": {}, + "namespaces": {} + }, + "packages/@ember/object/promise-proxy-mixin.ts": { + "name": "packages/@ember/object/promise-proxy-mixin.ts", + "modules": { + "@ember/object/promise-proxy-mixin": 1 + }, + "classes": { + "PromiseProxyMixin": 1 + }, + "fors": {}, + "namespaces": {} + }, + "packages/@ember/object/proxy.ts": { + "name": "packages/@ember/object/proxy.ts", + "modules": { + "@ember/object/proxy": 1 + }, + "classes": { + "ObjectProxy": 1 + }, + "fors": {}, + "namespaces": {} + }, + "packages/@ember/owner/index.ts": { + "name": "packages/@ember/owner/index.ts", + "modules": { + "@ember/owner": 1 + }, + "classes": {}, + "fors": { + "@ember/owner": 1 + }, + "namespaces": {} + }, + "packages/@ember/renderer/index.ts": { + "name": "packages/@ember/renderer/index.ts", + "modules": { + "@ember/renderer": 1 + }, + "classes": { + "Renderer": 1 + }, + "fors": {}, + "namespaces": {} + }, + "packages/@ember/routing/lib/cache.ts": { + "name": "packages/@ember/routing/lib/cache.ts", + "modules": {}, + "classes": { + "BucketCache": 1 + }, + "fors": {}, + "namespaces": {} + }, + "packages/@ember/routing/lib/controller_for.ts": { + "name": "packages/@ember/routing/lib/controller_for.ts", + "modules": { + "ember/routing": 1 + }, + "classes": {}, + "fors": { + "Ember": 1 + }, + "namespaces": {} + }, + "packages/@ember/routing/lib/generate_controller.ts": { + "name": "packages/@ember/routing/lib/generate_controller.ts", + "modules": {}, + "classes": {}, + "fors": { + "Ember": 1 + }, + "namespaces": {} + }, + "packages/@ember/routing/lib/location-utils.ts": { + "name": "packages/@ember/routing/lib/location-utils.ts", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "packages/@ember/routing/lib/routing-service.ts": { + "name": "packages/@ember/routing/lib/routing-service.ts", + "modules": {}, + "classes": { + "RoutingService": 1 + }, + "fors": {}, + "namespaces": {} + }, + "packages/@ember/routing/hash-location.ts": { + "name": "packages/@ember/routing/hash-location.ts", + "modules": { + "@ember/routing/hash-location": 1 + }, + "classes": { + "HashLocation": 1 + }, + "fors": {}, + "namespaces": {} + }, + "packages/@ember/routing/history-location.ts": { + "name": "packages/@ember/routing/history-location.ts", + "modules": { + "@ember/routing/history-location": 1 + }, + "classes": { + "HistoryLocation": 1 + }, + "fors": {}, + "namespaces": {} + }, + "packages/@ember/routing/location.ts": { + "name": "packages/@ember/routing/location.ts", + "modules": { + "@ember/routing/location": 1 + }, + "classes": { + "Location": 1 + }, + "fors": { + "@ember/routing/location": 1 + }, + "namespaces": {} + }, + "packages/@ember/routing/none-location.ts": { + "name": "packages/@ember/routing/none-location.ts", + "modules": { + "@ember/routing/none-location": 1 + }, + "classes": { + "NoneLocation": 1 + }, + "fors": {}, + "namespaces": {} + }, + "packages/@ember/routing/route-info.ts": { + "name": "packages/@ember/routing/route-info.ts", + "modules": { + "@ember/routing/route-info": 1 + }, + "classes": { + "RouteInfo": 1, + "RouteInfoWithAttributes": 1 + }, + "fors": {}, + "namespaces": {} + }, + "packages/@ember/routing/route.ts": { + "name": "packages/@ember/routing/route.ts", + "modules": { + "@ember/routing/route": 1 + }, + "classes": { + "Route": 1 + }, + "fors": { + "Route": 1 + }, + "namespaces": {} + }, + "packages/@ember/routing/router-service.ts": { + "name": "packages/@ember/routing/router-service.ts", + "modules": { + "@ember/routing/router-service": 1 + }, + "classes": { + "RouterService": 1 + }, + "fors": {}, + "namespaces": {} + }, + "packages/@ember/routing/router.ts": { + "name": "packages/@ember/routing/router.ts", + "modules": { + "@ember/routing/router": 1 + }, + "classes": { + "EmberRouter": 1 + }, + "fors": {}, + "namespaces": {} + }, + "packages/@ember/routing/transition.ts": { + "name": "packages/@ember/routing/transition.ts", + "modules": { + "@ember/routing/transition": 1 + }, + "classes": { + "Transition": 1 + }, + "fors": {}, + "namespaces": {} + }, + "packages/@ember/runloop/index.ts": { + "name": "packages/@ember/runloop/index.ts", + "modules": { + "@ember/runloop": 1 + }, + "classes": {}, + "fors": { + "@ember/runloop": 1 + }, + "namespaces": {} + }, + "packages/@ember/service/index.ts": { + "name": "packages/@ember/service/index.ts", + "modules": { + "@ember/service": 1 + }, + "classes": { + "Service": 1 + }, + "fors": { + "@ember/service": 1 + }, + "namespaces": {} + }, + "packages/@ember/utils/lib/compare.ts": { + "name": "packages/@ember/utils/lib/compare.ts", + "modules": { + "@ember/utils": 1 + }, + "classes": {}, + "fors": { + "@ember/utils": 1 + }, + "namespaces": {} + }, + "packages/@ember/utils/lib/is-equal.ts": { + "name": "packages/@ember/utils/lib/is-equal.ts", + "modules": {}, + "classes": {}, + "fors": { + "@ember/utils": 1 + }, + "namespaces": {} + }, + "packages/@ember/utils/lib/is_blank.ts": { + "name": "packages/@ember/utils/lib/is_blank.ts", + "modules": {}, + "classes": {}, + "fors": { + "@ember/utils": 1 + }, + "namespaces": {} + }, + "packages/@ember/utils/lib/is_empty.ts": { + "name": "packages/@ember/utils/lib/is_empty.ts", + "modules": {}, + "classes": {}, + "fors": { + "@ember/utils": 1 + }, + "namespaces": {} + }, + "packages/@ember/utils/lib/is_none.ts": { + "name": "packages/@ember/utils/lib/is_none.ts", + "modules": {}, + "classes": {}, + "fors": { + "@ember/utils": 1 + }, + "namespaces": {} + }, + "packages/@ember/utils/lib/is_present.ts": { + "name": "packages/@ember/utils/lib/is_present.ts", + "modules": {}, + "classes": {}, + "fors": { + "@ember/utils": 1 + }, + "namespaces": {} + }, + "packages/@ember/utils/lib/type-of.ts": { + "name": "packages/@ember/utils/lib/type-of.ts", + "modules": {}, + "classes": {}, + "fors": { + "@ember/utils": 1 + }, + "namespaces": {} + }, + "packages/ember-testing/lib/adapters/adapter.ts": { + "name": "packages/ember-testing/lib/adapters/adapter.ts", + "modules": {}, + "classes": { + "TestAdapter": 1 + }, + "fors": {}, + "namespaces": {} + }, + "packages/ember-testing/lib/adapters/qunit.ts": { + "name": "packages/ember-testing/lib/adapters/qunit.ts", + "modules": {}, + "classes": { + "Ember.Test.QUnitAdapter": 1 + }, + "fors": {}, + "namespaces": { + "Ember.Test": 1 + } + }, + "packages/ember-testing/lib/ext/application.ts": { + "name": "packages/ember-testing/lib/ext/application.ts", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "packages/ember-testing/lib/helpers/current_path.ts": { + "name": "packages/ember-testing/lib/helpers/current_path.ts", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "packages/ember-testing/lib/helpers/current_route_name.ts": { + "name": "packages/ember-testing/lib/helpers/current_route_name.ts", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "packages/ember-testing/lib/helpers/current_url.ts": { + "name": "packages/ember-testing/lib/helpers/current_url.ts", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "packages/ember-testing/lib/helpers/pause_test.ts": { + "name": "packages/ember-testing/lib/helpers/pause_test.ts", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "packages/ember-testing/lib/helpers/visit.ts": { + "name": "packages/ember-testing/lib/helpers/visit.ts", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "packages/ember-testing/lib/helpers/wait.ts": { + "name": "packages/ember-testing/lib/helpers/wait.ts", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": {} + }, + "packages/ember-testing/lib/test/helpers.ts": { + "name": "packages/ember-testing/lib/test/helpers.ts", + "modules": { + "@ember/test": 1 + }, + "classes": {}, + "fors": { + "@ember/test": 1 + }, + "namespaces": {} + }, + "packages/ember-testing/lib/test/on_inject_helpers.ts": { + "name": "packages/ember-testing/lib/test/on_inject_helpers.ts", + "modules": {}, + "classes": {}, + "fors": { + "Ember.Test": 1 + }, + "namespaces": {} + }, + "packages/ember-testing/lib/test/promise.ts": { + "name": "packages/ember-testing/lib/test/promise.ts", + "modules": {}, + "classes": {}, + "fors": { + "Ember.Test": 1 + }, + "namespaces": {} + }, + "packages/ember-testing/lib/test/waiters.ts": { + "name": "packages/ember-testing/lib/test/waiters.ts", + "modules": {}, + "classes": {}, + "fors": { + "@ember/test": 1 + }, + "namespaces": {} + }, + "packages/ember-testing/lib/setup_for_testing.ts": { + "name": "packages/ember-testing/lib/setup_for_testing.ts", + "modules": {}, + "classes": {}, + "fors": {}, + "namespaces": { + "Ember": 1 + } + }, + "packages/ember-testing/lib/test.ts": { + "name": "packages/ember-testing/lib/test.ts", + "modules": { + "ember": 1 + }, + "classes": { + "Ember.Test": 1 + }, + "fors": { + "Ember.Test": 1 + }, + "namespaces": { + "Ember": 1 + } + } + }, + "modules": { + "rsvp": { + "name": "rsvp", + "submodules": {}, + "elements": {}, + "classes": { + "Promise": 1, + "rsvp": 1, + "EventTarget": 1, + "Container": 1, + "Registry": 1, + "EmberENV": 1 + }, + "fors": { + "rsvp": 1, + "EventTarget": 1, + "EmberENV": 1 + }, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/-internals/environment/lib/env.ts", + "line": 4, + "access": "public", + "tagname": "" + }, + "@ember/component": { + "name": "@ember/component", + "submodules": {}, + "elements": {}, + "classes": { + "@ember/component": 1, + "Component": 1, + "Helper": 1, + "@ember/component/helper": 1 + }, + "fors": { + "Ember.Templates.helpers": 1, + "@ember/component": 1, + "Ember.Templates.components": 1, + "@ember/component/helper": 1 + }, + "namespaces": {}, + "tag": "main", + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 53, + "description": "[Glimmer](https://github.com/tildeio/glimmer) is a templating engine used by Ember.js that is compatible with a subset of the [Handlebars](http://handlebarsjs.com/) syntax.\n\n### Showing a property\n\nTemplates manage the flow of an application's UI, and display state (through\nthe DOM) to a user. For example, given a component with the property \"name\",\nthat component's template can use the name in several ways:\n\n```app/components/person-profile.js\nimport Component from '@ember/component';\n\nexport default Component.extend({\n name: 'Jill'\n});\n```\n\n```app/components/person-profile.hbs\n{{this.name}}\n
{{this.name}}
\n\n```\n\nAny time the \"name\" property on the component changes, the DOM will be\nupdated.\n\nProperties can be chained as well:\n\n```handlebars\n{{@aUserModel.name}}\n
{{@listOfUsers.firstObject.name}}
\n```\n\n### Using Ember helpers\n\nWhen content is passed in mustaches `{{}}`, Ember will first try to find a helper\nor component with that name. For example, the `if` helper:\n\n```app/components/person-profile.hbs\n{{if this.name \"I have a name\" \"I have no name\"}}\n\n```\n\nThe returned value is placed where the `{{}}` is called. The above style is\ncalled \"inline\". A second style of helper usage is called \"block\". For example:\n\n```handlebars\n{{#if this.name}}\n I have a name\n{{else}}\n I have no name\n{{/if}}\n```\n\nThe block form of helpers allows you to control how the UI is created based\non the values of properties.\nA third form of helper is called \"nested\". For example here the concat\nhelper will add \" Doe\" to a displayed name if the person has no last name:\n\n```handlebars\n\n```\n\nEmber's built-in helpers are described under the [Ember.Templates.helpers](/ember/release/classes/Ember.Templates.helpers)\nnamespace. Documentation on creating custom helpers can be found under\n[helper](/ember/release/functions/@ember%2Fcomponent%2Fhelper/helper) (or\nunder [Helper](/ember/release/classes/Helper) if a helper requires access to\ndependency injection).\n\n### Invoking a Component\n\nEmber components represent state to the UI of an application. Further\nreading on components can be found under [Component](/ember/release/classes/Component).", + "itemtype": "main" + }, + "@ember/routing": { + "name": "@ember/routing", + "submodules": {}, + "elements": {}, + "classes": { + "Ember.Templates.components": 1, + "@ember/routing": 1 + }, + "fors": { + "Ember.Templates.helpers": 1, + "@ember/routing": 1 + }, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/-internals/glimmer/lib/components/link-to.ts", + "line": 251 + }, + "ember": { + "name": "ember", + "submodules": { + "undefined": 1 + }, + "elements": {}, + "classes": { + "@ember/array": 1, + "Ember.Templates.helpers": 1, + "@ember/helper": 1, + "ComponentStateBucket": 1, + "Ember.InjectedProperty": 1, + "Libraries": 1, + "Ember.ProxyMixin": 1, + "Ember.ActionHandler": 1, + "Ember.Comparable": 1, + "ContainerProxyMixin": 1, + "RegistryProxyMixin": 1, + "Ember.TargetActionSupport": 1, + "Ember.String": 1, + "Ember.ActionSupport": 1, + "Ember.ClassNamesSupport": 1, + "Ember.ViewMixin": 1, + "Ember.EventDispatcher": 1, + "Ember.CoreView": 1, + "Ember.NativeArray": 1, + "Ember.MutableEnumerable": 1, + "RoutingService": 1, + "Ember.Test.QUnitAdapter": 1, + "Ember.Test": 1 + }, + "fors": { + "Ember.Templates.helpers": 1, + "@ember/helper": 1, + "Ember": 1, + "@ember/object": 1, + "Ember.Test": 1 + }, + "namespaces": { + "Ember": 1, + "Ember.Test": 1 + }, + "tag": "module", + "file": "packages/ember-testing/lib/test.ts", + "line": 11, + "access": "private", + "tagname": "" + }, + "@ember/template": { + "name": "@ember/template", + "submodules": {}, + "elements": {}, + "classes": { + "@ember/template": 1, + "SafeString": 1 + }, + "fors": { + "@ember/template": 1 + }, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/-internals/glimmer/lib/utils/string.ts", + "line": 7 + }, + "@glimmer/component": { + "name": "@glimmer/component", + "submodules": {}, + "elements": {}, + "classes": {}, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/-internals/glimmer/lib/glimmer-component-docs.ts", + "line": 1, + "description": "A component is a reusable UI element that consists of a `.hbs` template and an\noptional JavaScript class that defines its behavior. For example, someone\nmight make a `button` in the template and handle the click behavior in the\nJavaScript file that shares the same name as the template.\n\nComponents are broken down into two categories:\n\n- Components _without_ JavaScript, that are based only on a template. These\n are called Template-only or TO components.\n- Components _with_ JavaScript, which consist of a template and a backing\n class.\n\nEmber ships with two types of JavaScript classes for components:\n\n1. Glimmer components, imported from `@glimmer/component`, which are the\n default components for Ember Octane (3.15) and more recent editions.\n2. Classic components, imported from `@ember/component`, which were the\n default for older editions of Ember (pre 3.15).\n\nBelow is the documentation for Template-only and Glimmer components. If you\nare looking for the API documentation for Classic components, it is\n[available here](/ember/release/classes/Component). The source code for\nGlimmer components can be found in [`@glimmer/component`](https://github.com/glimmerjs/glimmer.js/tree/master/packages/%40glimmer/component).\n\n## Defining a Template-only Component\n\nThe simplest way to create a component is to create a template file in\n`app/templates/components`. For example, if you name a template\n`app/templates/components/person-profile.hbs`:\n\n```app/templates/components/person-profile.hbs\n

{{@person.name}}

\n\n

{{@person.signature}}

\n```\n\nYou will be able to use `` to invoke this component elsewhere\nin your application:\n\n```app/templates/application.hbs\n\n```\n\nNote that component names are capitalized here in order to distinguish them\nfrom regular HTML elements, but they are dasherized in the file system.\n\nWhile the angle bracket invocation form is generally preferred, it is also\npossible to invoke the same component with the `{{person-profile}}` syntax:\n\n```app/templates/application.hbs\n{{person-profile person=this.currentUser}}\n```\n\nNote that with this syntax, you use dashes in the component name and\narguments are passed without the `@` sign.\n\nIn both cases, Ember will render the content of the component template we\ncreated above. The end result will be something like this:\n\n```html\n

Tomster

\n\n

Out of office this week

\n```\n\n## File System Nesting\n\nComponents can be nested inside sub-folders for logical groupping. For\nexample, if we placed our template in\n`app/templates/components/person/short-profile.hbs`, we can invoke it as\n``:\n\n```app/templates/application.hbs\n\n```\n\nOr equivalently, `{{person/short-profile}}`:\n\n```app/templates/application.hbs\n{{person/short-profile person=this.currentUser}}\n```\n\n## Using Blocks\n\nYou can use `yield` inside a template to include the **contents** of any block\nattached to the component. For instance, if we added a `{{yield}}` to our\ncomponent like so:\n\n```app/templates/components/person-profile.hbs\n

{{@person.name}}

\n{{yield}}\n```\n\nWe could then invoke it like this:\n\n```handlebars\n\n

Admin mode

\n
\n```\n\nor with curly syntax like this:\n\n```handlebars\n{{#person-profile person=this.currentUser}}\n

Admin mode

\n{{/person-profile}}\n```\n\nAnd the content passed in between the brackets of the component would be\nrendered in the same place as the `{{yield}}` within it, replacing it.\n\nBlocks are executed in their original context, meaning they have access to the\nscope and any in-scope variables where they were defined.\n\n### Passing parameters to blocks\n\nYou can also pass positional parameters to `{{yield}}`, which are then made\navailable in the block:\n\n```app/templates/components/person-profile.hbs\n

{{@person.name}}

\n{{yield @person.signature}}\n```\n\nWe can then use this value in the block like so:\n\n```handlebars\n\n {{signature}}\n\n```\n\n### Passing multiple blocks\n\nYou can pass multiple blocks to a component by giving them names, and\nspecifying which block you are yielding to with `{{yield}}`. For instance, if\nwe wanted to add a way for users to customize the title of our\n`` component, we could add a named block inside of the header:\n\n```app/templates/components/person-profile.hbs\n

{{yield to=\"title\"}}

\n{{yield}}\n```\n\nThis component could then be invoked like so:\n\n```handlebars\n\n <:title>{{this.currentUser.name}}\n <:default>{{this.currentUser.signature}}\n\n```\n\nWhen passing named blocks, you must name every block, including the `default`\nblock, which is the block that is defined if you do not pass a `to` parameter\nto `{{yield}}`. Whenever you invoke a component without passing explicitly\nnamed blocks, the passed block is considered the `default` block.\n\n### Passing parameters to named blocks\n\nYou can also pass parameters to named blocks:\n\n```app/templates/components/person-profile.hbs\n

{{yield @person.name to=\"title\"}}

\n{{yield @person.signature}}\n```\n\nThese parameters can then be used like so:\n\n```handlebars\n\n <:title as |name|>{{name}}\n <:default as |signature|>{{signature}}\n\n```\n\n### Checking to see if a block exists\n\nYou can also check to see if a block exists using the `(has-block)` keyword,\nand conditionally use it, or provide a default template instead.\n\n```app/templates/components/person-profile.hbs\n

\n {{#if (has-block \"title\")}}\n {{yield @person.name to=\"title\"}}\n {{else}}\n {{@person.name}}\n {{/if}}\n

\n\n{{#if (has-block)}}\n {{yield @person.signature}}\n{{else}}\n {{@person.signature}}\n{{/if}}\n```\n\nWith this template, we can then optionally pass in one block, both blocks, or\nnone at all:\n\n```handlebars\n{{! passing both blocks }}\n\n <:title as |name|>{{name}}\n <:default as |signature|>{{signature}}\n\n\n{{! passing just the title block }}\n\n <:title as |name|>{{name}}\n\n\n{{! passing just the default block }}\n\n {{signature}}\n\n\n{{! not passing any blocks }}\n\n```\n\n### Checking to see if a block has parameters\n\nWe can also check if a block receives parameters using the `(has-block-params)`\nkeyword, and conditionally yield different values if so.\n\n```app/templates/components/person-profile.hbs\n{{#if (has-block-params)}}\n {{yield @person.signature}}\n{{else}}\n {{yield}}\n{{/if}}\n```\n\n## Customizing Components With JavaScript\n\nTo add JavaScript to a component, create a JavaScript file in the same\nlocation as the template file, with the same name, and export a subclass\nof `Component` as the default value. For example, to add Javascript to the\n`PersonProfile` component which we defined above, we would create\n`app/components/person-profile.js` and export our class as the default, like\nso:\n\n```app/components/person-profile.js\nimport Component from '@glimmer/component';\n\nexport default class PersonProfileComponent extends Component {\n get displayName() {\n let { title, firstName, lastName } = this.args.person;\n\n if (title) {\n return `${title} ${lastName}`;\n } else {\n return `${firstName} ${lastName}`;\n }\n })\n}\n```\n\nYou can add your own properties, methods, and lifecycle hooks to this\nsubclass to customize its behavior, and you can reference the instance of the\nclass in your template using `{{this}}`. For instance, we could access the\n`displayName` property of our `PersonProfile` component instance in the\ntemplate like this:\n\n```app/templates/components/person-profile.hbs\n

{{this.displayName}}

\n{{yield}}\n```\n\n## `constructor`\n\nparams: `owner` object and `args` object\n\nConstructs a new component and assigns itself the passed properties. The\nconstructor is run whenever a new instance of the component is created, and\ncan be used to setup the initial state of the component.\n\n```javascript\nimport Component from '@glimmer/component';\n\nexport default class SomeComponent extends Component {\n constructor(owner, args) {\n super(owner, args);\n\n if (this.args.displayMode === 'list') {\n this.items = [];\n }\n }\n}\n```\n\nService injections and arguments are available in the constructor.\n\n```javascript\nimport Component from '@glimmer/component';\nimport { service } from '@ember/service';\n\nexport default class SomeComponent extends Component {\n @service myAnimations;\n\n constructor(owner, args) {\n super(owner, args);\n\n if (this.args.fadeIn === true) {\n this.myAnimations.register(this, 'fade-in');\n }\n }\n}\n```\n\n## `willDestroy`\n\n`willDestroy` is called after the component has been removed from the DOM, but\nbefore the component is fully destroyed. This lifecycle hook can be used to\ncleanup the component and any related state.\n\n```javascript\nimport Component from '@glimmer/component';\nimport { service } from '@ember/service';\n\nexport default class SomeComponent extends Component {\n @service myAnimations;\n\n willDestroy() {\n super.willDestroy(...arguments);\n\n this.myAnimations.unregister(this);\n }\n}\n```\n\n## `args`\n\nThe `args` property of Glimmer components is an object that contains the\n_arguments_ that are passed to the component. For instance, the\nfollowing component usage:\n\n```handlebars\n\n```\n\nWould result in the following `args` object to be passed to the component:\n\n```javascript\n{ fadeIn: true }\n```\n\n`args` can be accessed at any point in the component lifecycle, including\n`constructor` and `willDestroy`. They are also automatically marked as tracked\nproperties, and they can be depended on as computed property dependencies:\n\n```javascript\nimport Component from '@glimmer/component';\nimport { computed } from '@ember/object';\n\nexport default class SomeComponent extends Component {\n\n @computed('args.someValue')\n get computedGetter() {\n // updates whenever args.someValue updates\n return this.args.someValue;\n }\n\n get standardGetter() {\n // updates whenever args.anotherValue updates (Ember 3.13+)\n return this.args.anotherValue;\n }\n}\n```\n\n## `isDestroying`\n\nA boolean flag to tell if the component is in the process of destroying. This is set to\ntrue before `willDestroy` is called.\n\n## `isDestroyed`\nA boolean to tell if the component has been fully destroyed. This is set to true\nafter `willDestroy` is called.", + "access": "public", + "tagname": "" + }, + "@glimmer/tracking": { + "name": "@glimmer/tracking", + "submodules": {}, + "elements": {}, + "classes": { + "@glimmer/tracking": 1 + }, + "fors": { + "@glimmer/tracking": 1 + }, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/-internals/glimmer/lib/glimmer-tracking-docs.ts", + "line": 1, + "description": "In order to tell Ember a value might change, we need to mark it as trackable.\nTrackable values are values that:\n\n- Can change over their component’s lifetime and\n- Should cause Ember to rerender if and when they change\n\nWe can do this by marking the field with the `@tracked` decorator.\n\n### Caching a getter value\n\nThe `@cached` decorator can be used on getters in order to cache the\nreturn value of the getter.\n\nThis method adds an extra overhead to each memoized getter, therefore caching\nthe values should not be the default strategy, but used in last resort.", + "access": "public", + "tagname": "" + }, + "@glimmer/tracking/primitives/cache": { + "name": "@glimmer/tracking/primitives/cache", + "submodules": {}, + "elements": {}, + "classes": { + "@glimmer/tracking/primitives/cache": 1 + }, + "fors": { + "@glimmer/tracking/primitives/cache": 1 + }, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/-internals/metal/lib/cache.ts", + "line": 3, + "description": "Ember uses caching based on trackable values to avoid updating large portions\nof the application. This caching is exposed via a cache primitive that can be\nused to cache a specific computation, so that it will not update and will\nreturn the cached value until a tracked value used in its computation has\nupdated.", + "access": "public", + "tagname": "" + }, + "@ember/object": { + "name": "@ember/object", + "submodules": {}, + "elements": {}, + "classes": { + "ComputedProperty": 1, + "@ember/object": 1, + "Descriptor": 1, + "@ember/object/events": 1, + "@ember/object/evented": 1, + "@ember/object/computed": 1, + "@ember/object/observers": 1, + "@ember/object/internals": 1, + "@ember/object/compat": 1, + "EmberObject": 1 + }, + "fors": { + "@ember/object": 1, + "@ember/debug": 1, + "@ember/object/events": 1, + "@ember/object/evented": 1, + "@ember/object/computed": 1, + "@ember/object/observers": 1, + "Ember": 1, + "@ember/object/internals": 1, + "@ember/object/compat": 1 + }, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/object/index.ts", + "line": 30 + }, + "@ember/owner": { + "name": "@ember/owner", + "submodules": {}, + "elements": {}, + "classes": { + "@ember/owner": 1, + "FullName": 1, + "BasicRegistry": 1, + "BasicContainer": 1, + "Owner": 1, + "RegisterOptions": 1, + "Factory": 1, + "FactoryManager": 1, + "Resolver": 1, + "InternalFactory": 1, + "ContainerProxy": 1, + "RegistryProxy": 1 + }, + "fors": { + "@ember/owner": 1 + }, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/-internals/owner/index.ts", + "line": 599, + "description": "Ember’s dependency injection system is built on the idea of an \"owner\": an\nobject responsible for managing items which can be registered and looked up\nwith the system.\n\nThis module does not provide any concrete instances of owners. Instead, it\ndefines the core type, `Owner`, which specifies the public API contract for an\nowner. The primary concrete implementations of `Owner` are `EngineInstance`,\nfrom `@ember/engine/instance`, and its `ApplicationInstance` subclass, from\n`@ember/application/instance`.\n\nAlong with `Owner` itself, this module provides a number of supporting types\nrelated to Ember's DI system:\n\n- `Factory`, Ember's primary interface for something which can create class\n instances registered with the DI system.\n\n- `FactoryManager`, an interface for inspecting a `Factory`'s class.\n\n- `Resolver`, an interface defining the contract for the object responsible\n for mapping string names to the corresponding classes. For example, when you\n write `@service('session')`, a resolver is responsible to map that back to\n the `Session` service class in your codebase. Normally, this is handled for\n you automatically with `ember-resolver`, which is the main implementor of\n this interface.\n\nFor more details on each, see their per-item docs.", + "access": "public", + "tagname": "" + }, + "@ember/utils": { + "name": "@ember/utils", + "submodules": {}, + "elements": {}, + "classes": { + "Ember": 1, + "@ember/utils": 1 + }, + "fors": { + "Ember": 1, + "@ember/utils": 1 + }, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/utils/lib/compare.ts", + "line": 49 + }, + "@ember/application": { + "name": "@ember/application", + "submodules": {}, + "elements": {}, + "classes": { + "@ember/application": 1, + "Application": 1, + "ApplicationInstance": 1, + "ApplicationInstance.BootOptions": 1 + }, + "fors": { + "@ember/application": 1 + }, + "namespaces": { + "ApplicationInstance": 1 + }, + "tag": "module", + "file": "packages/@ember/application/instance.ts", + "line": 316 + }, + "@ember/application/namespace": { + "name": "@ember/application/namespace", + "submodules": {}, + "elements": {}, + "classes": { + "Namespace": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/application/namespace.ts", + "line": 20 + }, + "@ember/array": { + "name": "@ember/array", + "submodules": {}, + "elements": {}, + "classes": { + "EmberArray": 1, + "MutableArray": 1 + }, + "fors": { + "@ember/array": 1 + }, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/array/index.ts", + "line": 1463 + }, + "@ember/array/proxy": { + "name": "@ember/array/proxy", + "submodules": {}, + "elements": {}, + "classes": { + "ArrayProxy": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/array/proxy.ts", + "line": 59 + }, + "@ember/canary-features": { + "name": "@ember/canary-features", + "submodules": {}, + "elements": {}, + "classes": { + "FEATURES": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/canary-features/index.ts", + "line": 18, + "description": "Set `EmberENV.FEATURES` in your application's `config/environment.js` file\nto enable canary features in your application.\n\nSee the [feature flag guide](https://guides.emberjs.com/release/configuring-ember/feature-flags/)\nfor more details.", + "access": "public", + "tagname": "" + }, + "@ember/component/template-only": { + "name": "@ember/component/template-only", + "submodules": {}, + "elements": {}, + "classes": { + "@ember/component/template-only": 1 + }, + "fors": { + "@ember/component/template-only": 1 + }, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/component/template-only.ts", + "line": 1, + "access": "public", + "tagname": "" + }, + "@ember/controller": { + "name": "@ember/controller", + "submodules": {}, + "elements": {}, + "classes": { + "Ember.ControllerMixin": 1, + "Ember.Controller": 1, + "Ember.@ember/controller": 1 + }, + "fors": { + "Ember.ControllerMixin": 1, + "@ember/controller": 1 + }, + "namespaces": { + "Ember": 1 + }, + "tag": "module", + "file": "packages/@ember/controller/index.ts", + "line": 308 + }, + "@ember/debug": { + "name": "@ember/debug", + "submodules": { + "undefined": 1 + }, + "elements": {}, + "classes": { + "@ember/debug": 1 + }, + "fors": { + "@ember/debug": 1 + }, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/debug/index.ts", + "line": 134, + "access": "public", + "tagname": "" + }, + "@ember/debug/container-debug-adapter": { + "name": "@ember/debug/container-debug-adapter", + "submodules": {}, + "elements": {}, + "classes": { + "ContainerDebugAdapter": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/debug/container-debug-adapter.ts", + "line": 13 + }, + "@ember/debug/data-adapter": { + "name": "@ember/debug/data-adapter", + "submodules": {}, + "elements": {}, + "classes": { + "DataAdapter": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/debug/data-adapter.ts", + "line": 178 + }, + "@ember/destroyable": { + "name": "@ember/destroyable", + "submodules": {}, + "elements": {}, + "classes": { + "@ember/destroyable": 1 + }, + "fors": { + "@ember/destroyable": 1 + }, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/destroyable/index.ts", + "line": 15, + "description": "Ember manages the lifecycles and lifetimes of many built in constructs, such\nas components, and does so in a hierarchical way - when a parent component is\ndestroyed, all of its children are destroyed as well.\n\nThis destroyables API exposes the basic building blocks for destruction:\n\n* registering a function to be ran when an object is destroyed\n* checking if an object is in a destroying state\n* associate an object as a child of another so that the child object will be destroyed\n when the associated parent object is destroyed.", + "access": "public", + "tagname": "" + }, + "@ember/engine": { + "name": "@ember/engine", + "submodules": {}, + "elements": {}, + "classes": { + "@ember/engine": 1, + "Engine": 1, + "EngineInstance": 1 + }, + "fors": { + "@ember/engine": 1 + }, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/engine/instance.ts", + "line": 36 + }, + "@ember/enumerable": { + "name": "@ember/enumerable", + "submodules": {}, + "elements": {}, + "classes": { + "Enumerable": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/enumerable/index.ts", + "line": 8, + "access": "private", + "tagname": "" + }, + "@ember/helper": { + "name": "@ember/helper", + "submodules": {}, + "elements": {}, + "classes": {}, + "fors": { + "@ember/helper": 1 + }, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/helper/index.ts", + "line": 1 + }, + "@ember/instrumentation": { + "name": "@ember/instrumentation", + "submodules": {}, + "elements": {}, + "classes": { + "Instrumentation": 1, + "@ember/instrumentation": 1 + }, + "fors": { + "@ember/instrumentation": 1 + }, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/instrumentation/index.ts", + "line": 39, + "access": "private", + "tagname": "" + }, + "@ember/object/core": { + "name": "@ember/object/core", + "submodules": {}, + "elements": {}, + "classes": { + "CoreObject": 1 + }, + "fors": { + "@ember/object": 1 + }, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/object/core.ts", + "line": 175 + }, + "@ember/object/evented": { + "name": "@ember/object/evented", + "submodules": {}, + "elements": {}, + "classes": { + "Evented": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/object/evented.ts", + "line": 10 + }, + "@ember/object/mixin": { + "name": "@ember/object/mixin", + "submodules": {}, + "elements": {}, + "classes": { + "Mixin": 1, + "@ember/object/mixin": 1 + }, + "fors": { + "@ember/object/mixin": 1 + }, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/object/mixin.ts", + "line": 455 + }, + "@ember/object/observable": { + "name": "@ember/object/observable", + "submodules": {}, + "elements": {}, + "classes": { + "Observable": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/object/observable.ts", + "line": 22 + }, + "@ember/object/promise-proxy-mixin": { + "name": "@ember/object/promise-proxy-mixin", + "submodules": {}, + "elements": {}, + "classes": { + "PromiseProxyMixin": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/object/promise-proxy-mixin.ts", + "line": 46 + }, + "@ember/object/proxy": { + "name": "@ember/object/proxy", + "submodules": {}, + "elements": {}, + "classes": { + "ObjectProxy": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/object/proxy.ts", + "line": 8 + }, + "@ember/renderer": { + "name": "@ember/renderer", + "submodules": {}, + "elements": {}, + "classes": { + "Renderer": 1, + "BucketCache": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/routing/lib/cache.ts", + "line": 1, + "access": "public", + "tagname": "" + }, + "ember/routing": { + "name": "ember/routing", + "submodules": {}, + "elements": {}, + "classes": {}, + "fors": { + "Ember": 1 + }, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/routing/lib/controller_for.ts", + "line": 5 + }, + "@ember/routing/hash-location": { + "name": "@ember/routing/hash-location", + "submodules": {}, + "elements": {}, + "classes": { + "HashLocation": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/routing/hash-location.ts", + "line": 10 + }, + "@ember/routing/history-location": { + "name": "@ember/routing/history-location", + "submodules": {}, + "elements": {}, + "classes": { + "HistoryLocation": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/routing/history-location.ts", + "line": 21 + }, + "@ember/routing/location": { + "name": "@ember/routing/location", + "submodules": {}, + "elements": {}, + "classes": { + "@ember/routing/location": 1, + "Location": 1 + }, + "fors": { + "@ember/routing/location": 1 + }, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/routing/location.ts", + "line": 5 + }, + "@ember/routing/none-location": { + "name": "@ember/routing/none-location", + "submodules": {}, + "elements": {}, + "classes": { + "NoneLocation": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/routing/none-location.ts", + "line": 9 + }, + "@ember/routing/route-info": { + "name": "@ember/routing/route-info", + "submodules": {}, + "elements": {}, + "classes": { + "RouteInfo": 1, + "RouteInfoWithAttributes": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/routing/route-info.ts", + "line": 124, + "description": "Re-exports the `RouteInfo` and `RouteInfoWithMetadata` types from [router.js].\n`RouteInfo` and `RouteInfoWithMetadata` appear as properties on `Transition`\ninstances.\n\n[router.js]: https://github.com/tildeio/router.js" + }, + "@ember/routing/route": { + "name": "@ember/routing/route", + "submodules": {}, + "elements": {}, + "classes": { + "Route": 1 + }, + "fors": { + "Route": 1 + }, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/routing/route.ts", + "line": 79 + }, + "@ember/routing/router-service": { + "name": "@ember/routing/router-service", + "submodules": {}, + "elements": {}, + "classes": { + "RouterService": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/routing/router-service.ts", + "line": 27 + }, + "@ember/routing/router": { + "name": "@ember/routing/router", + "submodules": {}, + "elements": {}, + "classes": { + "EmberRouter": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/routing/router.ts", + "line": 145 + }, + "@ember/routing/transition": { + "name": "@ember/routing/transition", + "submodules": {}, + "elements": {}, + "classes": { + "Transition": 1 + }, + "fors": {}, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/routing/transition.ts", + "line": 10, + "description": "Re-exports the `Transition` type from [router.js]. `Transition`s are used in\nEmber's `Route` hooks and `RouterService` events.\n\n[router.js]: https://github.com/tildeio/router.js" + }, + "@ember/runloop": { + "name": "@ember/runloop", + "submodules": {}, + "elements": {}, + "classes": { + "@ember/runloop": 1 + }, + "fors": { + "@ember/runloop": 1 + }, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/runloop/index.ts", + "line": 101 + }, + "@ember/service": { + "name": "@ember/service", + "submodules": {}, + "elements": {}, + "classes": { + "@ember/service": 1, + "Service": 1 + }, + "fors": { + "@ember/service": 1 + }, + "namespaces": {}, + "tag": "module", + "file": "packages/@ember/service/index.ts", + "line": 87, + "access": "public", + "tagname": "" + }, + "@ember/test": { + "name": "@ember/test", + "submodules": {}, + "elements": {}, + "classes": { + "TestAdapter": 1, + "@ember/test": 1 + }, + "fors": { + "@ember/test": 1, + "Ember.Test": 1 + }, + "namespaces": { + "Ember": 1 + }, + "tag": "module", + "file": "packages/ember-testing/lib/adapters/adapter.ts", + "line": 7 + } + }, + "classes": { + "Promise": { + "name": "Promise", + "shortname": "Promise", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "rsvp", + "file": "node_modules/rsvp/lib/rsvp/promise.js", + "line": 26, + "description": "Promise objects represent the eventual result of an asynchronous operation. The\nprimary way of interacting with a promise is through its `then` method, which\nregisters callbacks to receive either a promise’s eventual value or the reason\nwhy the promise cannot be fulfilled.\n\nTerminology\n-----------\n\n- `promise` is an object or function with a `then` method whose behavior conforms to this specification.\n- `thenable` is an object or function that defines a `then` method.\n- `value` is any legal JavaScript value (including undefined, a thenable, or a promise).\n- `exception` is a value that is thrown using the throw statement.\n- `reason` is a value that indicates why a promise was rejected.\n- `settled` the final resting state of a promise, fulfilled or rejected.\n\nA promise can be in one of three states: pending, fulfilled, or rejected.\n\nPromises that are fulfilled have a fulfillment value and are in the fulfilled\nstate. Promises that are rejected have a rejection reason and are in the\nrejected state. A fulfillment value is never a thenable.\n\nPromises can also be said to *resolve* a value. If this value is also a\npromise, then the original promise's settled state will match the value's\nsettled state. So a promise that *resolves* a promise that rejects will\nitself reject, and a promise that *resolves* a promise that fulfills will\nitself fulfill.\n\n\nBasic Usage:\n------------\n\n```js\nlet promise = new Promise(function(resolve, reject) {\n // on success\n resolve(value);\n\n // on failure\n reject(reason);\n});\n\npromise.then(function(value) {\n // on fulfillment\n}, function(reason) {\n // on rejection\n});\n```\n\nAdvanced Usage:\n---------------\n\nPromises shine when abstracting away asynchronous interactions such as\n`XMLHttpRequest`s.\n\n```js\nfunction getJSON(url) {\n return new Promise(function(resolve, reject){\n let xhr = new XMLHttpRequest();\n\n xhr.open('GET', url);\n xhr.onreadystatechange = handler;\n xhr.responseType = 'json';\n xhr.setRequestHeader('Accept', 'application/json');\n xhr.send();\n\n function handler() {\n if (this.readyState === this.DONE) {\n if (this.status === 200) {\n resolve(this.response);\n } else {\n reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']'));\n }\n }\n };\n });\n}\n\ngetJSON('/posts.json').then(function(json) {\n // on fulfillment\n}, function(reason) {\n // on rejection\n});\n```\n\nUnlike callbacks, promises are great composable primitives.\n\n```js\nPromise.all([\n getJSON('/posts'),\n getJSON('/comments')\n]).then(function(values){\n values[0] // => postsJSON\n values[1] // => commentsJSON\n\n return values;\n});\n```", + "access": "public", + "tagname": "", + "params": [ + { + "name": "resolver", + "description": "", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "is_constructor": 1 + }, + "rsvp": { + "name": "rsvp", + "shortname": "rsvp", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "rsvp", + "namespace": "" + }, + "EventTarget": { + "name": "EventTarget", + "shortname": "EventTarget", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "rsvp", + "namespace": "", + "file": "node_modules/rsvp/lib/rsvp/events.js", + "line": 12, + "access": "public", + "tagname": "" + }, + "Container": { + "name": "Container", + "shortname": "Container", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "rsvp", + "namespace": "", + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 60, + "description": "A container used to instantiate and cache objects.\n\nEvery `Container` must be associated with a `Registry`, which is referenced\nto determine the factory and options that should be used to instantiate\nobjects.\n\nThe public API for `Container` is still in flux and should not be considered\nstable.", + "access": "private", + "tagname": "" + }, + "Registry": { + "name": "Registry", + "shortname": "Registry", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "rsvp", + "namespace": "", + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 36, + "description": "A registry used to store factory and option information keyed\nby type.\n\nA `Registry` stores the factory and option information needed by a\n`Container` to instantiate and cache objects.\n\nThe API for `Registry` is still in flux and should not be considered stable.", + "access": "private", + "tagname": "", + "since": "1.11.0" + }, + "EmberENV": { + "name": "EmberENV", + "shortname": "EmberENV", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "rsvp", + "namespace": "", + "file": "packages/@ember/-internals/environment/lib/env.ts", + "line": 4, + "description": "The hash of environment variables used to control various configuration\nsettings. To specify your own or override default settings, add the\ndesired properties to a global hash named `EmberENV` (or `ENV` for\nbackwards compatibility with earlier versions of Ember). The `EmberENV`\nhash must be created before loading Ember.", + "type": "Object", + "access": "public", + "tagname": "" + }, + "Ember.Templates.helpers": { + "name": "Ember.Templates.helpers", + "shortname": "Ember.Templates.helpers", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "", + "file": "packages/@ember/-internals/glimmer/index.ts", + "line": 86, + "access": "public", + "tagname": "" + }, + "@ember/component": { + "name": "@ember/component", + "shortname": "@ember/component", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/component", + "namespace": "" + }, + "Ember.Templates.components": { + "name": "Ember.Templates.components", + "shortname": "Ember.Templates.components", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "" + }, + "@ember/routing": { + "name": "@ember/routing", + "shortname": "@ember/routing", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing", + "namespace": "" + }, + "@ember/helper": { + "name": "@ember/helper", + "shortname": "@ember/helper", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "" + }, + "ComponentStateBucket": { + "name": "ComponentStateBucket", + "shortname": "ComponentStateBucket", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "", + "file": "packages/@ember/-internals/glimmer/lib/utils/curly-component-state-bucket.ts", + "line": 17, + "description": "Represents the internal state of the component.", + "access": "private", + "tagname": "" + }, + "@ember/template": { + "name": "@ember/template", + "shortname": "@ember/template", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/template", + "namespace": "" + }, + "SafeString": { + "name": "SafeString", + "shortname": "SafeString", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/template", + "namespace": "", + "file": "packages/@ember/-internals/glimmer/lib/utils/string.ts", + "line": 7, + "description": "A wrapper around a string that has been marked as safe (\"trusted\"). **When\nrendered in HTML, Ember will not perform any escaping.**\n\nNote:\n\n1. This does not *make* the string safe; it means that some code in your\n application has *marked* it as safe using the `htmlSafe()` function.\n\n2. The only public API for getting a `SafeString` is calling `htmlSafe()`. It\n is *not* user-constructible.\n\nIf a string contains user inputs or other untrusted data, you must sanitize\nthe string before using the `htmlSafe` method. Otherwise your code is\nvulnerable to [Cross-Site Scripting][xss]. There are many open source\nsanitization libraries to choose from, both for front end and server-side\nsanitization.\n\n[xss]: https://owasp.org/www-community/attacks/DOM_Based_XSS\n\n```javascript\nimport { htmlSafe } from '@ember/template';\n\nlet someTrustedOrSanitizedString = \"
Hello!
\"\n\nhtmlSafe(someTrustedorSanitizedString);\n```", + "since": "4.12.0", + "access": "public", + "tagname": "" + }, + "Component": { + "name": "Component", + "shortname": "Component", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/component", + "namespace": "", + "file": "packages/@ember/-internals/glimmer/lib/component.ts", + "line": 187, + "description": "A component is a reusable UI element that consists of a `.hbs` template and an\noptional JavaScript class that defines its behavior. For example, someone\nmight make a `button` in the template and handle the click behavior in the\nJavaScript file that shares the same name as the template.\n\nComponents are broken down into two categories:\n\n- Components _without_ JavaScript, that are based only on a template. These\n are called Template-only or TO components.\n- Components _with_ JavaScript, which consist of a template and a backing\n class.\n\nEmber ships with two types of JavaScript classes for components:\n\n1. Glimmer components, imported from `@glimmer/component`, which are the\n default component's for Ember Octane (3.15) and more recent editions.\n2. Classic components, imported from `@ember/component`, which were the\n default for older editions of Ember (pre 3.15).\n\nBelow is the documentation for Classic components. If you are looking for the\nAPI documentation for Template-only or Glimmer components, it is\n[available here](/ember/release/modules/@glimmer%2Fcomponent).\n\n## Defining a Classic Component\n\nIf you want to customize the component in order to handle events, transform\narguments or maintain internal state, you implement a subclass of `Component`.\n\nOne example is to add computed properties to your component:\n\n```app/components/person-profile.js\nimport Component from '@ember/component';\n\nexport default Component.extend({\n displayName: computed('person.title', 'person.firstName', 'person.lastName', function() {\n let { title, firstName, lastName } = this.person;\n\n if (title) {\n return `${title} ${lastName}`;\n } else {\n return `${firstName} ${lastName}`;\n }\n })\n});\n```\n\nAnd then use it in the component's template:\n\n```app/templates/components/person-profile.hbs\n

{{this.displayName}}

\n{{yield}}\n```\n\n## Customizing a Classic Component's HTML Element in JavaScript\n\n### HTML Tag\n\nThe default HTML tag name used for a component's HTML representation is `div`.\nThis can be customized by setting the `tagName` property.\n\nConsider the following component class:\n\n```app/components/emphasized-paragraph.js\nimport Component from '@ember/component';\n\nexport default Component.extend({\n tagName: 'em'\n});\n```\n\nWhen invoked, this component would produce output that looks something like\nthis:\n\n```html\n\n```\n\n### HTML `class` Attribute\n\nThe HTML `class` attribute of a component's tag can be set by providing a\n`classNames` property that is set to an array of strings:\n\n```app/components/my-widget.js\nimport Component from '@ember/component';\n\nexport default Component.extend({\n classNames: ['my-class', 'my-other-class']\n});\n```\n\nInvoking this component will produce output that looks like this:\n\n```html\n
\n```\n\n`class` attribute values can also be set by providing a `classNameBindings`\nproperty set to an array of properties names for the component. The return\nvalue of these properties will be added as part of the value for the\ncomponents's `class` attribute. These properties can be computed properties:\n\n```app/components/my-widget.js\nimport Component from '@ember/component';\nimport { computed } from '@ember/object';\n\nexport default Component.extend({\n classNames: ['my-class', 'my-other-class'],\n classNameBindings: ['propertyA', 'propertyB'],\n\n propertyA: 'from-a',\n propertyB: computed(function() {\n if (someLogic) { return 'from-b'; }\n })\n});\n```\n\nInvoking this component will produce HTML that looks like:\n\n```html\n
\n```\n\nNote that `classNames` and `classNameBindings` is in addition to the `class`\nattribute passed with the angle bracket invocation syntax. Therefore, if this\ncomponent was invoked like so:\n\n```handlebars\n\n```\n\nThe resulting HTML will look similar to this:\n\n```html\n
\n```\n\nIf the value of a class name binding returns a boolean the property name\nitself will be used as the class name if the property is true. The class name\nwill not be added if the value is `false` or `undefined`.\n\n```app/components/my-widget.js\nimport Component from '@ember/component';\n\nexport default Component.extend({\n classNameBindings: ['hovered'],\n\n hovered: true\n});\n```\n\nInvoking this component will produce HTML that looks like:\n\n```html\n
\n```\n\n### Custom Class Names for Boolean Values\n\nWhen using boolean class name bindings you can supply a string value other\nthan the property name for use as the `class` HTML attribute by appending the\npreferred value after a \":\" character when defining the binding:\n\n```app/components/my-widget.js\nimport Component from '@ember/component';\n\nexport default Component.extend({\n classNameBindings: ['awesome:so-very-cool'],\n\n awesome: true\n});\n```\n\nInvoking this component will produce HTML that looks like:\n\n```html\n
\n```\n\nBoolean value class name bindings whose property names are in a\ncamelCase-style format will be converted to a dasherized format:\n\n```app/components/my-widget.js\nimport Component from '@ember/component';\n\nexport default Component.extend({\n classNameBindings: ['isUrgent'],\n\n isUrgent: true\n});\n```\n\nInvoking this component will produce HTML that looks like:\n\n```html\n
\n```\n\nClass name bindings can also refer to object values that are found by\ntraversing a path relative to the component itself:\n\n```app/components/my-widget.js\nimport Component from '@ember/component';\nimport EmberObject from '@ember/object';\n\nexport default Component.extend({\n classNameBindings: ['messages.empty'],\n\n messages: EmberObject.create({\n empty: true\n })\n});\n```\n\nInvoking this component will produce HTML that looks like:\n\n```html\n
\n```\n\nIf you want to add a class name for a property which evaluates to true and\nand a different class name if it evaluates to false, you can pass a binding\nlike this:\n\n```app/components/my-widget.js\nimport Component from '@ember/component';\n\nexport default Component.extend({\n classNameBindings: ['isEnabled:enabled:disabled'],\n isEnabled: true\n});\n```\n\nInvoking this component will produce HTML that looks like:\n\n```html\n
\n```\n\nWhen isEnabled is `false`, the resulting HTML representation looks like this:\n\n```html\n
\n```\n\nThis syntax offers the convenience to add a class if a property is `false`:\n\n```app/components/my-widget.js\nimport Component from '@ember/component';\n\n// Applies no class when isEnabled is true and class 'disabled' when isEnabled is false\nexport default Component.extend({\n classNameBindings: ['isEnabled::disabled'],\n isEnabled: true\n});\n```\n\nInvoking this component when the `isEnabled` property is true will produce\nHTML that looks like:\n\n```html\n
\n```\n\nInvoking it when the `isEnabled` property on the component is `false` will\nproduce HTML that looks like:\n\n```html\n
\n```\n\nUpdates to the value of a class name binding will result in automatic update\nof the HTML `class` attribute in the component's rendered HTML\nrepresentation. If the value becomes `false` or `undefined` the class name\nwill be removed.\n\nBoth `classNames` and `classNameBindings` are concatenated properties. See\n[EmberObject](/ember/release/classes/EmberObject) documentation for more\ninformation about concatenated properties.\n\n### Other HTML Attributes\n\nThe HTML attribute section of a component's tag can be set by providing an\n`attributeBindings` property set to an array of property names on the component.\nThe return value of these properties will be used as the value of the component's\nHTML associated attribute:\n\n```app/components/my-anchor.js\nimport Component from '@ember/component';\n\nexport default Component.extend({\n tagName: 'a',\n attributeBindings: ['href'],\n\n href: 'http://google.com'\n});\n```\n\nInvoking this component will produce HTML that looks like:\n\n```html\n\n```\n\nOne property can be mapped on to another by placing a \":\" between\nthe source property and the destination property:\n\n```app/components/my-anchor.js\nimport Component from '@ember/component';\n\nexport default Component.extend({\n tagName: 'a',\n attributeBindings: ['url:href'],\n\n url: 'http://google.com'\n});\n```\n\nInvoking this component will produce HTML that looks like:\n\n```html\n\n```\n\nHTML attributes passed with angle bracket invocations will take precedence\nover those specified in `attributeBindings`. Therefore, if this component was\ninvoked like so:\n\n```handlebars\n\n```\n\nThe resulting HTML will looks like this:\n\n```html\n\n```\n\nNote that the `href` attribute is ultimately set to `http://bing.com`,\ndespite it having attribute binidng to the `url` property, which was\nset to `http://google.com`.\n\nNamespaced attributes (e.g. `xlink:href`) are supported, but have to be\nmapped, since `:` is not a valid character for properties in Javascript:\n\n```app/components/my-use.js\nimport Component from '@ember/component';\n\nexport default Component.extend({\n tagName: 'use',\n attributeBindings: ['xlinkHref:xlink:href'],\n\n xlinkHref: '#triangle'\n});\n```\n\nInvoking this component will produce HTML that looks like:\n\n```html\n\n```\n\nIf the value of a property monitored by `attributeBindings` is a boolean, the\nattribute will be present or absent depending on the value:\n\n```app/components/my-text-input.js\nimport Component from '@ember/component';\n\nexport default Component.extend({\n tagName: 'input',\n attributeBindings: ['disabled'],\n\n disabled: false\n});\n```\n\nInvoking this component will produce HTML that looks like:\n\n```html\n\n```\n\n`attributeBindings` can refer to computed properties:\n\n```app/components/my-text-input.js\nimport Component from '@ember/component';\nimport { computed } from '@ember/object';\n\nexport default Component.extend({\n tagName: 'input',\n attributeBindings: ['disabled'],\n\n disabled: computed(function() {\n if (someLogic) {\n return true;\n } else {\n return false;\n }\n })\n});\n```\n\nTo prevent setting an attribute altogether, use `null` or `undefined` as the\nvalue of the property used in `attributeBindings`:\n\n```app/components/my-text-input.js\nimport Component from '@ember/component';\n\nexport default Component.extend({\n tagName: 'form',\n attributeBindings: ['novalidate'],\n novalidate: null\n});\n```\n\nUpdates to the property of an attribute binding will result in automatic\nupdate of the HTML attribute in the component's HTML output.\n\n`attributeBindings` is a concatenated property. See\n[EmberObject](/ember/release/classes/EmberObject) documentation for more\ninformation about concatenated properties.\n\n## Layouts\n\nThe `layout` property can be used to dynamically specify a template associated\nwith a component class, instead of relying on Ember to link together a\ncomponent class and a template based on file names.\n\nIn general, applications should not use this feature, but it's commonly used\nin addons for historical reasons.\n\nThe `layout` property should be set to the default export of a template\nmodule, which is the name of a template file without the `.hbs` extension.\n\n```app/templates/components/person-profile.hbs\n

Person's Title

\n
{{yield}}
\n```\n\n```app/components/person-profile.js\n import Component from '@ember/component';\n import layout from '../templates/components/person-profile';\n\n export default Component.extend({\n layout\n });\n```\n\nIf you invoke the component:\n\n```handlebars\n\n

Chief Basket Weaver

\n

Fisherman Industries

\n
\n```\n\nor\n\n```handlebars\n{{#person-profile}}\n

Chief Basket Weaver

\n

Fisherman Industries

\n{{/person-profile}}\n```\n\nIt will result in the following HTML output:\n\n```html\n

Person's Title

\n
\n

Chief Basket Weaver

\n

Fisherman Industries

\n
\n```\n\n## Handling Browser Events\n\nComponents can respond to user-initiated events in one of three ways: passing\nactions with angle bracket invocation, adding event handler methods to the\ncomponent's class, or adding actions to the component's template.\n\n### Passing Actions With Angle Bracket Invocation\n\nFor one-off events specific to particular instance of a component, it is possible\nto pass actions to the component's element using angle bracket invocation syntax.\n\n```handlebars\n\n\n\n```\n\nIn this case, when the first component is clicked on, Ember will invoke the\n`firstWidgetClicked` action. When the second component is clicked on, Ember\nwill invoke the `secondWidgetClicked` action instead.\n\nBesides `{{action}}`, it is also possible to pass any arbitrary element modifiers\nusing the angle bracket invocation syntax.\n\n### Event Handler Methods\n\nComponents can also respond to user-initiated events by implementing a method\nthat matches the event name. This approach is appropriate when the same event\nshould be handled by all instances of the same component.\n\nAn event object will be passed as the argument to the event handler method.\n\n```app/components/my-widget.js\nimport Component from '@ember/component';\n\nexport default Component.extend({\n click(event) {\n // `event.target` is either the component's element or one of its children\n let tag = event.target.tagName.toLowerCase();\n console.log('clicked on a `<${tag}>` HTML element!');\n }\n});\n```\n\nIn this example, whenever the user clicked anywhere inside the component, it\nwill log a message to the console.\n\nIt is possible to handle event types other than `click` by implementing the\nfollowing event handler methods. In addition, custom events can be registered\nby using `Application.customEvents`.\n\nTouch events:\n\n* `touchStart`\n* `touchMove`\n* `touchEnd`\n* `touchCancel`\n\nKeyboard events:\n\n* `keyDown`\n* `keyUp`\n* `keyPress`\n\nMouse events:\n\n* `mouseDown`\n* `mouseUp`\n* `contextMenu`\n* `click`\n* `doubleClick`\n* `focusIn`\n* `focusOut`\n\nForm events:\n\n* `submit`\n* `change`\n* `focusIn`\n* `focusOut`\n* `input`\n\nDrag and drop events:\n\n* `dragStart`\n* `drag`\n* `dragEnter`\n* `dragLeave`\n* `dragOver`\n* `dragEnd`\n* `drop`\n\n### `{{action}}` Helper\n\nInstead of handling all events of a particular type anywhere inside the\ncomponent's element, you may instead want to limit it to a particular\nelement in the component's template. In this case, it would be more\nconvenient to implement an action instead.\n\nFor example, you could implement the action `hello` for the `person-profile`\ncomponent:\n\n```app/components/person-profile.js\nimport Component from '@ember/component';\n\nexport default Component.extend({\n actions: {\n hello(name) {\n console.log(\"Hello\", name);\n }\n }\n});\n```\n\nAnd then use it in the component's template:\n\n```app/templates/components/person-profile.hbs\n

{{@person.name}}

\n\n\n```\n\nWhen the user clicks the button, Ember will invoke the `hello` action,\npassing in the current value of `@person.name` as an argument.\n\nSee [Ember.Templates.helpers.action](/ember/release/classes/Ember.Templates.helpers/methods/action?anchor=action).", + "extends": "Ember.CoreView", + "uses": [ + "Ember.TargetActionSupport", + "Ember.ClassNamesSupport", + "Ember.ActionSupport", + "Ember.ViewMixin", + "Ember.ViewStateSupport" + ], + "access": "public", + "tagname": "" + }, + "@glimmer/tracking": { + "name": "@glimmer/tracking", + "shortname": "@glimmer/tracking", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@glimmer/tracking", + "namespace": "" + }, + "Helper": { + "name": "Helper", + "shortname": "Helper", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/component", + "namespace": "", + "file": "packages/@ember/-internals/glimmer/lib/helper.ts", + "line": 53, + "description": "Ember Helpers are functions that can compute values, and are used in templates.\nFor example, this code calls a helper named `format-currency`:\n\n```app/templates/application.hbs\n\n```\n\n```app/components/cost.hbs\n
{{format-currency @cents currency=\"$\"}}
\n```\n\nAdditionally a helper can be called as a nested helper.\nIn this example, we show the formatted currency value if the `showMoney`\nnamed argument is truthy.\n\n```handlebars\n{{if @showMoney (format-currency @cents currency=\"$\")}}\n```\n\nHelpers defined using a class must provide a `compute` function. For example:\n\n```app/helpers/format-currency.js\nimport Helper from '@ember/component/helper';\n\nexport default class extends Helper {\n compute([cents], { currency }) {\n return `${currency}${cents * 0.01}`;\n }\n}\n```\n\nEach time the input to a helper changes, the `compute` function will be\ncalled again.\n\nAs instances, these helpers also have access to the container and will accept\ninjected dependencies.\n\nAdditionally, class helpers can call `recompute` to force a new computation.", + "extends": "CoreObject", + "access": "public", + "tagname": "", + "since": "1.13.0" + }, + "@ember/component/helper": { + "name": "@ember/component/helper", + "shortname": "@ember/component/helper", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/component", + "namespace": "" + }, + "Ember": { + "name": "Ember", + "shortname": "Ember", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/utils", + "namespace": "" + }, + "@glimmer/tracking/primitives/cache": { + "name": "@glimmer/tracking/primitives/cache", + "shortname": "@glimmer/tracking/primitives/cache", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@glimmer/tracking/primitives/cache", + "namespace": "" + }, + "ComputedProperty": { + "name": "ComputedProperty", + "shortname": "ComputedProperty", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/-internals/metal/lib/computed.ts", + "line": 76, + "description": "`@computed` is a decorator that turns a JavaScript getter and setter into a\ncomputed property, which is a _cached, trackable value_. By default the getter\nwill only be called once and the result will be cached. You can specify\nvarious properties that your computed property depends on. This will force the\ncached result to be cleared if the dependencies are modified, and lazily recomputed the next time something asks for it.\n\nIn the following example we decorate a getter - `fullName` - by calling\n`computed` with the property dependencies (`firstName` and `lastName`) as\narguments. The `fullName` getter will be called once (regardless of how many\ntimes it is accessed) as long as its dependencies do not change. Once\n`firstName` or `lastName` are updated any future calls to `fullName` will\nincorporate the new values, and any watchers of the value such as templates\nwill be updated:\n\n```javascript\nimport { computed, set } from '@ember/object';\n\nclass Person {\n constructor(firstName, lastName) {\n set(this, 'firstName', firstName);\n set(this, 'lastName', lastName);\n }\n\n @computed('firstName', 'lastName')\n get fullName() {\n return `${this.firstName} ${this.lastName}`;\n }\n});\n\nlet tom = new Person('Tom', 'Dale');\n\ntom.fullName; // 'Tom Dale'\n```\n\nYou can also provide a setter, which will be used when updating the computed\nproperty. Ember's `set` function must be used to update the property\nsince it will also notify observers of the property:\n\n```javascript\nimport { computed, set } from '@ember/object';\n\nclass Person {\n constructor(firstName, lastName) {\n set(this, 'firstName', firstName);\n set(this, 'lastName', lastName);\n }\n\n @computed('firstName', 'lastName')\n get fullName() {\n return `${this.firstName} ${this.lastName}`;\n }\n\n set fullName(value) {\n let [firstName, lastName] = value.split(' ');\n\n set(this, 'firstName', firstName);\n set(this, 'lastName', lastName);\n }\n});\n\nlet person = new Person();\n\nset(person, 'fullName', 'Peter Wagenet');\nperson.firstName; // 'Peter'\nperson.lastName; // 'Wagenet'\n```\n\nYou can also pass a getter function or object with `get` and `set` functions\nas the last argument to the computed decorator. This allows you to define\ncomputed property _macros_:\n\n```js\nimport { computed } from '@ember/object';\n\nfunction join(...keys) {\n return computed(...keys, function() {\n return keys.map(key => this[key]).join(' ');\n });\n}\n\nclass Person {\n @join('firstName', 'lastName')\n fullName;\n}\n```\n\nNote that when defined this way, getters and setters receive the _key_ of the\nproperty they are decorating as the first argument. Setters receive the value\nthey are setting to as the second argument instead. Additionally, setters must\n_return_ the value that should be cached:\n\n```javascript\nimport { computed, set } from '@ember/object';\n\nfunction fullNameMacro(firstNameKey, lastNameKey) {\n return computed(firstNameKey, lastNameKey, {\n get() {\n return `${this[firstNameKey]} ${this[lastNameKey]}`;\n }\n\n set(key, value) {\n let [firstName, lastName] = value.split(' ');\n\n set(this, firstNameKey, firstName);\n set(this, lastNameKey, lastName);\n\n return value;\n }\n });\n}\n\nclass Person {\n constructor(firstName, lastName) {\n set(this, 'firstName', firstName);\n set(this, 'lastName', lastName);\n }\n\n @fullNameMacro('firstName', 'lastName') fullName;\n});\n\nlet person = new Person();\n\nset(person, 'fullName', 'Peter Wagenet');\nperson.firstName; // 'Peter'\nperson.lastName; // 'Wagenet'\n```\n\nComputed properties can also be used in classic classes. To do this, we\nprovide the getter and setter as the last argument like we would for a macro,\nand we assign it to a property on the class definition. This is an _anonymous_\ncomputed macro:\n\n```javascript\nimport EmberObject, { computed, set } from '@ember/object';\n\nlet Person = EmberObject.extend({\n // these will be supplied by `create`\n firstName: null,\n lastName: null,\n\n fullName: computed('firstName', 'lastName', {\n get() {\n return `${this.firstName} ${this.lastName}`;\n }\n\n set(key, value) {\n let [firstName, lastName] = value.split(' ');\n\n set(this, 'firstName', firstName);\n set(this, 'lastName', lastName);\n\n return value;\n }\n })\n});\n\nlet tom = Person.create({\n firstName: 'Tom',\n lastName: 'Dale'\n});\n\ntom.get('fullName') // 'Tom Dale'\n```\n\nYou can overwrite computed property without setters with a normal property (no\nlonger computed) that won't change if dependencies change. You can also mark\ncomputed property as `.readOnly()` and block all attempts to set it.\n\n```javascript\nimport { computed, set } from '@ember/object';\n\nclass Person {\n constructor(firstName, lastName) {\n set(this, 'firstName', firstName);\n set(this, 'lastName', lastName);\n }\n\n @computed('firstName', 'lastName').readOnly()\n get fullName() {\n return `${this.firstName} ${this.lastName}`;\n }\n});\n\nlet person = new Person();\nperson.set('fullName', 'Peter Wagenet'); // Uncaught Error: Cannot set read-only property \"fullName\" on object: <(...):emberXXX>\n```\n\nAdditional resources:\n- [Decorators RFC](https://github.com/emberjs/rfcs/blob/master/text/0408-decorators.md)\n- [New CP syntax RFC](https://github.com/emberjs/rfcs/blob/master/text/0011-improved-cp-syntax.md)\n- [New computed syntax explained in \"Ember 1.12 released\" ](https://emberjs.com/blog/2015/05/13/ember-1-12-released.html#toc_new-computed-syntax)", + "access": "public", + "tagname": "" + }, + "@ember/object": { + "name": "@ember/object", + "shortname": "@ember/object", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "" + }, + "@ember/debug": { + "name": "@ember/debug", + "shortname": "@ember/debug", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/debug", + "namespace": "" + }, + "Descriptor": { + "name": "Descriptor", + "shortname": "Descriptor", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/-internals/metal/lib/decorator.ts", + "line": 50, + "description": "Objects of this type can implement an interface to respond to requests to\nget and set. The default implementation handles simple properties.", + "access": "private", + "tagname": "" + }, + "@ember/object/events": { + "name": "@ember/object/events", + "shortname": "@ember/object/events", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "" + }, + "@ember/object/evented": { + "name": "@ember/object/evented", + "shortname": "@ember/object/evented", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "" + }, + "@ember/object/computed": { + "name": "@ember/object/computed", + "shortname": "@ember/object/computed", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "" + }, + "Ember.InjectedProperty": { + "name": "Ember.InjectedProperty", + "shortname": "Ember.InjectedProperty", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/metal/lib/injected_property.ts", + "line": 20, + "description": "Read-only property that returns the result of a container lookup.", + "is_constructor": 1, + "params": [ + { + "name": "type", + "description": "The container type the property will lookup", + "type": "String" + }, + { + "name": "nameOrDesc", + "description": "(optional) The name the property will lookup, defaults\n to the property's name", + "type": "String" + } + ], + "access": "private", + "tagname": "" + }, + "Libraries": { + "name": "Libraries", + "shortname": "Libraries", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "", + "file": "packages/@ember/-internals/metal/lib/libraries.ts", + "line": 14, + "description": "Helper class that allows you to register your library with Ember.\n\nSingleton created at `Ember.libraries`.", + "is_constructor": 1, + "access": "private", + "tagname": "" + }, + "@ember/object/observers": { + "name": "@ember/object/observers", + "shortname": "@ember/object/observers", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "" + }, + "@ember/owner": { + "name": "@ember/owner", + "shortname": "@ember/owner", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/owner", + "namespace": "" + }, + "FullName": { + "name": "FullName", + "shortname": "FullName", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/owner", + "namespace": "", + "file": "packages/@ember/-internals/owner/index.ts", + "line": 7, + "description": "The name for a factory consists of a namespace and the name of a specific type\nwithin that namespace, like `'service:session'`.\n\n**Note:** `FullName` is *not* a class, just a contract for strings used in the\nDI system. It is currently documented as a class only due to limits in our\ndocumentation infrastructure.", + "access": "public", + "tagname": "" + }, + "BasicRegistry": { + "name": "BasicRegistry", + "shortname": "BasicRegistry", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Owner" + ], + "module": "@ember/owner", + "namespace": "", + "file": "packages/@ember/-internals/owner/index.ts", + "line": 98, + "description": "The common interface for the ability to `register()` an item, shared by the\n`Owner` and `RegistryProxy` interfaces.", + "access": "private", + "tagname": "" + }, + "BasicContainer": { + "name": "BasicContainer", + "shortname": "BasicContainer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Owner" + ], + "module": "@ember/owner", + "namespace": "", + "file": "packages/@ember/-internals/owner/index.ts", + "line": 189, + "description": "The common interface for the ability to `lookup()` or get the `factoryFor` an\nitem, shared by the `Owner` and `ContainerProxy` interfaces.", + "access": "private", + "tagname": "" + }, + "Owner": { + "name": "Owner", + "shortname": "Owner", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/owner", + "namespace": "", + "file": "packages/@ember/-internals/owner/index.ts", + "line": 294, + "description": "Framework objects in an Ember application (components, services, routes,\netc.) are created via a factory and dependency injection system. Each of\nthese objects is the responsibility of an \"owner\", which handles its\ninstantiation and manages its lifetime.\n\nAn `Owner` is not a class you construct; it is one the framework constructs\nfor you. The normal way to get access to the relevant `Owner` is using the\n`getOwner` function.", + "uses": [ + "BasicRegistry", + "BasicContainer" + ], + "since": "4.10.0", + "access": "public", + "tagname": "" + }, + "RegisterOptions": { + "name": "RegisterOptions", + "shortname": "RegisterOptions", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/owner", + "namespace": "", + "file": "packages/@ember/-internals/owner/index.ts", + "line": 313, + "description": "Interface representing the options for registering an item as a factory.", + "access": "public", + "tagname": "" + }, + "Factory": { + "name": "Factory", + "shortname": "Factory", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/owner", + "namespace": "", + "file": "packages/@ember/-internals/owner/index.ts", + "line": 346, + "description": "Registered factories are instantiated by having create called on them.\nAdditionally they are singletons by default, so each time they are looked up\nthey return the same instance.\n\nHowever, that behavior can be modified with the `instantiate` and `singleton`\noptions to the `Owner.register()` method.", + "since": "4.10.0", + "access": "public", + "tagname": "" + }, + "FactoryManager": { + "name": "FactoryManager", + "shortname": "FactoryManager", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/owner", + "namespace": "", + "file": "packages/@ember/-internals/owner/index.ts", + "line": 380, + "description": "The interface representing a manager which can be used for introspection of\nthe factory's class or for the creation of factory instances with initial\nproperties. The manager is an object with the following properties:\n\n- `class` - The registered or resolved class.\n- `create` - A function that will create an instance of the class with any\ndependencies injected.\n\n**Note:** `FactoryManager` is *not* user-constructible; the only legal way\nto get a `FactoryManager` is via `Owner.factoryFor`.", + "extends": "Factory", + "access": "public", + "tagname": "" + }, + "Resolver": { + "name": "Resolver", + "shortname": "Resolver", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/owner", + "namespace": "", + "file": "packages/@ember/-internals/owner/index.ts", + "line": 416, + "description": "A `Resolver` is the mechanism responsible for looking up code in your\napplication and converting its naming conventions into the actual classes,\nfunctions, and templates that Ember needs to resolve its dependencies, for\nexample, what template to render for a given route. It is a system that helps\nthe app resolve the lookup of JavaScript modules agnostic of what kind of\nmodule system is used, which can be AMD, CommonJS or just plain globals. It\nis used to lookup routes, models, components, templates, or anything that is\nused in your Ember app.\n\nThis interface is not a concrete class; instead, it represents the contract a\ncustom resolver must implement. Most apps never need to think about this: in\nthe default blueprint, this is supplied by the `ember-resolver` package.", + "since": "4.10.0", + "access": "public", + "tagname": "" + }, + "InternalFactory": { + "name": "InternalFactory", + "shortname": "InternalFactory", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/owner", + "namespace": "", + "file": "packages/@ember/-internals/owner/index.ts", + "line": 484, + "description": "The internal representation of a `Factory`, for the extra detail available for\nprivate use internally than we expose to consumers.", + "access": "private", + "tagname": "" + }, + "ContainerProxy": { + "name": "ContainerProxy", + "shortname": "ContainerProxy", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/owner", + "namespace": "", + "file": "packages/@ember/-internals/owner/index.ts", + "line": 563, + "description": "The interface for a container proxy, which is itself a private API used\nby the private `ContainerProxyMixin` as part of the base definition of\n`EngineInstance`.", + "access": "private", + "tagname": "", + "extends": "BasicContainer" + }, + "RegistryProxy": { + "name": "RegistryProxy", + "shortname": "RegistryProxy", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/owner", + "namespace": "", + "file": "packages/@ember/-internals/owner/index.ts", + "line": 599, + "extends": "BasicRegistry", + "access": "private", + "tagname": "" + }, + "Ember.ProxyMixin": { + "name": "Ember.ProxyMixin", + "shortname": "Ember.ProxyMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "ObjectProxy" + ], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/runtime/lib/mixins/-proxy.ts", + "line": 63, + "description": "`Ember.ProxyMixin` forwards all properties not defined by the proxy itself\nto a proxied `content` object. See ObjectProxy for more details.", + "access": "private", + "tagname": "" + }, + "Ember.ActionHandler": { + "name": "Ember.ActionHandler", + "shortname": "Ember.ActionHandler", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Ember.CoreView", + "Ember.ControllerMixin" + ], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/runtime/lib/mixins/action_handler.ts", + "line": 9, + "description": "`Ember.ActionHandler` is available on some familiar classes including\n`Route`, `Component`, and `Controller`.\n(Internally the mixin is used by `Ember.CoreView`, `Ember.ControllerMixin`,\nand `Route` and available to the above classes through\ninheritance.)", + "access": "private", + "tagname": "" + }, + "Ember.Comparable": { + "name": "Ember.Comparable", + "shortname": "Ember.Comparable", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/runtime/lib/mixins/comparable.ts", + "line": 7, + "description": "Implements some standard methods for comparing objects. Add this mixin to\nany class you create that can compare its instances.\n\nYou should implement the `compare()` method.", + "since": "Ember 0.9", + "access": "private", + "tagname": "" + }, + "ContainerProxyMixin": { + "name": "ContainerProxyMixin", + "shortname": "ContainerProxyMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "EngineInstance" + ], + "module": "ember", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/container_proxy.ts", + "line": 12, + "description": "ContainerProxyMixin is used to provide public access to specific\ncontainer functionality.", + "extends": "ContainerProxy", + "access": "private", + "tagname": "" + }, + "RegistryProxyMixin": { + "name": "RegistryProxyMixin", + "shortname": "RegistryProxyMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Engine", + "EngineInstance" + ], + "module": "ember", + "namespace": "", + "file": "packages/@ember/-internals/runtime/lib/mixins/registry_proxy.ts", + "line": 12, + "description": "RegistryProxyMixin is used to provide public access to specific\nregistry functionality.", + "extends": "RegistryProxy", + "access": "private", + "tagname": "" + }, + "Ember.TargetActionSupport": { + "name": "Ember.TargetActionSupport", + "shortname": "Ember.TargetActionSupport", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Component" + ], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/runtime/lib/mixins/target_action_support.ts", + "line": 11, + "description": "`Ember.TargetActionSupport` is a mixin that can be included in a class\nto add a `triggerAction` method with semantics similar to the Handlebars\n`{{action}}` helper. In normal Ember usage, the `{{action}}` helper is\nusually the best choice. This mixin is most often useful when you are\ndoing more complex event handling in Components.", + "extends": "Mixin", + "access": "private", + "tagname": "" + }, + "Ember.String": { + "name": "Ember.String", + "shortname": "String", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/string/index.ts", + "line": 42, + "description": "Defines string helper methods used internally in ember-source.", + "access": "private", + "tagname": "" + }, + "@ember/object/internals": { + "name": "@ember/object/internals", + "shortname": "@ember/object/internals", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "" + }, + "Ember.ActionSupport": { + "name": "Ember.ActionSupport", + "shortname": "Ember.ActionSupport", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Component" + ], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/views/lib/mixins/action_support.ts", + "line": 8, + "access": "private", + "tagname": "" + }, + "Ember.ClassNamesSupport": { + "name": "Ember.ClassNamesSupport", + "shortname": "Ember.ClassNamesSupport", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Component" + ], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/views/lib/mixins/class_names_support.ts", + "line": 10, + "access": "private", + "tagname": "" + }, + "Ember.ViewMixin": { + "name": "Ember.ViewMixin", + "shortname": "Ember.ViewMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Component" + ], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/views/lib/mixins/view_support.ts", + "line": 15, + "access": "private", + "tagname": "" + }, + "Ember.EventDispatcher": { + "name": "Ember.EventDispatcher", + "shortname": "Ember.EventDispatcher", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/views/lib/system/event_dispatcher.ts", + "line": 18, + "description": "`Ember.EventDispatcher` handles delegating browser events to their\ncorresponding `Ember.Views.` For example, when you click on a view,\n`Ember.EventDispatcher` ensures that that view's `mouseDown` method gets\ncalled.", + "access": "private", + "tagname": "", + "extends": "EmberObject" + }, + "Ember.CoreView": { + "name": "Ember.CoreView", + "shortname": "Ember.CoreView", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/-internals/views/lib/views/core_view.ts", + "line": 9, + "description": "`Ember.CoreView` is an abstract class that exists to give view-like behavior\nto both Ember's main view class `Component` and other classes that don't need\nthe full functionality of `Component`.\n\nUnless you have specific needs for `CoreView`, you will use `Component`\nin your applications.", + "extends": "EmberObject", + "deprecated": true, + "deprecationMessage": "Use `Component` instead.", + "uses": [ + "Evented", + "Ember.ActionHandler" + ], + "access": "private", + "tagname": "" + }, + "@ember/application": { + "name": "@ember/application", + "shortname": "@ember/application", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/application", + "namespace": "" + }, + "Application": { + "name": "Application", + "shortname": "Application", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/application", + "namespace": "", + "file": "packages/@ember/application/index.ts", + "line": 42, + "description": "An instance of `Application` is the starting point for every Ember\napplication. It instantiates, initializes and coordinates the\nobjects that make up your app.\n\nEach Ember app has one and only one `Application` object. Although\nEmber CLI creates this object implicitly, the `Application` class\nis defined in the `app/app.js`. You can define a `ready` method on the\n`Application` class, which will be run by Ember when the application is\ninitialized.\n\n```app/app.js\nexport default class App extends Application {\n ready() {\n // your code here\n }\n}\n```\n\nBecause `Application` ultimately inherits from `Ember.Namespace`, any classes\nyou create will have useful string representations when calling `toString()`.\nSee the `Ember.Namespace` documentation for more information.\n\nWhile you can think of your `Application` as a container that holds the\nother classes in your application, there are several other responsibilities\ngoing on under-the-hood that you may want to understand. It is also important\nto understand that an `Application` is different from an `ApplicationInstance`.\nRefer to the Guides to understand the difference between these.\n\n### Event Delegation\n\nEmber uses a technique called _event delegation_. This allows the framework\nto set up a global, shared event listener instead of requiring each view to\ndo it manually. For example, instead of each view registering its own\n`mousedown` listener on its associated element, Ember sets up a `mousedown`\nlistener on the `body`.\n\nIf a `mousedown` event occurs, Ember will look at the target of the event and\nstart walking up the DOM node tree, finding corresponding views and invoking\ntheir `mouseDown` method as it goes.\n\n`Application` has a number of default events that it listens for, as\nwell as a mapping from lowercase events to camel-cased view method names. For\nexample, the `keypress` event causes the `keyPress` method on the view to be\ncalled, the `dblclick` event causes `doubleClick` to be called, and so on.\n\nIf there is a bubbling browser event that Ember does not listen for by\ndefault, you can specify custom events and their corresponding view method\nnames by setting the application's `customEvents` property:\n\n```app/app.js\nimport Application from '@ember/application';\n\nexport default class App extends Application {\n customEvents = {\n // add support for the paste event\n paste: 'paste'\n }\n}\n```\n\nTo prevent Ember from setting up a listener for a default event,\nspecify the event name with a `null` value in the `customEvents`\nproperty:\n\n```app/app.js\nimport Application from '@ember/application';\n\nexport default class App extends Application {\n customEvents = {\n // prevent listeners for mouseenter/mouseleave events\n mouseenter: null,\n mouseleave: null\n }\n}\n```\n\nBy default, the application sets up these event listeners on the document\nbody. However, in cases where you are embedding an Ember application inside\nan existing page, you may want it to set up the listeners on an element\ninside the body.\n\nFor example, if only events inside a DOM element with the ID of `ember-app`\nshould be delegated, set your application's `rootElement` property:\n\n```app/app.js\nimport Application from '@ember/application';\n\nexport default class App extends Application {\n rootElement = '#ember-app'\n}\n```\n\nThe `rootElement` can be either a DOM element or a CSS selector\nstring. Note that *views appended to the DOM outside the root element will\nnot receive events.* If you specify a custom root element, make sure you only\nappend views inside it!\n\nTo learn more about the events Ember components use, see\n\n[components/handling-events](https://guides.emberjs.com/release/components/handling-events/#toc_event-names).\n\n### Initializers\n\nTo add behavior to the Application's boot process, you can define initializers in\nthe `app/initializers` directory, or with `ember generate initializer` using Ember CLI.\nThese files should export a named `initialize` function which will receive the created `application`\nobject as its first argument.\n\n```javascript\nexport function initialize(application) {\n // application.inject('route', 'foo', 'service:foo');\n}\n```\n\nApplication initializers can be used for a variety of reasons including:\n\n- setting up external libraries\n- injecting dependencies\n- setting up event listeners in embedded apps\n- deferring the boot process using the `deferReadiness` and `advanceReadiness` APIs.\n\n### Routing\n\nIn addition to creating your application's router, `Application` is\nalso responsible for telling the router when to start routing. Transitions\nbetween routes can be logged with the `LOG_TRANSITIONS` flag, and more\ndetailed intra-transition logging can be logged with\nthe `LOG_TRANSITIONS_INTERNAL` flag:\n\n```javascript\nimport Application from '@ember/application';\n\nlet App = Application.create({\n LOG_TRANSITIONS: true, // basic logging of successful transitions\n LOG_TRANSITIONS_INTERNAL: true // detailed logging of all routing steps\n});\n```\n\nBy default, the router will begin trying to translate the current URL into\napplication state once the browser emits the `DOMContentReady` event. If you\nneed to defer routing, you can call the application's `deferReadiness()`\nmethod. Once routing can begin, call the `advanceReadiness()` method.\n\nIf there is any setup required before routing begins, you can implement a\n`ready()` method on your app that will be invoked immediately before routing\nbegins.", + "extends": "Engine", + "access": "public", + "tagname": "" + }, + "ApplicationInstance": { + "name": "ApplicationInstance", + "shortname": "ApplicationInstance", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/application", + "namespace": "", + "file": "packages/@ember/application/instance.ts", + "line": 19, + "description": "The `ApplicationInstance` encapsulates all of the stateful aspects of a\nrunning `Application`.\n\nAt a high-level, we break application boot into two distinct phases:\n\n* Definition time, where all of the classes, templates, and other\n dependencies are loaded (typically in the browser).\n* Run time, where we begin executing the application once everything\n has loaded.\n\nDefinition time can be expensive and only needs to happen once since it is\nan idempotent operation. For example, between test runs and FastBoot\nrequests, the application stays the same. It is only the state that we want\nto reset.\n\nThat state is what the `ApplicationInstance` manages: it is responsible for\ncreating the container that contains all application state, and disposing of\nit once the particular test run or FastBoot request has finished.", + "access": "public", + "tagname": "", + "extends": "EngineInstance" + }, + "ApplicationInstance.BootOptions": { + "name": "ApplicationInstance.BootOptions", + "shortname": "ApplicationInstance.BootOptions", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/application", + "namespace": "ApplicationInstance", + "file": "packages/@ember/application/instance.ts", + "line": 316, + "description": "A list of boot-time configuration options for customizing the behavior of\nan `ApplicationInstance`.\n\nThis is an interface class that exists purely to document the available\noptions; you do not need to construct it manually. Simply pass a regular\nJavaScript object containing the desired options into methods that require\none of these options object:\n\n```javascript\nMyApp.visit(\"/\", { location: \"none\", rootElement: \"#container\" });\n```\n\nNot all combinations of the supported options are valid. See the documentation\non `Application#visit` for the supported configurations.\n\nInternal, experimental or otherwise unstable flags are marked as private.", + "access": "public", + "tagname": "" + }, + "Namespace": { + "name": "Namespace", + "shortname": "Namespace", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/application/namespace", + "namespace": "", + "file": "packages/@ember/application/namespace.ts", + "line": 20, + "description": "A Namespace is an object usually used to contain other objects or methods\nsuch as an application or framework. Create a namespace anytime you want\nto define one of these new containers.\n\n# Example Usage\n\n```javascript\nMyFramework = Ember.Namespace.create({\n VERSION: '1.0.0'\n});\n```", + "extends": "EmberObject", + "access": "public", + "tagname": "" + }, + "@ember/array": { + "name": "@ember/array", + "shortname": "@ember/array", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "" + }, + "EmberArray": { + "name": "EmberArray", + "shortname": "EmberArray", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "MutableArray" + ], + "module": "@ember/array", + "namespace": "", + "file": "packages/@ember/array/index.ts", + "line": 219, + "description": "This mixin implements Observer-friendly Array-like behavior. It is not a\nconcrete implementation, but it can be used up by other classes that want\nto appear like arrays.\n\nFor example, ArrayProxy is a concrete class that can be instantiated to\nimplement array-like behavior. This class uses the Array Mixin by way of\nthe MutableArray mixin, which allows observable changes to be made to the\nunderlying array.\n\nThis mixin defines methods specifically for collections that provide\nindex-ordered access to their contents. When you are designing code that\nneeds to accept any kind of Array-like object, you should use these methods\ninstead of Array primitives because these will properly notify observers of\nchanges to the array.\n\nAlthough these methods are efficient, they do add a layer of indirection to\nyour application so it is a good idea to use them only when you need the\nflexibility of using both true JavaScript arrays and \"virtual\" arrays such\nas controllers and collections.\n\nYou can use the methods defined in this module to access and modify array\ncontents in an observable-friendly way. You can also be notified whenever\nthe membership of an array changes by using `.observes('myArray.[]')`.\n\nTo support `EmberArray` in your own class, you must override two\nprimitives to use it: `length()` and `objectAt()`.", + "uses": [ + "Enumerable" + ], + "since": "Ember 0.9.0", + "access": "public", + "tagname": "" + }, + "MutableArray": { + "name": "MutableArray", + "shortname": "MutableArray", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Ember.NativeArray", + "ArrayProxy" + ], + "module": "@ember/array", + "namespace": "", + "file": "packages/@ember/array/index.ts", + "line": 1463, + "description": "This mixin defines the API for modifying array-like objects. These methods\ncan be applied only to a collection that keeps its items in an ordered set.\nIt builds upon the Array mixin and adds methods to modify the array.\nOne concrete implementations of this class include ArrayProxy.\n\nIt is important to use the methods in this class to modify arrays so that\nchanges are observable. This allows the binding system in Ember to function\ncorrectly.\n\n\nNote that an Array can change even if it does not implement this mixin.\nFor example, one might implement a SparseArray that cannot be directly\nmodified, but if its underlying enumerable changes, it will change also.", + "uses": [ + "EmberArray", + "MutableEnumerable" + ], + "access": "public", + "tagname": "" + }, + "Ember.NativeArray": { + "name": "Ember.NativeArray", + "shortname": "Ember.NativeArray", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "", + "file": "packages/@ember/array/index.ts", + "line": 2062, + "description": "The NativeArray mixin contains the properties needed to make the native\nArray support MutableArray and all of its dependent APIs. Unless you\nhave `EmberENV.EXTEND_PROTOTYPES` or `EmberENV.EXTEND_PROTOTYPES.Array` set to\nfalse, this will be applied automatically. Otherwise you can apply the mixin\nat anytime by calling `Ember.NativeArray.apply(Array.prototype)`.", + "uses": [ + "MutableArray", + "Observable" + ], + "access": "public", + "tagname": "" + }, + "ArrayProxy": { + "name": "ArrayProxy", + "shortname": "ArrayProxy", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/array/proxy", + "namespace": "", + "file": "packages/@ember/array/proxy.ts", + "line": 59, + "description": "An ArrayProxy wraps any other object that implements `Array` and/or\n`MutableArray,` forwarding all requests. This makes it very useful for\na number of binding use cases or other cases where being able to swap\nout the underlying array is useful.\n\nA simple example of usage:\n\n```javascript\nimport { A } from '@ember/array';\nimport ArrayProxy from '@ember/array/proxy';\n\nlet pets = ['dog', 'cat', 'fish'];\nlet ap = ArrayProxy.create({ content: A(pets) });\n\nap.get('firstObject'); // 'dog'\nap.set('content', ['amoeba', 'paramecium']);\nap.get('firstObject'); // 'amoeba'\n```\n\nThis class can also be useful as a layer to transform the contents of\nan array, as they are accessed. This can be done by overriding\n`objectAtContent`:\n\n```javascript\nimport { A } from '@ember/array';\nimport ArrayProxy from '@ember/array/proxy';\n\nlet pets = ['dog', 'cat', 'fish'];\nlet ap = ArrayProxy.create({\n content: A(pets),\n objectAtContent: function(idx) {\n return this.get('content').objectAt(idx).toUpperCase();\n }\n});\n\nap.get('firstObject'); // . 'DOG'\n```\n\nWhen overriding this class, it is important to place the call to\n`_super` *after* setting `content` so the internal observers have\na chance to fire properly:\n\n```javascript\nimport { A } from '@ember/array';\nimport ArrayProxy from '@ember/array/proxy';\n\nexport default ArrayProxy.extend({\n init() {\n this.set('content', A(['dog', 'cat', 'fish']));\n this._super(...arguments);\n }\n});\n```", + "extends": "EmberObject", + "uses": [ + "MutableArray" + ], + "access": "public", + "tagname": "" + }, + "FEATURES": { + "name": "FEATURES", + "shortname": "FEATURES", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/canary-features", + "namespace": "", + "file": "packages/@ember/canary-features/index.ts", + "line": 18, + "description": "The hash of enabled Canary features. Add to this, any canary features\nbefore creating your application.", + "static": 1, + "since": "1.1.0", + "access": "public", + "tagname": "" + }, + "@ember/component/template-only": { + "name": "@ember/component/template-only", + "shortname": "@ember/component/template-only", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/component/template-only", + "namespace": "" + }, + "Ember.ControllerMixin": { + "name": "Ember.ControllerMixin", + "shortname": "Ember.ControllerMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Ember.Controller" + ], + "module": "@ember/controller", + "namespace": "Ember", + "file": "packages/@ember/controller/index.ts", + "line": 24, + "uses": [ + "Ember.ActionHandler" + ], + "access": "private", + "tagname": "" + }, + "Ember.Controller": { + "name": "Ember.Controller", + "shortname": "Controller", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/controller", + "namespace": "Ember", + "file": "packages/@ember/controller/index.ts", + "line": 308, + "extends": "EmberObject", + "uses": [ + "Ember.ControllerMixin" + ], + "access": "public", + "tagname": "" + }, + "Ember.@ember/controller": { + "name": "Ember.@ember/controller", + "shortname": "@ember/controller", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/controller", + "namespace": "Ember" + }, + "ContainerDebugAdapter": { + "name": "ContainerDebugAdapter", + "shortname": "ContainerDebugAdapter", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/debug/container-debug-adapter", + "namespace": "", + "file": "packages/@ember/debug/container-debug-adapter.ts", + "line": 13, + "description": "The `ContainerDebugAdapter` helps the container and resolver interface\nwith tools that debug Ember such as the\n[Ember Inspector](https://github.com/emberjs/ember-inspector)\nfor Chrome and Firefox.\n\nThis class can be extended by a custom resolver implementer\nto override some of the methods with library-specific code.\n\nThe methods likely to be overridden are:\n\n* `canCatalogEntriesByType`\n* `catalogEntriesByType`\n\nThe adapter will need to be registered\nin the application's container as `container-debug-adapter:main`.\n\nExample:\n\n```javascript\nApplication.initializer({\n name: \"containerDebugAdapter\",\n\n initialize(application) {\n application.register('container-debug-adapter:main', require('app/container-debug-adapter'));\n }\n});\n```", + "extends": "EmberObject", + "since": "1.5.0", + "access": "public", + "tagname": "" + }, + "DataAdapter": { + "name": "DataAdapter", + "shortname": "DataAdapter", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/debug/data-adapter", + "namespace": "", + "file": "packages/@ember/debug/data-adapter.ts", + "line": 178, + "description": "The `DataAdapter` helps a data persistence library\ninterface with tools that debug Ember such\nas the [Ember Inspector](https://github.com/emberjs/ember-inspector)\nfor Chrome and Firefox.\n\nThis class will be extended by a persistence library\nwhich will override some of the methods with\nlibrary-specific code.\n\nThe methods likely to be overridden are:\n\n* `getFilters`\n* `detect`\n* `columnsForType`\n* `getRecords`\n* `getRecordColumnValues`\n* `getRecordKeywords`\n* `getRecordFilterValues`\n* `getRecordColor`\n\nThe adapter will need to be registered\nin the application's container as `dataAdapter:main`.\n\nExample:\n\n```javascript\nApplication.initializer({\n name: \"data-adapter\",\n\n initialize: function(application) {\n application.register('data-adapter:main', DS.DataAdapter);\n }\n});\n```", + "extends": "EmberObject", + "access": "public", + "tagname": "" + }, + "@ember/destroyable": { + "name": "@ember/destroyable", + "shortname": "@ember/destroyable", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/destroyable", + "namespace": "" + }, + "@ember/engine": { + "name": "@ember/engine", + "shortname": "@ember/engine", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/engine", + "namespace": "" + }, + "Engine": { + "name": "Engine", + "shortname": "Engine", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/engine", + "namespace": "", + "file": "packages/@ember/engine/index.ts", + "line": 40, + "description": "The `Engine` class contains core functionality for both applications and\nengines.\n\nEach engine manages a registry that's used for dependency injection and\nexposed through `RegistryProxy`.\n\nEngines also manage initializers and instance initializers.\n\nEngines can spawn `EngineInstance` instances via `buildInstance()`.", + "extends": "Ember.Namespace", + "uses": [ + "RegistryProxyMixin" + ], + "access": "public", + "tagname": "" + }, + "EngineInstance": { + "name": "EngineInstance", + "shortname": "EngineInstance", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/engine", + "namespace": "", + "file": "packages/@ember/engine/instance.ts", + "line": 36, + "description": "The `EngineInstance` encapsulates all of the stateful aspects of a\nrunning `Engine`.", + "access": "public", + "tagname": "", + "extends": "EmberObject", + "uses": [ + "RegistryProxyMixin", + "ContainerProxyMixin" + ] + }, + "Enumerable": { + "name": "Enumerable", + "shortname": "Enumerable", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "EmberArray", + "Ember.MutableEnumerable" + ], + "module": "@ember/enumerable", + "namespace": "", + "file": "packages/@ember/enumerable/index.ts", + "line": 8, + "description": "The methods in this mixin have been moved to [MutableArray](/ember/release/classes/MutableArray). This mixin has\nbeen intentionally preserved to avoid breaking Enumerable.detect checks\nuntil the community migrates away from them.", + "access": "private", + "tagname": "" + }, + "Ember.MutableEnumerable": { + "name": "Ember.MutableEnumerable", + "shortname": "Ember.MutableEnumerable", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "Ember", + "file": "packages/@ember/enumerable/mutable.ts", + "line": 8, + "description": "The methods in this mixin have been moved to MutableArray. This mixin has\nbeen intentionally preserved to avoid breaking MutableEnumerable.detect\nchecks until the community migrates away from them.", + "uses": [ + "Enumerable" + ], + "access": "private", + "tagname": "" + }, + "Instrumentation": { + "name": "Instrumentation", + "shortname": "Instrumentation", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/instrumentation", + "namespace": "", + "file": "packages/@ember/instrumentation/index.ts", + "line": 39, + "description": "The purpose of the Ember Instrumentation module is\nto provide efficient, general-purpose instrumentation\nfor Ember.\n\nSubscribe to a listener by using `subscribe`:\n\n```javascript\nimport { subscribe } from '@ember/instrumentation';\n\nsubscribe(\"render\", {\n before(name, timestamp, payload) {\n\n },\n\n after(name, timestamp, payload) {\n\n }\n});\n```\n\nIf you return a value from the `before` callback, that same\nvalue will be passed as a fourth parameter to the `after`\ncallback.\n\nInstrument a block of code by using `instrument`:\n\n```javascript\nimport { instrument } from '@ember/instrumentation';\n\ninstrument(\"render.handlebars\", payload, function() {\n // rendering logic\n}, binding);\n```\n\nEvent names passed to `instrument` are namespaced\nby periods, from more general to more specific. Subscribers\ncan listen for events by whatever level of granularity they\nare interested in.\n\nIn the above example, the event is `render.handlebars`,\nand the subscriber listened for all events beginning with\n`render`. It would receive callbacks for events named\n`render`, `render.handlebars`, `render.container`, or\neven `render.handlebars.layout`.", + "static": 1, + "access": "private", + "tagname": "" + }, + "@ember/instrumentation": { + "name": "@ember/instrumentation", + "shortname": "@ember/instrumentation", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/instrumentation", + "namespace": "" + }, + "@ember/object/compat": { + "name": "@ember/object/compat", + "shortname": "@ember/object/compat", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "" + }, + "CoreObject": { + "name": "CoreObject", + "shortname": "CoreObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object/core", + "namespace": "", + "file": "packages/@ember/object/core.ts", + "line": 175, + "description": "`CoreObject` is the base class for all Ember constructs. It establishes a\nclass system based on Ember's Mixin system, and provides the basis for the\nEmber Object Model. `CoreObject` should generally not be used directly,\ninstead you should use `EmberObject`.\n\n## Usage\n\nYou can define a class by extending from `CoreObject` using the `extend`\nmethod:\n\n```js\nconst Person = CoreObject.extend({\n name: 'Tomster',\n});\n```\n\nFor detailed usage, see the [Object Model](https://guides.emberjs.com/release/object-model/)\nsection of the guides.\n\n## Usage with Native Classes\n\nNative JavaScript `class` syntax can be used to extend from any `CoreObject`\nbased class:\n\n```js\nclass Person extends CoreObject {\n init() {\n super.init(...arguments);\n this.name = 'Tomster';\n }\n}\n```\n\nSome notes about `class` usage:\n\n* `new` syntax is not currently supported with classes that extend from\n `EmberObject` or `CoreObject`. You must continue to use the `create` method\n when making new instances of classes, even if they are defined using native\n class syntax. If you want to use `new` syntax, consider creating classes\n which do _not_ extend from `EmberObject` or `CoreObject`. Ember features,\n such as computed properties and decorators, will still work with base-less\n classes.\n* Instead of using `this._super()`, you must use standard `super` syntax in\n native classes. See the [MDN docs on classes](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes#Super_class_calls_with_super)\n for more details.\n* Native classes support using [constructors](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes#Constructor)\n to set up newly-created instances. Ember uses these to, among other things,\n support features that need to retrieve other entities by name, like Service\n injection and `getOwner`. To ensure your custom instance setup logic takes\n place after this important work is done, avoid using the `constructor` in\n favor of `init`.\n* Properties passed to `create` will be available on the instance by the time\n `init` runs, so any code that requires these values should work at that\n time.\n* Using native classes, and switching back to the old Ember Object model is\n fully supported.", + "access": "public", + "tagname": "" + }, + "Evented": { + "name": "Evented", + "shortname": "Evented", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Ember.CoreView", + "Route", + "EmberRouter" + ], + "module": "@ember/object/evented", + "namespace": "", + "file": "packages/@ember/object/evented.ts", + "line": 10, + "description": "This mixin allows for Ember objects to subscribe to and emit events.\n\n```app/utils/person.js\nimport EmberObject from '@ember/object';\nimport Evented from '@ember/object/evented';\n\nexport default EmberObject.extend(Evented, {\n greet() {\n // ...\n this.trigger('greet');\n }\n});\n```\n\n```javascript\nvar person = Person.create();\n\nperson.on('greet', function() {\n console.log('Our person has greeted');\n});\n\nperson.greet();\n\n// outputs: 'Our person has greeted'\n```\n\nYou can also chain multiple event subscriptions:\n\n```javascript\nperson.on('greet', function() {\n console.log('Our person has greeted');\n}).one('greet', function() {\n console.log('Offer one-time special');\n}).off('event', this, forgetThis);\n```", + "access": "public", + "tagname": "" + }, + "EmberObject": { + "name": "EmberObject", + "shortname": "EmberObject", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object", + "namespace": "", + "file": "packages/@ember/object/index.ts", + "line": 30, + "description": "`EmberObject` is the main base class for all Ember objects. It is a subclass\nof `CoreObject` with the `Observable` mixin applied. For details,\nsee the documentation for each of these.", + "extends": "CoreObject", + "uses": [ + "Observable" + ], + "access": "public", + "tagname": "" + }, + "Mixin": { + "name": "Mixin", + "shortname": "Mixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object/mixin", + "namespace": "", + "file": "packages/@ember/object/mixin.ts", + "line": 455, + "description": "The `Mixin` class allows you to create mixins, whose properties can be\nadded to other classes. For instance,\n\n```javascript\nimport Mixin from '@ember/object/mixin';\n\nconst EditableMixin = Mixin.create({\n edit() {\n console.log('starting to edit');\n this.set('isEditing', true);\n },\n isEditing: false\n});\n```\n\n```javascript\nimport EmberObject from '@ember/object';\nimport EditableMixin from '../mixins/editable';\n\n// Mix mixins into classes by passing them as the first arguments to\n// `.extend.`\nconst Comment = EmberObject.extend(EditableMixin, {\n post: null\n});\n\nlet comment = Comment.create({\n post: somePost\n});\n\ncomment.edit(); // outputs 'starting to edit'\n```\n\nNote that Mixins are created with `Mixin.create`, not\n`Mixin.extend`.\n\nNote that mixins extend a constructor's prototype so arrays and object literals\ndefined as properties will be shared amongst objects that implement the mixin.\nIf you want to define a property in a mixin that is not shared, you can define\nit either as a computed property or have it be created on initialization of the object.\n\n```javascript\n// filters array will be shared amongst any object implementing mixin\nimport Mixin from '@ember/object/mixin';\nimport { A } from '@ember/array';\n\nconst FilterableMixin = Mixin.create({\n filters: A()\n});\n```\n\n```javascript\nimport Mixin from '@ember/object/mixin';\nimport { A } from '@ember/array';\nimport { computed } from '@ember/object';\n\n// filters will be a separate array for every object implementing the mixin\nconst FilterableMixin = Mixin.create({\n filters: computed(function() {\n return A();\n })\n});\n```\n\n```javascript\nimport Mixin from '@ember/object/mixin';\nimport { A } from '@ember/array';\n\n// filters will be created as a separate array during the object's initialization\nconst Filterable = Mixin.create({\n filters: null,\n\n init() {\n this._super(...arguments);\n this.set(\"filters\", A());\n }\n});\n```", + "access": "public", + "tagname": "" + }, + "@ember/object/mixin": { + "name": "@ember/object/mixin", + "shortname": "@ember/object/mixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object/mixin", + "namespace": "" + }, + "Observable": { + "name": "Observable", + "shortname": "Observable", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [ + "Ember.NativeArray", + "EmberObject" + ], + "module": "@ember/object/observable", + "namespace": "", + "file": "packages/@ember/object/observable.ts", + "line": 22, + "description": "## Overview\n\nThis mixin provides properties and property observing functionality, core\nfeatures of the Ember object model.\n\nProperties and observers allow one object to observe changes to a\nproperty on another object. This is one of the fundamental ways that\nmodels, controllers and views communicate with each other in an Ember\napplication.\n\nAny object that has this mixin applied can be used in observer\noperations. That includes `EmberObject` and most objects you will\ninteract with as you write your Ember application.\n\nNote that you will not generally apply this mixin to classes yourself,\nbut you will use the features provided by this module frequently, so it\nis important to understand how to use it.\n\n## Using `get()` and `set()`\n\nBecause of Ember's support for bindings and observers, you will always\naccess properties using the get method, and set properties using the\nset method. This allows the observing objects to be notified and\ncomputed properties to be handled properly.\n\nMore documentation about `get` and `set` are below.\n\n## Observing Property Changes\n\nYou typically observe property changes simply by using the `observer`\nfunction in classes that you write.\n\nFor example:\n\n```javascript\nimport { observer } from '@ember/object';\nimport EmberObject from '@ember/object';\n\nEmberObject.extend({\n valueObserver: observer('value', function(sender, key, value, rev) {\n // Executes whenever the \"value\" property changes\n // See the addObserver method for more information about the callback arguments\n })\n});\n```\n\nAlthough this is the most common way to add an observer, this capability\nis actually built into the `EmberObject` class on top of two methods\ndefined in this mixin: `addObserver` and `removeObserver`. You can use\nthese two methods to add and remove observers yourself if you need to\ndo so at runtime.\n\nTo add an observer for a property, call:\n\n```javascript\nobject.addObserver('propertyKey', targetObject, targetAction)\n```\n\nThis will call the `targetAction` method on the `targetObject` whenever\nthe value of the `propertyKey` changes.\n\nNote that if `propertyKey` is a computed property, the observer will be\ncalled when any of the property dependencies are changed, even if the\nresulting value of the computed property is unchanged. This is necessary\nbecause computed properties are not computed until `get` is called.", + "access": "public", + "tagname": "" + }, + "PromiseProxyMixin": { + "name": "PromiseProxyMixin", + "shortname": "PromiseProxyMixin", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object/promise-proxy-mixin", + "namespace": "", + "file": "packages/@ember/object/promise-proxy-mixin.ts", + "line": 46, + "description": "A low level mixin making ObjectProxy promise-aware.\n\n```javascript\nimport { resolve } from 'rsvp';\nimport $ from 'jquery';\nimport ObjectProxy from '@ember/object/proxy';\nimport PromiseProxyMixin from '@ember/object/promise-proxy-mixin';\n\nlet ObjectPromiseProxy = ObjectProxy.extend(PromiseProxyMixin);\n\nlet proxy = ObjectPromiseProxy.create({\n promise: resolve($.getJSON('/some/remote/data.json'))\n});\n\nproxy.then(function(json){\n // the json\n}, function(reason) {\n // the reason why you have no json\n});\n```\n\nthe proxy has bindable attributes which\ntrack the promises life cycle\n\n```javascript\nproxy.get('isPending') //=> true\nproxy.get('isSettled') //=> false\nproxy.get('isRejected') //=> false\nproxy.get('isFulfilled') //=> false\n```\n\nWhen the $.getJSON completes, and the promise is fulfilled\nwith json, the life cycle attributes will update accordingly.\nNote that $.getJSON doesn't return an ECMA specified promise,\nit is useful to wrap this with an `RSVP.resolve` so that it behaves\nas a spec compliant promise.\n\n```javascript\nproxy.get('isPending') //=> false\nproxy.get('isSettled') //=> true\nproxy.get('isRejected') //=> false\nproxy.get('isFulfilled') //=> true\n```\n\nAs the proxy is an ObjectProxy, and the json now its content,\nall the json properties will be available directly from the proxy.\n\n```javascript\n// Assuming the following json:\n{\n firstName: 'Stefan',\n lastName: 'Penner'\n}\n\n// both properties will accessible on the proxy\nproxy.get('firstName') //=> 'Stefan'\nproxy.get('lastName') //=> 'Penner'\n```", + "access": "public", + "tagname": "" + }, + "ObjectProxy": { + "name": "ObjectProxy", + "shortname": "ObjectProxy", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/object/proxy", + "namespace": "", + "file": "packages/@ember/object/proxy.ts", + "line": 8, + "description": "`ObjectProxy` forwards all properties not defined by the proxy itself\nto a proxied `content` object.\n\n```javascript\nimport EmberObject from '@ember/object';\nimport ObjectProxy from '@ember/object/proxy';\n\nlet exampleObject = EmberObject.create({\n name: 'Foo'\n});\n\nlet exampleProxy = ObjectProxy.create({\n content: exampleObject\n});\n\n// Access and change existing properties\nexampleProxy.get('name'); // 'Foo'\nexampleProxy.set('name', 'Bar');\nexampleObject.get('name'); // 'Bar'\n\n// Create new 'description' property on `exampleObject`\nexampleProxy.set('description', 'Foo is a whizboo baz');\nexampleObject.get('description'); // 'Foo is a whizboo baz'\n```\n\nWhile `content` is unset, setting a property to be delegated will throw an\nError.\n\n```javascript\nimport ObjectProxy from '@ember/object/proxy';\n\nlet exampleProxy = ObjectProxy.create({\n content: null,\n flag: null\n});\nexampleProxy.set('flag', true);\nexampleProxy.get('flag'); // true\nexampleProxy.get('foo'); // undefined\nexampleProxy.set('foo', 'data'); // throws Error\n```\n\nDelegated properties can be bound to and will change when content is updated.\n\nComputed properties on the proxy itself can depend on delegated properties.\n\n```javascript\nimport { computed } from '@ember/object';\nimport ObjectProxy from '@ember/object/proxy';\n\nProxyWithComputedProperty = ObjectProxy.extend({\n fullName: computed('firstName', 'lastName', function() {\n var firstName = this.get('firstName'),\n lastName = this.get('lastName');\n if (firstName && lastName) {\n return firstName + ' ' + lastName;\n }\n return firstName || lastName;\n })\n});\n\nlet exampleProxy = ProxyWithComputedProperty.create();\n\nexampleProxy.get('fullName'); // undefined\nexampleProxy.set('content', {\n firstName: 'Tom', lastName: 'Dale'\n}); // triggers property change for fullName on proxy\n\nexampleProxy.get('fullName'); // 'Tom Dale'\n```", + "extends": "EmberObject", + "uses": [ + "Ember.ProxyMixin" + ], + "access": "public", + "tagname": "" + }, + "Renderer": { + "name": "Renderer", + "shortname": "Renderer", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/renderer", + "namespace": "", + "file": "packages/@ember/renderer/index.ts", + "line": 6, + "access": "public", + "tagname": "" + }, + "BucketCache": { + "name": "BucketCache", + "shortname": "BucketCache", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/renderer", + "namespace": "", + "file": "packages/@ember/routing/lib/cache.ts", + "line": 1, + "description": "A two-tiered cache with support for fallback values when doing lookups.\nUses \"buckets\" and then \"keys\" to cache values.", + "access": "private", + "tagname": "" + }, + "RoutingService": { + "name": "RoutingService", + "shortname": "RoutingService", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "", + "file": "packages/@ember/routing/lib/routing-service.ts", + "line": 15, + "description": "The Routing service is used by LinkTo, and provides facilities for\nthe component/view layer to interact with the router.\n\nThis is a private service for internal usage only. For public usage,\nrefer to the `Router` service.", + "access": "private", + "tagname": "" + }, + "HashLocation": { + "name": "HashLocation", + "shortname": "HashLocation", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing/hash-location", + "namespace": "", + "file": "packages/@ember/routing/hash-location.ts", + "line": 10, + "description": "`HashLocation` implements the location API using the browser's\nhash. At present, it relies on a `hashchange` event existing in the\nbrowser.\n\nUsing `HashLocation` results in URLs with a `#` (hash sign) separating the\nserver side URL portion of the URL from the portion that is used by Ember.\n\nExample:\n\n```app/router.js\nRouter.map(function() {\n this.route('posts', function() {\n this.route('new');\n });\n});\n\nRouter.reopen({\n location: 'hash'\n});\n```\n\nThis will result in a posts.new url of `/#/posts/new`.", + "extends": "EmberObject", + "access": "protected", + "tagname": "" + }, + "HistoryLocation": { + "name": "HistoryLocation", + "shortname": "HistoryLocation", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing/history-location", + "namespace": "", + "file": "packages/@ember/routing/history-location.ts", + "line": 21, + "description": "HistoryLocation implements the location API using the browser's\nhistory.pushState API.\n\nUsing `HistoryLocation` results in URLs that are indistinguishable from a\nstandard URL. This relies upon the browser's `history` API.\n\nExample:\n\n```app/router.js\nRouter.map(function() {\n this.route('posts', function() {\n this.route('new');\n });\n});\n\nRouter.reopen({\n location: 'history'\n});\n```\n\nThis will result in a posts.new url of `/posts/new`.\n\nKeep in mind that your server must serve the Ember app at all the routes you\ndefine.\n\nUsing `HistoryLocation` will also result in location states being recorded by\nthe browser `history` API with the following schema:\n\n```\nwindow.history.state -> { path: '/', uuid: '3552e730-b4a6-46bd-b8bf-d8c3c1a97e0a' }\n```\n\nThis allows each in-app location state to be tracked uniquely across history\nstate changes via the `uuid` field.", + "extends": "EmberObject", + "access": "protected", + "tagname": "" + }, + "@ember/routing/location": { + "name": "@ember/routing/location", + "shortname": "@ember/routing/location", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing/location", + "namespace": "" + }, + "Location": { + "name": "Location", + "shortname": "Location", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing/location", + "namespace": "", + "file": "packages/@ember/routing/location.ts", + "line": 5, + "description": "`Location` defines an interface to be implemented by `location` APIs. It is\nnot user-constructible; the only valid way to get a `Location` is via one of\nits concrete implementations.\n\n## Implementations\n\nYou can pass an implementation name (`hash`, `history`, `none`) to force a\nparticular implementation to be used in your application.\n\n- See [HashLocation](/ember/release/classes/HashLocation).\n- See [HistoryLocation](/ember/release/classes/HistoryLocation).\n- See [NoneLocation](/ember/release/classes/NoneLocation).\n\n## Location API\n\nEach location implementation must provide the following methods:\n\n* `getURL`: returns the current URL.\n* `setURL(path)`: sets the current URL.\n* `replaceURL(path)`: replace the current URL (optional).\n* `onUpdateURL(callback)`: triggers the callback when the URL changes.\n* `formatURL(url)`: formats `url` to be placed into `href` attribute.\n\nCalling `setURL` or `replaceURL` will not trigger onUpdateURL callbacks.\n\n## Custom implementation\n\nEmber scans `app/locations/*` for extending the Location API.\n\nExample:\n\n```javascript\nimport HistoryLocation from '@ember/routing/history-location';\n\nexport default class MyHistory {\n implementation = 'my-custom-history';\n\n constructor() {\n this._history = HistoryLocation.create(...arguments);\n }\n\n create() {\n return new this(...arguments);\n }\n\n pushState(path) {\n this._history.pushState(path);\n }\n}\n```", + "since": "5.0.0", + "access": "public", + "tagname": "" + }, + "NoneLocation": { + "name": "NoneLocation", + "shortname": "NoneLocation", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing/none-location", + "namespace": "", + "file": "packages/@ember/routing/none-location.ts", + "line": 9, + "description": "NoneLocation does not interact with the browser. It is useful for\ntesting, or when you need to manage state with your Router, but temporarily\ndon't want it to muck with the URL (for example when you embed your\napplication in a larger page).\n\nUsing `NoneLocation` causes Ember to not store the applications URL state\nin the actual URL. This is generally used for testing purposes, and is one\nof the changes made when calling `App.setupForTesting()`.", + "extends": "EmberObject", + "access": "protected", + "tagname": "" + }, + "RouteInfo": { + "name": "RouteInfo", + "shortname": "RouteInfo", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing/route-info", + "namespace": "", + "file": "packages/@ember/routing/route-info.ts", + "line": 20, + "description": "A `RouteInfo` is an object that contains metadata about a specific route\nwithin a `Transition`. It is read-only and internally immutable. It is also\nnot observable, because a `Transition` instance is never changed after\ncreation.\n\nA `RouteInfo` is not user-constructible; the only legal way to get one is from\na valid `Transition`. However, you can import the type by using `import type`\nsyntax with TypeScript or `import()` in JSDoc comments.", + "access": "public", + "tagname": "" + }, + "RouteInfoWithAttributes": { + "name": "RouteInfoWithAttributes", + "shortname": "RouteInfoWithAttributes", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing/route-info", + "namespace": "", + "file": "packages/@ember/routing/route-info.ts", + "line": 124, + "description": "A `RouteInfoWithAttributes` is an object that contains metadata, including the\nresolved value from the routes `model` hook. Like `RouteInfo`, a\n`RouteInfoWithAttributes` represents a specific route within a Transition. It\nis read-only and internally immutable. It is also not observable, because a\nTransition instance is never changed after creation.\n\nA `RouteInfoWithAttributes` is not user-constructible; the only legal way to\nget one is from a valid `Transition`. However, you can import the type by\nusing `import type` syntax with TypeScript or `import()` in JSDoc comments.", + "extends": "RouteInfo", + "access": "public", + "tagname": "" + }, + "Route": { + "name": "Route", + "shortname": "Route", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing/route", + "namespace": "", + "file": "packages/@ember/routing/route.ts", + "line": 79, + "description": "The `Route` class is used to define individual routes. Refer to\nthe [routing guide](https://guides.emberjs.com/release/routing/) for documentation.", + "extends": "EmberObject", + "uses": [ + "ActionHandler", + "Evented" + ], + "since": "1.0.0", + "access": "public", + "tagname": "" + }, + "RouterService": { + "name": "RouterService", + "shortname": "RouterService", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing/router-service", + "namespace": "", + "file": "packages/@ember/routing/router-service.ts", + "line": 27, + "description": "The Router service is the public API that provides access to the router.\n\nThe immediate benefit of the Router service is that you can inject it into components,\ngiving them a friendly way to initiate transitions and ask questions about the current\nglobal router state.\n\nIn this example, the Router service is injected into a component to initiate a transition\nto a dedicated route:\n\n```app/components/example.js\nimport Component from '@glimmer/component';\nimport { action } from '@ember/object';\nimport { service } from '@ember/service';\n\nexport default class ExampleComponent extends Component {\n @service router;\n\n @action\n next() {\n this.router.transitionTo('other.route');\n }\n}\n```\n\nLike any service, it can also be injected into helpers, routes, etc.", + "access": "public", + "tagname": "", + "extends": "Service" + }, + "EmberRouter": { + "name": "EmberRouter", + "shortname": "EmberRouter", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing/router", + "namespace": "", + "file": "packages/@ember/routing/router.ts", + "line": 145, + "description": "The `EmberRouter` class manages the application state and URLs. Refer to\nthe [routing guide](https://guides.emberjs.com/release/routing/) for documentation.", + "extends": "EmberObject", + "uses": [ + "Evented" + ], + "access": "public", + "tagname": "" + }, + "Transition": { + "name": "Transition", + "shortname": "Transition", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/routing/transition", + "namespace": "", + "file": "packages/@ember/routing/transition.ts", + "line": 10, + "description": "A `Transition` is a thennable (a `Promise`-like object) that represents an\nattempt to transition to another route. It can be aborted, either explicitly\nvia `abort` or by attempting another transition while a previous one is still\nunderway. An aborted transition can also be `retry()`d later.\n\nA `Transition` is not user-constructible; the only legal way to get one is in\na `Route` hook or a `RouterService.on()` callback. However, you can import the\ntype by using `import type` syntax with TypeScript or `import()` in JSDoc\ncomments.", + "access": "public", + "tagname": "" + }, + "@ember/runloop": { + "name": "@ember/runloop", + "shortname": "@ember/runloop", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/runloop", + "namespace": "" + }, + "@ember/service": { + "name": "@ember/service", + "shortname": "@ember/service", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/service", + "namespace": "" + }, + "Service": { + "name": "Service", + "shortname": "Service", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/service", + "namespace": "", + "file": "packages/@ember/service/index.ts", + "line": 87, + "extends": "EmberObject", + "since": "1.10.0", + "access": "public", + "tagname": "" + }, + "@ember/utils": { + "name": "@ember/utils", + "shortname": "@ember/utils", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/utils", + "namespace": "" + }, + "TestAdapter": { + "name": "TestAdapter", + "shortname": "TestAdapter", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/test", + "namespace": "", + "file": "packages/ember-testing/lib/adapters/adapter.ts", + "line": 7, + "description": "The primary purpose of this class is to create hooks that can be implemented\nby an adapter for various test frameworks.", + "access": "public", + "tagname": "" + }, + "Ember.Test.QUnitAdapter": { + "name": "Ember.Test.QUnitAdapter", + "shortname": "Ember.Test.QUnitAdapter", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "Ember.Test", + "file": "packages/ember-testing/lib/adapters/qunit.ts", + "line": 17, + "description": "This class implements the methods defined by TestAdapter for the\nQUnit testing framework.", + "extends": "TestAdapter", + "access": "public", + "tagname": "" + }, + "@ember/test": { + "name": "@ember/test", + "shortname": "@ember/test", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "@ember/test", + "namespace": "" + }, + "Ember.Test": { + "name": "Ember.Test", + "shortname": "Ember.Test", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "ember", + "namespace": "Ember", + "file": "packages/ember-testing/lib/test.ts", + "line": 11, + "description": "This is a container for an assortment of testing related functionality:\n\n* Choose your default test adapter (for your framework of choice).\n* Register/Unregister additional test helpers.\n* Setup callbacks to be fired when the test helpers are injected into\n your application.", + "access": "public", + "tagname": "" + } + }, + "elements": {}, + "classitems": [ + { + "file": "node_modules/rsvp/lib/rsvp/promise/all.js", + "line": 3, + "description": "`Promise.all` accepts an array of promises, and returns a new promise which\nis fulfilled with an array of fulfillment values for the passed promises, or\nrejected with the reason of the first passed promise to be rejected. It casts all\nelements of the passed iterable to promises as it runs this algorithm.\n\nExample:\n\n```javascript\nimport Promise, { resolve } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = resolve(2);\nlet promise3 = resolve(3);\nlet promises = [ promise1, promise2, promise3 ];\n\nPromise.all(promises).then(function(array){\n // The array here would be [ 1, 2, 3 ];\n});\n```\n\nIf any of the `promises` given to `RSVP.all` are rejected, the first promise\nthat is rejected will be given as an argument to the returned promises's\nrejection handler. For example:\n\nExample:\n\n```javascript\nimport Promise, { resolve, reject } from 'rsvp';\n\nlet promise1 = resolve(1);\nlet promise2 = reject(new Error(\"2\"));\nlet promise3 = reject(new Error(\"3\"));\nlet promises = [ promise1, promise2, promise3 ];\n\nPromise.all(promises).then(function(array){\n // Code here never runs because there are rejected promises!\n}, function(error) {\n // error.message === \"2\"\n});\n```", + "itemtype": "method", + "name": "all", + "params": [ + { + "name": "entries", + "description": "array of promises", + "type": "Array" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled when all `promises` have been\nfulfilled, or rejected if any of them become rejected.", + "type": "Promise" + }, + "static": 1, + "class": "Promise" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise/race.js", + "line": 9, + "description": "`Promise.race` returns a new promise which is settled in the same way as the\nfirst passed promise to settle.\n\nExample:\n\n```javascript\nimport Promise from 'rsvp';\n\nlet promise1 = new Promise(function(resolve, reject){\n setTimeout(function(){\n resolve('promise 1');\n }, 200);\n});\n\nlet promise2 = new Promise(function(resolve, reject){\n setTimeout(function(){\n resolve('promise 2');\n }, 100);\n});\n\nPromise.race([promise1, promise2]).then(function(result){\n // result === 'promise 2' because it was resolved before promise1\n // was resolved.\n});\n```\n\n`Promise.race` is deterministic in that only the state of the first\nsettled promise matters. For example, even if other promises given to the\n`promises` array argument are resolved, but the first settled promise has\nbecome rejected before the other promises became fulfilled, the returned\npromise will become rejected:\n\n```javascript\nimport Promise from 'rsvp';\n\nlet promise1 = new Promise(function(resolve, reject){\n setTimeout(function(){\n resolve('promise 1');\n }, 200);\n});\n\nlet promise2 = new Promise(function(resolve, reject){\n setTimeout(function(){\n reject(new Error('promise 2'));\n }, 100);\n});\n\nPromise.race([promise1, promise2]).then(function(result){\n // Code here never runs\n}, function(reason){\n // reason.message === 'promise 2' because promise 2 became rejected before\n // promise 1 became fulfilled\n});\n```\n\nAn example real-world use case is implementing timeouts:\n\n```javascript\nimport Promise from 'rsvp';\n\nPromise.race([ajax('foo.json'), timeout(5000)])\n```", + "itemtype": "method", + "name": "race", + "static": 1, + "params": [ + { + "name": "entries", + "description": "array of promises to observe", + "type": "Array" + }, + { + "name": "label", + "description": "optional string for describing the promise returned.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise which settles in the same way as the first passed\npromise to settle.", + "type": "Promise" + }, + "class": "Promise" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise/reject.js", + "line": 6, + "description": "`Promise.reject` returns a promise rejected with the passed `reason`.\nIt is shorthand for the following:\n\n```javascript\nimport Promise from 'rsvp';\n\nlet promise = new Promise(function(resolve, reject){\n reject(new Error('WHOOPS'));\n});\n\npromise.then(function(value){\n // Code here doesn't run because the promise is rejected!\n}, function(reason){\n // reason.message === 'WHOOPS'\n});\n```\n\nInstead of writing the above, your code now simply becomes the following:\n\n```javascript\nimport Promise from 'rsvp';\n\nlet promise = Promise.reject(new Error('WHOOPS'));\n\npromise.then(function(value){\n // Code here doesn't run because the promise is rejected!\n}, function(reason){\n // reason.message === 'WHOOPS'\n});\n```", + "itemtype": "method", + "name": "reject", + "static": 1, + "params": [ + { + "name": "reason", + "description": "value that the returned promise will be rejected with.", + "type": "*" + }, + { + "name": "label", + "description": "optional string for identifying the returned promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise rejected with the given `reason`.", + "type": "Promise" + }, + "class": "Promise" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise/resolve.js", + "line": 6, + "description": "`Promise.resolve` returns a promise that will become resolved with the\npassed `value`. It is shorthand for the following:\n\n```javascript\nimport Promise from 'rsvp';\n\nlet promise = new Promise(function(resolve, reject){\n resolve(1);\n});\n\npromise.then(function(value){\n // value === 1\n});\n```\n\nInstead of writing the above, your code now simply becomes the following:\n\n```javascript\nimport Promise from 'rsvp';\n\nlet promise = RSVP.Promise.resolve(1);\n\npromise.then(function(value){\n // value === 1\n});\n```", + "itemtype": "method", + "name": "resolve", + "static": 1, + "params": [ + { + "name": "object", + "description": "value that the returned promise will be resolved with", + "type": "*" + }, + { + "name": "label", + "description": "optional string for identifying the returned promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise that will become fulfilled with the given\n`value`", + "type": "Promise" + }, + "class": "Promise" + }, + { + "file": "node_modules/rsvp/lib/rsvp/all-settled.js", + "line": 20, + "description": "`RSVP.allSettled` is similar to `RSVP.all`, but instead of implementing\na fail-fast method, it waits until all the promises have returned and\nshows you all the results. This is useful if you want to handle multiple\npromises' failure states together as a set.\n\nReturns a promise that is fulfilled when all the given promises have been\nsettled. The return promise is fulfilled with an array of the states of\nthe promises passed into the `promises` array argument.\n\nEach state object will either indicate fulfillment or rejection, and\nprovide the corresponding value or reason. The states will take one of\nthe following formats:\n\n```javascript\n{ state: 'fulfilled', value: value }\n or\n{ state: 'rejected', reason: reason }\n```\n\nExample:\n\n```javascript\nlet promise1 = RSVP.Promise.resolve(1);\nlet promise2 = RSVP.Promise.reject(new Error('2'));\nlet promise3 = RSVP.Promise.reject(new Error('3'));\nlet promises = [ promise1, promise2, promise3 ];\n\nRSVP.allSettled(promises).then(function(array){\n // array == [\n // { state: 'fulfilled', value: 1 },\n // { state: 'rejected', reason: Error },\n // { state: 'rejected', reason: Error }\n // ]\n // Note that for the second item, reason.message will be '2', and for the\n // third item, reason.message will be '3'.\n}, function(error) {\n // Not run. (This block would only be called if allSettled had failed,\n // for instance if passed an incorrect argument type.)\n});\n```", + "itemtype": "method", + "name": "allSettled", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "entries", + "description": "", + "type": "Array" + }, + { + "name": "label", + "description": "- optional string that describes the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled with an array of the settled\nstates of the constituent promises.", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/all.js", + "line": 3, + "description": "This is a convenient alias for `Promise.all`.", + "itemtype": "method", + "name": "all", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "array", + "description": "Array of promises.", + "type": "Array" + }, + { + "name": "label", + "description": "An optional label. This is useful\nfor tooling.", + "type": "String", + "optional": true + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/defer.js", + "line": 3, + "description": "`defer` returns an object similar to jQuery's `$.Deferred`.\n`defer` should be used when porting over code reliant on `$.Deferred`'s\ninterface. New code should use the `Promise` constructor instead.\n\nThe object returned from `defer` is a plain object with three properties:\n\n* promise - an `Promise`.\n* reject - a function that causes the `promise` property on this object to\n become rejected\n* resolve - a function that causes the `promise` property on this object to\n become fulfilled.\n\nExample:\n\n ```javascript\n let deferred = defer();\n\n deferred.resolve(\"Success!\");\n\n deferred.promise.then(function(value){\n // value here is \"Success!\"\n });\n ```", + "itemtype": "method", + "name": "defer", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Object" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/events.js", + "line": 19, + "description": "`EventTarget.mixin` extends an object with EventTarget methods. For\nExample:\n\n```javascript\nimport EventTarget from 'rsvp';\n\nlet object = {};\n\nEventTarget.mixin(object);\n\nobject.on('finished', function(event) {\n // handle event\n});\n\nobject.trigger('finished', { detail: value });\n```\n\n`EventTarget.mixin` also works with prototypes:\n\n```javascript\nimport EventTarget from 'rsvp';\n\nlet Person = function() {};\nEventTarget.mixin(Person.prototype);\n\nlet yehuda = new Person();\nlet tom = new Person();\n\nyehuda.on('poke', function(event) {\n console.log('Yehuda says OW');\n});\n\ntom.on('poke', function(event) {\n console.log('Tom says OW');\n});\n\nyehuda.trigger('poke');\ntom.trigger('poke');\n```", + "itemtype": "method", + "name": "mixin", + "access": "private", + "tagname": "", + "params": [ + { + "name": "object", + "description": "object to extend with EventTarget methods", + "type": "Object" + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/events.js", + "line": 73, + "description": "Registers a callback to be executed when `eventName` is triggered\n\n```javascript\nobject.on('event', function(eventInfo){\n // handle the event\n});\n\nobject.trigger('event');\n```", + "itemtype": "method", + "name": "on", + "access": "private", + "tagname": "", + "params": [ + { + "name": "eventName", + "description": "name of the event to listen for", + "type": "String" + }, + { + "name": "callback", + "description": "function to be called when the event is triggered.", + "type": "Function" + } + ], + "class": "EventTarget", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/events.js", + "line": 107, + "description": "You can use `off` to stop firing a particular callback for an event:\n\n```javascript\nfunction doStuff() { // do stuff! }\nobject.on('stuff', doStuff);\n\nobject.trigger('stuff'); // doStuff will be called\n\n// Unregister ONLY the doStuff callback\nobject.off('stuff', doStuff);\nobject.trigger('stuff'); // doStuff will NOT be called\n```\n\nIf you don't pass a `callback` argument to `off`, ALL callbacks for the\nevent will not be executed when the event fires. For example:\n\n```javascript\nlet callback1 = function(){};\nlet callback2 = function(){};\n\nobject.on('stuff', callback1);\nobject.on('stuff', callback2);\n\nobject.trigger('stuff'); // callback1 and callback2 will be executed.\n\nobject.off('stuff');\nobject.trigger('stuff'); // callback1 and callback2 will not be executed!\n```", + "itemtype": "method", + "name": "off", + "access": "private", + "tagname": "", + "params": [ + { + "name": "eventName", + "description": "event to stop listening to", + "type": "String" + }, + { + "name": "callback", + "description": "optional argument. If given, only the function\ngiven will be removed from the event's callback queue. If no `callback`\nargument is given, all callbacks will be removed from the event's callback\nqueue.", + "type": "Function", + "optional": true + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/events.js", + "line": 162, + "description": "Use `trigger` to fire custom events. For example:\n\n```javascript\nobject.on('foo', function(){\n console.log('foo event happened!');\n});\nobject.trigger('foo');\n// 'foo event happened!' logged to the console\n```\n\nYou can also pass a value as a second argument to `trigger` that will be\npassed as an argument to all event listeners for the event:\n\n```javascript\nobject.on('foo', function(value){\n console.log(value.name);\n});\n\nobject.trigger('foo', { name: 'bar' });\n// 'bar' logged to the console\n```", + "itemtype": "method", + "name": "trigger", + "access": "private", + "tagname": "", + "params": [ + { + "name": "eventName", + "description": "name of the event to be triggered", + "type": "String" + }, + { + "name": "options", + "description": "optional value to be passed to any event handlers for\nthe given `eventName`", + "type": "*", + "optional": true + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/filter.js", + "line": 42, + "description": "`filter` is similar to JavaScript's native `filter` method.\n`filterFn` is eagerly called meaning that as soon as any promise\n resolves its value will be passed to `filterFn`. `filter` returns\n a promise that will become fulfilled with the result of running\n `filterFn` on the values the promises become fulfilled with.\n\n For example:\n\n ```javascript\n import { filter, resolve } from 'rsvp';\n\n let promise1 = resolve(1);\n let promise2 = resolve(2);\n let promise3 = resolve(3);\n\n let promises = [promise1, promise2, promise3];\n\n let filterFn = function(item){\n return item > 1;\n };\n\n filter(promises, filterFn).then(function(result){\n // result is [ 2, 3 ]\n });\n ```\n\n If any of the `promises` given to `filter` are rejected, the first promise\n that is rejected will be given as an argument to the returned promise's\n rejection handler. For example:\n\n ```javascript\n import { filter, reject, resolve } from 'rsvp';\n\n let promise1 = resolve(1);\n let promise2 = reject(new Error('2'));\n let promise3 = reject(new Error('3'));\n let promises = [ promise1, promise2, promise3 ];\n\n let filterFn = function(item){\n return item > 1;\n };\n\n filter(promises, filterFn).then(function(array){\n // Code here never runs because there are rejected promises!\n }, function(reason) {\n // reason.message === '2'\n });\n ```\n\n `filter` will also wait for any promises returned from `filterFn`.\n For instance, you may want to fetch a list of users then return a subset\n of those users based on some asynchronous operation:\n\n ```javascript\n import { filter, resolve } from 'rsvp';\n\n let alice = { name: 'alice' };\n let bob = { name: 'bob' };\n let users = [ alice, bob ];\n\n let promises = users.map(function(user){\n return resolve(user);\n });\n\n let filterFn = function(user){\n // Here, Alice has permissions to create a blog post, but Bob does not.\n return getPrivilegesForUser(user).then(function(privs){\n return privs.can_create_blog_post === true;\n });\n };\n filter(promises, filterFn).then(function(users){\n // true, because the server told us only Alice can create a blog post.\n users.length === 1;\n // false, because Alice is the only user present in `users`\n users[0] === bob;\n });\n ```", + "itemtype": "method", + "name": "filter", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "promises", + "description": "", + "type": "Array" + }, + { + "name": "filterFn", + "description": "- function to be called on each resolved value to\n filter the final results.", + "type": "Function" + }, + { + "name": "label", + "description": "optional string describing the promise. Useful for\n tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/hash-settled.js", + "line": 16, + "description": "`hashSettled` is similar to `allSettled`, but takes an object\ninstead of an array for its `promises` argument.\n\nUnlike `all` or `hash`, which implement a fail-fast method,\nbut like `allSettled`, `hashSettled` waits until all the\nconstituent promises have returned and then shows you all the results\nwith their states and values/reasons. This is useful if you want to\nhandle multiple promises' failure states together as a set.\n\nReturns a promise that is fulfilled when all the given promises have been\nsettled, or rejected if the passed parameters are invalid.\n\nThe returned promise is fulfilled with a hash that has the same key names as\nthe `promises` object argument. If any of the values in the object are not\npromises, they will be copied over to the fulfilled object and marked with state\n'fulfilled'.\n\nExample:\n\n```javascript\nimport { hashSettled, resolve } from 'rsvp';\n\nlet promises = {\n myPromise: resolve(1),\n yourPromise: resolve(2),\n theirPromise: resolve(3),\n notAPromise: 4\n};\n\nhashSettled(promises).then(function(hash){\n // hash here is an object that looks like:\n // {\n // myPromise: { state: 'fulfilled', value: 1 },\n // yourPromise: { state: 'fulfilled', value: 2 },\n // theirPromise: { state: 'fulfilled', value: 3 },\n // notAPromise: { state: 'fulfilled', value: 4 }\n // }\n});\n```\n\nIf any of the `promises` given to `hash` are rejected, the state will\nbe set to 'rejected' and the reason for rejection provided.\n\nExample:\n\n```javascript\nimport { hashSettled, reject, resolve } from 'rsvp';\n\nlet promises = {\n myPromise: resolve(1),\n rejectedPromise: reject(new Error('rejection')),\n anotherRejectedPromise: reject(new Error('more rejection')),\n};\n\nhashSettled(promises).then(function(hash){\n // hash here is an object that looks like:\n // {\n // myPromise: { state: 'fulfilled', value: 1 },\n // rejectedPromise: { state: 'rejected', reason: Error },\n // anotherRejectedPromise: { state: 'rejected', reason: Error },\n // }\n // Note that for rejectedPromise, reason.message == 'rejection',\n // and for anotherRejectedPromise, reason.message == 'more rejection'.\n});\n```\n\nAn important note: `hashSettled` is intended for plain JavaScript objects that\nare just a set of keys and values. `hashSettled` will NOT preserve prototype\nchains.\n\nExample:\n\n```javascript\nimport Promise, { hashSettled, resolve } from 'rsvp';\n\nfunction MyConstructor(){\n this.example = resolve('Example');\n}\n\nMyConstructor.prototype = {\n protoProperty: Promise.resolve('Proto Property')\n};\n\nlet myObject = new MyConstructor();\n\nhashSettled(myObject).then(function(hash){\n // protoProperty will not be present, instead you will just have an\n // object that looks like:\n // {\n // example: { state: 'fulfilled', value: 'Example' }\n // }\n //\n // hash.hasOwnProperty('protoProperty'); // false\n // 'undefined' === typeof hash.protoProperty\n});\n```", + "itemtype": "method", + "name": "hashSettled", + "access": "public", + "tagname": "", + "params": [ + { + "name": "object", + "description": "", + "type": "Object" + }, + { + "name": "label", + "description": "optional string that describes the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled when when all properties of `promises`\nhave been settled.", + "type": "Promise" + }, + "static": 1, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/hash.js", + "line": 4, + "description": "`hash` is similar to `all`, but takes an object instead of an array\nfor its `promises` argument.\n\nReturns a promise that is fulfilled when all the given promises have been\nfulfilled, or rejected if any of them become rejected. The returned promise\nis fulfilled with a hash that has the same key names as the `promises` object\nargument. If any of the values in the object are not promises, they will\nsimply be copied over to the fulfilled object.\n\nExample:\n\n```javascript\nlet promises = {\n myPromise: resolve(1),\n yourPromise: resolve(2),\n theirPromise: resolve(3),\n notAPromise: 4\n};\n\nhash(promises).then(function(hash){\n // hash here is an object that looks like:\n // {\n // myPromise: 1,\n // yourPromise: 2,\n // theirPromise: 3,\n // notAPromise: 4\n // }\n});\n```\n\nIf any of the `promises` given to `hash` are rejected, the first promise\nthat is rejected will be given as the reason to the rejection handler.\n\nExample:\n\n```javascript\nlet promises = {\n myPromise: resolve(1),\n rejectedPromise: reject(new Error('rejectedPromise')),\n anotherRejectedPromise: reject(new Error('anotherRejectedPromise')),\n};\n\nhash(promises).then(function(hash){\n // Code here never runs because there are rejected promises!\n}, function(reason) {\n // reason.message === 'rejectedPromise'\n});\n```\n\nAn important note: `hash` is intended for plain JavaScript objects that\nare just a set of keys and values. `hash` will NOT preserve prototype\nchains.\n\nExample:\n\n```javascript\nimport { hash, resolve } from 'rsvp';\nfunction MyConstructor(){\n this.example = resolve('Example');\n}\n\nMyConstructor.prototype = {\n protoProperty: resolve('Proto Property')\n};\n\nlet myObject = new MyConstructor();\n\nhash(myObject).then(function(hash){\n // protoProperty will not be present, instead you will just have an\n // object that looks like:\n // {\n // example: 'Example'\n // }\n //\n // hash.hasOwnProperty('protoProperty'); // false\n // 'undefined' === typeof hash.protoProperty\n});\n```", + "itemtype": "method", + "name": "hash", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "object", + "description": "", + "type": "Object" + }, + { + "name": "label", + "description": "optional string that describes the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled when all properties of `promises`\nhave been fulfilled, or rejected if any of them become rejected.", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/map.js", + "line": 39, + "description": "`map` is similar to JavaScript's native `map` method. `mapFn` is eagerly called\n meaning that as soon as any promise resolves its value will be passed to `mapFn`.\n `map` returns a promise that will become fulfilled with the result of running\n `mapFn` on the values the promises become fulfilled with.\n\n For example:\n\n ```javascript\n import { map, resolve } from 'rsvp';\n\n let promise1 = resolve(1);\n let promise2 = resolve(2);\n let promise3 = resolve(3);\n let promises = [ promise1, promise2, promise3 ];\n\n let mapFn = function(item){\n return item + 1;\n };\n\n map(promises, mapFn).then(function(result){\n // result is [ 2, 3, 4 ]\n });\n ```\n\n If any of the `promises` given to `map` are rejected, the first promise\n that is rejected will be given as an argument to the returned promise's\n rejection handler. For example:\n\n ```javascript\n import { map, reject, resolve } from 'rsvp';\n\n let promise1 = resolve(1);\n let promise2 = reject(new Error('2'));\n let promise3 = reject(new Error('3'));\n let promises = [ promise1, promise2, promise3 ];\n\n let mapFn = function(item){\n return item + 1;\n };\n\n map(promises, mapFn).then(function(array){\n // Code here never runs because there are rejected promises!\n }, function(reason) {\n // reason.message === '2'\n });\n ```\n\n `map` will also wait if a promise is returned from `mapFn`. For example,\n say you want to get all comments from a set of blog posts, but you need\n the blog posts first because they contain a url to those comments.\n\n ```javscript\n import { map } from 'rsvp';\n\n let mapFn = function(blogPost){\n // getComments does some ajax and returns an Promise that is fulfilled\n // with some comments data\n return getComments(blogPost.comments_url);\n };\n\n // getBlogPosts does some ajax and returns an Promise that is fulfilled\n // with some blog post data\n map(getBlogPosts(), mapFn).then(function(comments){\n // comments is the result of asking the server for the comments\n // of all blog posts returned from getBlogPosts()\n });\n ```", + "itemtype": "method", + "name": "map", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "promises", + "description": "", + "type": "Array" + }, + { + "name": "mapFn", + "description": "function to be called on each fulfilled promise.", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\n Useful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "promise that is fulfilled with the result of calling\n `mapFn` on each fulfilled promise or value when they become fulfilled.\n The promise will be rejected if any of the given `promises` become rejected.", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/node.js", + "line": 44, + "description": "`denodeify` takes a 'node-style' function and returns a function that\nwill return an `Promise`. You can use `denodeify` in Node.js or the\nbrowser when you'd prefer to use promises over using callbacks. For example,\n`denodeify` transforms the following:\n\n```javascript\nlet fs = require('fs');\n\nfs.readFile('myfile.txt', function(err, data){\n if (err) return handleError(err);\n handleData(data);\n});\n```\n\ninto:\n\n```javascript\nlet fs = require('fs');\nlet readFile = denodeify(fs.readFile);\n\nreadFile('myfile.txt').then(handleData, handleError);\n```\n\nIf the node function has multiple success parameters, then `denodeify`\njust returns the first one:\n\n```javascript\nlet request = denodeify(require('request'));\n\nrequest('http://example.com').then(function(res) {\n // ...\n});\n```\n\nHowever, if you need all success parameters, setting `denodeify`'s\nsecond parameter to `true` causes it to return all success parameters\nas an array:\n\n```javascript\nlet request = denodeify(require('request'), true);\n\nrequest('http://example.com').then(function(result) {\n // result[0] -> res\n // result[1] -> body\n});\n```\n\nOr if you pass it an array with names it returns the parameters as a hash:\n\n```javascript\nlet request = denodeify(require('request'), ['res', 'body']);\n\nrequest('http://example.com').then(function(result) {\n // result.res\n // result.body\n});\n```\n\nSometimes you need to retain the `this`:\n\n```javascript\nlet app = require('express')();\nlet render = denodeify(app.render.bind(app));\n```\n\nThe denodified function inherits from the original function. It works in all\nenvironments, except IE 10 and below. Consequently all properties of the original\nfunction are available to you. However, any properties you change on the\ndenodeified function won't be changed on the original function. Example:\n\n```javascript\nlet request = denodeify(require('request')),\n cookieJar = request.jar(); // <- Inheritance is used here\n\nrequest('http://example.com', {jar: cookieJar}).then(function(res) {\n // cookieJar.cookies holds now the cookies returned by example.com\n});\n```\n\nUsing `denodeify` makes it easier to compose asynchronous operations instead\nof using callbacks. For example, instead of:\n\n```javascript\nlet fs = require('fs');\n\nfs.readFile('myfile.txt', function(err, data){\n if (err) { ... } // Handle error\n fs.writeFile('myfile2.txt', data, function(err){\n if (err) { ... } // Handle error\n console.log('done')\n });\n});\n```\n\nyou can chain the operations together using `then` from the returned promise:\n\n```javascript\nlet fs = require('fs');\nlet readFile = denodeify(fs.readFile);\nlet writeFile = denodeify(fs.writeFile);\n\nreadFile('myfile.txt').then(function(data){\n return writeFile('myfile2.txt', data);\n}).then(function(){\n console.log('done')\n}).catch(function(error){\n // Handle error\n});\n```", + "itemtype": "method", + "name": "denodeify", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "nodeFunc", + "description": "a 'node-style' function that takes a callback as\nits last argument. The callback expects an error to be passed as its first\nargument (if an error occurred, otherwise null), and the value from the\noperation as its second argument ('function(err, value){ }').", + "type": "Function" + }, + { + "name": "options", + "description": "An optional paramter that if set\nto `true` causes the promise to fulfill with the callback's success arguments\nas an array. This is useful if the node function has multiple success\nparamters. If you set this paramter to an array with names, the promise will\nfulfill with a hash with these names as keys and the success parameters as\nvalues.", + "type": "Boolean|Array", + "optional": true + } + ], + "return": { + "description": "a function that wraps `nodeFunc` to return a `Promise`", + "type": "Function" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise.js", + "line": 155, + "description": "`catch` is simply sugar for `then(undefined, onRejection)` which makes it the same\nas the catch block of a try/catch statement.\n\n```js\nfunction findAuthor(){\n throw new Error('couldn\\'t find that author');\n}\n\n// synchronous\ntry {\n findAuthor();\n} catch(reason) {\n // something went wrong\n}\n\n// async with promises\nfindAuthor().catch(function(reason){\n // something went wrong\n});\n```", + "itemtype": "method", + "name": "catch", + "params": [ + { + "name": "onRejection", + "description": "", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "Promise", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise.js", + "line": 187, + "description": "`finally` will be invoked regardless of the promise's fate just as native\ntry/catch/finally behaves\n\nSynchronous example:\n\n```js\nfindAuthor() {\n if (Math.random() > 0.5) {\n throw new Error();\n }\n return new Author();\n}\n\ntry {\n return findAuthor(); // succeed or fail\n} catch(error) {\n return findOtherAuthor();\n} finally {\n // always runs\n // doesn't affect the return value\n}\n```\n\nAsynchronous example:\n\n```js\nfindAuthor().catch(function(reason){\n return findOtherAuthor();\n}).finally(function(){\n // author was either found, or not\n});\n```", + "itemtype": "method", + "name": "finally", + "params": [ + { + "name": "callback", + "description": "", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "Promise", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/promise.js", + "line": 248, + "description": "The primary way of interacting with a promise is through its `then` method,\nwhich registers callbacks to receive either a promise's eventual value or the\nreason why the promise cannot be fulfilled.\n\n```js\nfindUser().then(function(user){\n // user is available\n}, function(reason){\n // user is unavailable, and you are given the reason why\n});\n```\n\nChaining\n--------\n\nThe return value of `then` is itself a promise. This second, 'downstream'\npromise is resolved with the return value of the first promise's fulfillment\nor rejection handler, or rejected if the handler throws an exception.\n\n```js\nfindUser().then(function (user) {\n return user.name;\n}, function (reason) {\n return 'default name';\n}).then(function (userName) {\n // If `findUser` fulfilled, `userName` will be the user's name, otherwise it\n // will be `'default name'`\n});\n\nfindUser().then(function (user) {\n throw new Error('Found user, but still unhappy');\n}, function (reason) {\n throw new Error('`findUser` rejected and we\\'re unhappy');\n}).then(function (value) {\n // never reached\n}, function (reason) {\n // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.\n // If `findUser` rejected, `reason` will be '`findUser` rejected and we\\'re unhappy'.\n});\n```\nIf the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.\n\n```js\nfindUser().then(function (user) {\n throw new PedagogicalException('Upstream error');\n}).then(function (value) {\n // never reached\n}).then(function (value) {\n // never reached\n}, function (reason) {\n // The `PedgagocialException` is propagated all the way down to here\n});\n```\n\nAssimilation\n------------\n\nSometimes the value you want to propagate to a downstream promise can only be\nretrieved asynchronously. This can be achieved by returning a promise in the\nfulfillment or rejection handler. The downstream promise will then be pending\nuntil the returned promise is settled. This is called *assimilation*.\n\n```js\nfindUser().then(function (user) {\n return findCommentsByAuthor(user);\n}).then(function (comments) {\n // The user's comments are now available\n});\n```\n\nIf the assimliated promise rejects, then the downstream promise will also reject.\n\n```js\nfindUser().then(function (user) {\n return findCommentsByAuthor(user);\n}).then(function (comments) {\n // If `findCommentsByAuthor` fulfills, we'll have the value here\n}, function (reason) {\n // If `findCommentsByAuthor` rejects, we'll have the reason here\n});\n```\n\nSimple Example\n--------------\n\nSynchronous Example\n\n```javascript\nlet result;\n\ntry {\n result = findResult();\n // success\n} catch(reason) {\n // failure\n}\n```\n\nErrback Example\n\n```js\nfindResult(function(result, err){\n if (err) {\n // failure\n } else {\n // success\n }\n});\n```\n\nPromise Example;\n\n```javascript\nfindResult().then(function(result){\n // success\n}, function(reason){\n // failure\n});\n```\n\nAdvanced Example\n--------------\n\nSynchronous Example\n\n```javascript\nlet author, books;\n\ntry {\n author = findAuthor();\n books = findBooksByAuthor(author);\n // success\n} catch(reason) {\n // failure\n}\n```\n\nErrback Example\n\n```js\n\nfunction foundBooks(books) {\n\n}\n\nfunction failure(reason) {\n\n}\n\nfindAuthor(function(author, err){\n if (err) {\n failure(err);\n // failure\n } else {\n try {\n findBoooksByAuthor(author, function(books, err) {\n if (err) {\n failure(err);\n } else {\n try {\n foundBooks(books);\n } catch(reason) {\n failure(reason);\n }\n }\n });\n } catch(error) {\n failure(err);\n }\n // success\n }\n});\n```\n\nPromise Example;\n\n```javascript\nfindAuthor().\n then(findBooksByAuthor).\n then(function(books){\n // found books\n}).catch(function(reason){\n // something went wrong\n});\n```", + "itemtype": "method", + "name": "then", + "params": [ + { + "name": "onFulfillment", + "description": "", + "type": "Function" + }, + { + "name": "onRejection", + "description": "", + "type": "Function" + }, + { + "name": "label", + "description": "optional string for labeling the promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "", + "type": "Promise" + }, + "class": "Promise", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/race.js", + "line": 3, + "description": "This is a convenient alias for `Promise.race`.", + "itemtype": "method", + "name": "race", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "array", + "description": "Array of promises.", + "type": "Array" + }, + { + "name": "label", + "description": "An optional label. This is useful\nfor tooling.", + "type": "String", + "optional": true + } + ], + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/reject.js", + "line": 3, + "description": "This is a convenient alias for `Promise.reject`.", + "itemtype": "method", + "name": "reject", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "reason", + "description": "value that the returned promise will be rejected with.", + "type": "*" + }, + { + "name": "label", + "description": "optional string for identifying the returned promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise rejected with the given `reason`.", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/resolve.js", + "line": 3, + "description": "This is a convenient alias for `Promise.resolve`.", + "itemtype": "method", + "name": "resolve", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "value", + "description": "value that the returned promise will be resolved with", + "type": "*" + }, + { + "name": "label", + "description": "optional string for identifying the returned promise.\nUseful for tooling.", + "type": "String", + "optional": true + } + ], + "return": { + "description": "a promise that will become fulfilled with the given\n`value`", + "type": "Promise" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "node_modules/rsvp/lib/rsvp/rethrow.js", + "line": 1, + "description": "`rethrow` will rethrow an error on the next turn of the JavaScript event\nloop in order to aid debugging.\n\nPromises A+ specifies that any exceptions that occur with a promise must be\ncaught by the promises implementation and bubbled to the last handler. For\nthis reason, it is recommended that you always specify a second rejection\nhandler function to `then`. However, `rethrow` will throw the exception\noutside of the promise, so it bubbles up to your console if in the browser,\nor domain/cause uncaught exception in Node. `rethrow` will also throw the\nerror again so the error can be handled by the promise per the spec.\n\n```javascript\nimport { rethrow } from 'rsvp';\n\nfunction throws(){\n throw new Error('Whoops!');\n}\n\nlet promise = new Promise(function(resolve, reject){\n throws();\n});\n\npromise.catch(rethrow).then(function(){\n // Code here doesn't run because the promise became rejected due to an\n // error!\n}, function (err){\n // handle the error here\n});\n```\n\nThe 'Whoops' error will be thrown on the next turn of the event loop\nand you can watch for it in your console. You can also handle it using a\nrejection handler given to `.then` or `.catch` on the returned promise.", + "itemtype": "method", + "name": "rethrow", + "access": "public", + "tagname": "", + "static": 1, + "params": [ + { + "name": "reason", + "description": "reason the promise became rejected.", + "type": "Error" + } + ], + "throws": { + "description": "Error" + }, + "class": "rsvp", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 100, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "registry", + "type": "Registry", + "since": "1.11.0", + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 107, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "cache", + "type": "InheritingDict", + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 113, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "validationCache", + "type": "InheritingDict", + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 119, + "description": "Given a fullName return a corresponding instance.\n The default behavior is for lookup to return a singleton instance.\nThe singleton is scoped to the container, allowing multiple containers\nto all have their own locally scoped singletons.\n ```javascript\nlet registry = new Registry();\nlet container = registry.container();\n registry.register('api:twitter', Twitter);\n let twitter = container.lookup('api:twitter');\n twitter instanceof Twitter; // => true\n // by default the container will return singletons\nlet twitter2 = container.lookup('api:twitter');\ntwitter2 instanceof Twitter; // => true\n twitter === twitter2; //=> true\n```\n If singletons are not wanted, an optional flag can be provided at lookup.\n ```javascript\nlet registry = new Registry();\nlet container = registry.container();\n registry.register('api:twitter', Twitter);\n let twitter = container.lookup('api:twitter', { singleton: false });\nlet twitter2 = container.lookup('api:twitter', { singleton: false });\n twitter === twitter2; //=> false\n```", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "lookup", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "RegisterOptions", + "optional": true + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 161, + "description": "A depth first traversal, destroying the container, its descendant containers and all\ntheir managed objects.", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "destroy", + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 178, + "description": "Clear either the entire cache or just the cache for a particular key.", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "reset", + "params": [ + { + "name": "fullName", + "description": "optional key to reset; if missing, resets everything", + "type": "String" + } + ], + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 195, + "description": "Returns an object that can be used to provide an owner to a\nmanually created instance.", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "ownerInjection", + "return": { + "description": "", + "type": "Object" + }, + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/container.ts", + "line": 208, + "description": "Given a fullName, return the corresponding factory. The consumer of the factory\nis responsible for the destruction of any factory instances, as there is no\nway for the container to ensure instances are destroyed when it itself is\ndestroyed.", + "access": "public", + "tagname": "", + "itemtype": "method", + "name": "factoryFor", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "", + "type": "Any" + }, + "class": "Container", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 75, + "description": "A backup registry for resolving registrations when no matches can be found.", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "fallback", + "type": "Registry", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 83, + "description": "An object that has a `resolve` method that resolves a name.", + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "resolver", + "type": "Resolver", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 91, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "registrations", + "type": "InheritingDict", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 97, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_normalizeCache", + "type": "InheritingDict", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 104, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_resolveCache", + "type": "InheritingDict", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 111, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_options", + "type": "InheritingDict", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 118, + "access": "private", + "tagname": "", + "itemtype": "property", + "name": "_typeOptions", + "type": "InheritingDict", + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 125, + "description": "Creates a container based on this registry.", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "container", + "params": [ + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "return": { + "description": "created container", + "type": "Container" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 137, + "description": "Registers a factory for later injection.\n\nExample:\n\n```javascript\nlet registry = new Registry();\n\nregistry.register('model:user', Person, {singleton: false });\nregistry.register('fruit:favorite', Orange);\nregistry.register('communication:main', Email, {singleton: false});\n```", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "register", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "factory", + "description": "", + "type": "Function" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 186, + "description": "Unregister a fullName\n\n```javascript\nlet registry = new Registry();\nregistry.register('model:user', User);\n\nregistry.resolve('model:user').create() instanceof User //=> true\n\nregistry.unregister('model:user')\nregistry.resolve('model:user') === undefined //=> true\n```", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "unregister", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 214, + "description": "Given a fullName return the corresponding factory.\n\nBy default `resolve` will retrieve the factory from\nthe registry.\n\n```javascript\nlet registry = new Registry();\nregistry.register('api:twitter', Twitter);\n\nregistry.resolve('api:twitter') // => Twitter\n```\n\nOptionally the registry can be provided with a custom resolver.\nIf provided, `resolve` will first provide the custom resolver\nthe opportunity to resolve the fullName, otherwise it will fallback\nto the registry.\n\n```javascript\nlet registry = new Registry();\nregistry.resolver = function(fullName) {\n // lookup via the module system of choice\n };\n\n// the twitter factory is added to the module system\nregistry.resolve('api:twitter') // => Twitter\n```", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "resolve", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "fullName's factory", + "type": "Function" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 255, + "description": "A hook that can be used to describe how the resolver will\nattempt to find the factory.\n\nFor example, the default Ember `.describe` returns the full\nclass name (including namespace) where Ember's resolver expects\nto find the `fullName`.", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "describe", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "described fullName", + "type": "String" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 278, + "description": "A hook to enable custom fullName normalization behavior", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "normalizeFullName", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "normalized fullName", + "type": "String" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 296, + "description": "Normalize a fullName based on the application's conventions", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "normalize", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "normalized fullName", + "type": "String" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 311, + "itemtype": "method", + "name": "makeToString", + "access": "private", + "tagname": "", + "params": [ + { + "name": "factory", + "description": "", + "type": "Any" + }, + { + "name": "fullName", + "description": "", + "type": "String" + } + ], + "return": { + "description": "toString function", + "type": "Function" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 329, + "description": "Given a fullName check if the container is aware of its factory\nor singleton instance.", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "has", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object", + "optional": true, + "props": [ + { + "name": "source", + "description": "the fullname of the request source (used for local lookups)", + "type": "String", + "optional": true + } + ] + } + ], + "return": { + "description": "", + "type": "Boolean" + }, + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 348, + "description": "Allow registering options for all factories of a type.\n\n```javascript\nlet registry = new Registry();\nlet container = registry.container();\n\n// if all of type `connection` must not be singletons\nregistry.optionsForType('connection', { singleton: false });\n\nregistry.register('connection:twitter', TwitterConnection);\nregistry.register('connection:facebook', FacebookConnection);\n\nlet twitter = container.lookup('connection:twitter');\nlet twitter2 = container.lookup('connection:twitter');\n\ntwitter === twitter2; // => false\n\nlet facebook = container.lookup('connection:facebook');\nlet facebook2 = container.lookup('connection:facebook');\n\nfacebook === facebook2; // => false\n```", + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "optionsForType", + "params": [ + { + "name": "type", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 389, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "options", + "params": [ + { + "name": "fullName", + "description": "", + "type": "String" + }, + { + "name": "options", + "description": "", + "type": "Object" + } + ], + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/container/lib/registry.ts", + "line": 432, + "access": "private", + "tagname": "", + "itemtype": "method", + "name": "knownForType", + "params": [ + { + "name": "type", + "description": "the type to iterate over", + "type": "String" + } + ], + "class": "Registry", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/environment/lib/env.ts", + "line": 18, + "description": "Determines whether Ember should add to `Array`\nnative object prototypes, a few extra methods in order to provide a more\nfriendly API.\n\nWe generally recommend leaving this option set to true however, if you need\nto turn it off, you can add the configuration property\n`EXTEND_PROTOTYPES` to `EmberENV` and set it to `false`.\n\nNote, when disabled (the default configuration for Ember Addons), you will\ninstead have to access all methods and functions from the Ember\nnamespace.", + "itemtype": "property", + "name": "EXTEND_PROTOTYPES", + "type": "Boolean", + "default": "true", + "access": "public", + "tagname": "", + "class": "EmberENV", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/environment/lib/env.ts", + "line": 41, + "description": "The `LOG_STACKTRACE_ON_DEPRECATION` property, when true, tells Ember to log\na full stack trace during deprecation warnings.", + "itemtype": "property", + "name": "LOG_STACKTRACE_ON_DEPRECATION", + "type": "Boolean", + "default": "true", + "access": "public", + "tagname": "", + "class": "EmberENV", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/environment/lib/env.ts", + "line": 53, + "description": "The `LOG_VERSION` property, when true, tells Ember to log versions of all\ndependent libraries in use.", + "itemtype": "property", + "name": "LOG_VERSION", + "type": "Boolean", + "default": "true", + "access": "public", + "tagname": "", + "class": "EmberENV", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/environment/lib/env.ts", + "line": 69, + "description": "Whether to insert a `
` wrapper around the\napplication template. See RFC #280.\n\nThis is not intended to be set directly, as the implementation may change in\nthe future. Use `@ember/optional-features` instead.", + "itemtype": "property", + "name": "_APPLICATION_TEMPLATE_WRAPPER", + "type": "Boolean", + "default": "true", + "access": "private", + "tagname": "", + "class": "EmberENV", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/environment/lib/env.ts", + "line": 84, + "description": "Whether to use Glimmer Component semantics (as opposed to the classic \"Curly\"\ncomponents semantics) for template-only components. See RFC #278.\n\nThis is not intended to be set directly, as the implementation may change in\nthe future. Use `@ember/optional-features` instead.", + "itemtype": "property", + "name": "_TEMPLATE_ONLY_GLIMMER_COMPONENTS", + "type": "Boolean", + "default": "false", + "access": "private", + "tagname": "", + "class": "EmberENV", + "module": "rsvp" + }, + { + "file": "packages/@ember/-internals/environment/lib/env.ts", + "line": 99, + "description": "Whether to perform extra bookkeeping needed to make the `captureRenderTree`\nAPI work.\n\nThis has to be set before the ember JavaScript code is evaluated. This is\nusually done by setting `window.EmberENV = { _DEBUG_RENDER_TREE: true };`\nbefore the \"vendor\" `