docs: Add parameters to remaining commit overloads#1441
docs: Add parameters to remaining commit overloads#1441shivanee-p wants to merge 2 commits intomainfrom
commit overloads#1441Conversation
b365601 to
50cce00
Compare
danieljbruce
left a comment
There was a problem hiding this comment.
Overall it's a vast improvement over what was already there. Great job!
There are just a few nits that are worth looking at and then this should likely be good to merge. After this PR, we will want to make all code changes are made in the new monorepo at https://github.com/googleapis/google-cloud-node as this repository is currently being deprecated.
| * // If the callback is omitted, we'll return a Promise. | ||
| * //- | ||
| * transaction.commit().then((data) => { | ||
| * const apiResponse = data[0]; |
There was a problem hiding this comment.
First and foremost, I think it is worth it for me to post a link here at https://docs.cloud.google.com/nodejs/docs/reference/datastore/latest/datastore/transaction#_google_cloud_datastore_Transaction_commit_member_1_ to the documentation that is going to change. That way when we update the docs we can easily check what changes were made.
| /** | ||
| * @param {CallOptions} [gaxOptions] Request configuration options. | ||
| * See {@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions CallOptions Docs}. | ||
| * @param {CommitCallback} callback The callback function. |
There was a problem hiding this comment.
nit: callback should probably be [callback].
| * @param {object} [gaxOptions] Request configuration options, outlined here: | ||
| * https://googleapis.github.io/gax-nodejs/global.html#CallOptions. | ||
| * @param {object} [gaxOptions] Request configuration options. | ||
| * See {@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions CallOptions Docs}. |
There was a problem hiding this comment.
I think the * @param {object} [gaxOptions] parameter can be eliminated entirely because its not in the following commit(callback: CommitCallback) signature?
| * https://googleapis.github.io/gax-nodejs/global.html#CallOptions. | ||
| * @param {object} [gaxOptions] Request configuration options. | ||
| * See {@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions CallOptions Docs}. | ||
| * @param {function} callback The callback function. |
There was a problem hiding this comment.
I think this function can be replaced with the more specific CommitCallback type.
| /** | ||
| * @param {CallOptions} [gaxOptionsOrCallback] Request configuration options. | ||
| * See {@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions CallOptions Docs}. | ||
| * @param cb The callback function. |
There was a problem hiding this comment.
nit: We should probably add {CommitCallback} here so that the parameter has a type. Also we should wrap cb in square brackets. ie. [cb].
Description
This PR is part of a larger effort to update our documentation for method parameters to contain a type link for that type.
Impact
This will update our documentation and add more lines of description for our users.
Checklist