Skip to content

Commit 1825d63

Browse files
committed
Updated reference documentation
1 parent df83cc8 commit 1825d63

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

lib/reference.js

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ var git = require('../'),
66
*
77
* @constructor
88
* @param {git.raw.Repo} rawRepo
9-
* @param {git.raw.Reference|null} rawReference
9+
* @param {git.raw.Reference} [rawReference = new git.raw.Reference()]
1010
*/
1111
var Reference = function(rawRepo, rawReference) {
1212
if (!(rawRepo instanceof git.raw.Repo)) {
@@ -24,10 +24,15 @@ var Reference = function(rawRepo, rawReference) {
2424
/**
2525
* Lookup the reference with the given name.
2626
*
27-
* @param {String} name
28-
* @param {Function} callback
27+
* @param {String} name
28+
* @param {Reference~lookupCallback} callback
2929
*/
3030
Reference.prototype.lookup = function(name, callback) {
31+
/**
32+
* @callback Reference~lookupCallback Callback executed on lookup completion.
33+
* @param {GitError|null} error An Error or null if successful.
34+
* @param {Reference|null} reference Retrieved reference object or null.
35+
*/
3136
var self = this;
3237
self.rawReference.lookup(self.rawRepo, name, function referenceLookup(error, rawReference) {
3338
if (!success(error, callback)) {
@@ -41,9 +46,14 @@ Reference.prototype.lookup = function(name, callback) {
4146
/**
4247
* Get the Oid representing this reference.
4348
*
44-
* @param {Function} callback
49+
* @param {Reference~oidCallback} callback
4550
*/
4651
Reference.prototype.oid = function(callback) {
52+
/**
53+
* @callback Reference~oidCallback Callback executed on oid retrieval.
54+
* @param {GitError|null} error An Error or null if successful.
55+
* @param {Oid|null} oid Retrieved Oid object or null.
56+
*/
4757
this.rawReference.oid(function referenceOid(error, rawOid) {
4858
if (success(error, callback)) {
4959
callback(null, new git.oid(rawOid));

0 commit comments

Comments
 (0)