Skip to content

Commit c285f8e

Browse files
jkwluiJustinBeckwith
authored andcommitted
fix(docs): place doc comment above the last overload (#187)
1 parent 1d8dba6 commit c285f8e

File tree

4 files changed

+58
-48
lines changed

4 files changed

+58
-48
lines changed

packages/google-cloud-dns/src/change.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,10 @@ export class Change extends ServiceObject {
197197
requestModule: teenyRequest as typeof r,
198198
});
199199
}
200+
201+
create(config?: CreateChangeRequest): Promise<CreateChangeResponse>;
202+
create(config: CreateChangeRequest, callback: CreateChangeCallback): void;
203+
create(callback: CreateChangeCallback): void;
200204
/**
201205
* Create a change.
202206
*
@@ -231,9 +235,6 @@ export class Change extends ServiceObject {
231235
* const apiResponse = data[1];
232236
* });
233237
*/
234-
create(config?: CreateChangeRequest): Promise<CreateChangeResponse>;
235-
create(config: CreateChangeRequest, callback: CreateChangeCallback): void;
236-
create(callback: CreateChangeCallback): void;
237238
create(
238239
configOrCallback?: CreateChangeRequest|CreateChangeCallback,
239240
callback?: CreateChangeCallback): void|Promise<CreateChangeResponse> {

packages/google-cloud-dns/src/index.ts

+10-7
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,11 @@ class DNS extends Service {
161161
*/
162162
this.getZonesStream = paginator.streamify('getZones');
163163
}
164+
165+
createZone(name: string, config: CreateZoneRequest):
166+
Promise<CreateZoneResponse>;
167+
createZone(
168+
name: string, config: CreateZoneRequest, callback: GetZoneCallback): void;
164169
/**
165170
* Config to set for the zone.
166171
*
@@ -218,10 +223,6 @@ class DNS extends Service {
218223
* const apiResponse = data[1];
219224
* });
220225
*/
221-
createZone(name: string, config: CreateZoneRequest):
222-
Promise<CreateZoneResponse>;
223-
createZone(
224-
name: string, config: CreateZoneRequest, callback: GetZoneCallback): void;
225226
createZone(
226227
name: string, config: CreateZoneRequest,
227228
callback?: GetZoneCallback): void|Promise<CreateZoneResponse> {
@@ -250,6 +251,10 @@ class DNS extends Service {
250251
callback!(null, zone, resp);
251252
});
252253
}
254+
255+
getZones(query?: GetZonesRequest): Promise<GetZonesResponse>;
256+
getZones(callback: GetZonesCallback): void;
257+
getZones(query: GetZonesRequest, callback: GetZonesCallback): void;
253258
/**
254259
* Query object for listing zones.
255260
*
@@ -296,9 +301,6 @@ class DNS extends Service {
296301
* const zones = data[0];
297302
* });
298303
*/
299-
getZones(query?: GetZonesRequest): Promise<GetZonesResponse>;
300-
getZones(callback: GetZonesCallback): void;
301-
getZones(query: GetZonesRequest, callback: GetZonesCallback): void;
302304
getZones(
303305
queryOrCallback?: GetZonesRequest|GetZonesCallback,
304306
callback?: GetZonesCallback): void|Promise<GetZonesResponse> {
@@ -329,6 +331,7 @@ class DNS extends Service {
329331
callback!(null, zones, nextQuery, resp);
330332
});
331333
}
334+
332335
/**
333336
* Get a reference to a Zone.
334337
*

packages/google-cloud-dns/src/record.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ export class Record implements RecordObject {
112112
}
113113
}
114114

115+
delete(): Promise<DeleteRecordResponse>;
116+
delete(callback: CreateChangeCallback): void;
115117
/**
116118
* Delete this record by creating a change on your zone. This is a convenience
117119
* method for:
@@ -149,8 +151,6 @@ export class Record implements RecordObject {
149151
* const apiResponse = data[1];
150152
* });
151153
*/
152-
delete(): Promise<DeleteRecordResponse>;
153-
delete(callback: CreateChangeCallback): void;
154154
delete(callback?: CreateChangeCallback): void|Promise<DeleteRecordResponse> {
155155
this.zone_.deleteRecords(this, callback!);
156156
}

packages/google-cloud-dns/src/zone.ts

+42-36
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,8 @@ class Zone extends ServiceObject {
344344
this.getChangesStream = paginator.streamify('getChanges');
345345
}
346346

347+
addRecords(records: Record|Record[]): Promise<CreateChangeResponse>;
348+
addRecords(records: Record|Record[], callback: CreateChangeCallback): void;
347349
/**
348350
* Add records to this zone. This is a convenience wrapper around
349351
* {@link Zone#createChange}.
@@ -354,8 +356,6 @@ class Zone extends ServiceObject {
354356
* @param {CreateChangeCallback} [callback] Callback function.
355357
* @returns {Promise<CreateChangeResponse>}
356358
*/
357-
addRecords(records: Record|Record[]): Promise<CreateChangeResponse>;
358-
addRecords(records: Record|Record[], callback: CreateChangeCallback): void;
359359
addRecords(records: Record|Record[], callback?: CreateChangeCallback):
360360
void|Promise<CreateChangeResponse> {
361361
this.createChange({add: records}, callback!);
@@ -376,6 +376,9 @@ class Zone extends ServiceObject {
376376
return new Change(this, id);
377377
}
378378

379+
createChange(config: CreateChangeRequest): Promise<CreateChangeResponse>;
380+
createChange(config: CreateChangeRequest, callback: CreateChangeCallback):
381+
void;
379382
/**
380383
* Create a change of resource record sets for the zone.
381384
*
@@ -421,9 +424,6 @@ class Zone extends ServiceObject {
421424
* const apiResponse = data[1];
422425
* });
423426
*/
424-
createChange(config: CreateChangeRequest): Promise<CreateChangeResponse>;
425-
createChange(config: CreateChangeRequest, callback: CreateChangeCallback):
426-
void;
427427
createChange(config: CreateChangeRequest, callback?: CreateChangeCallback):
428428
void|Promise<CreateChangeResponse> {
429429
if (!config || (!config.add && !config.delete)) {
@@ -475,6 +475,9 @@ class Zone extends ServiceObject {
475475
});
476476
}
477477

478+
delete(options?: DeleteZoneConfig): Promise<DeleteZoneResponse>;
479+
delete(callback: DeleteZoneCallback): void;
480+
delete(options: DeleteZoneConfig, callback: DeleteZoneCallback): void;
478481
/**
479482
* Delete the zone.
480483
*
@@ -519,9 +522,6 @@ class Zone extends ServiceObject {
519522
* const apiResponse = data[0];
520523
* });
521524
*/
522-
delete(options?: DeleteZoneConfig): Promise<DeleteZoneResponse>;
523-
delete(callback: DeleteZoneCallback): void;
524-
delete(options: DeleteZoneConfig, callback: DeleteZoneCallback): void;
525525
delete(
526526
optionsOrCallback?: DeleteZoneConfig|DeleteZoneCallback,
527527
callback?: DeleteZoneCallback): void|Promise<DeleteZoneResponse> {
@@ -542,6 +542,11 @@ class Zone extends ServiceObject {
542542
super.delete(callback!);
543543
}
544544

545+
deleteRecords(records?: Record|Record[]|
546+
string): Promise<CreateChangeResponse>;
547+
deleteRecords(callback: CreateChangeCallback): void;
548+
deleteRecords(
549+
records: Record|Record[]|string, callback: CreateChangeCallback): void;
545550
/**
546551
* Delete records from this zone. This is a convenience wrapper around
547552
* {@link Zone#createChange}.
@@ -620,11 +625,6 @@ class Zone extends ServiceObject {
620625
* const apiResponse = data[1];
621626
* });
622627
*/
623-
deleteRecords(records?: Record|Record[]|
624-
string): Promise<CreateChangeResponse>;
625-
deleteRecords(callback: CreateChangeCallback): void;
626-
deleteRecords(
627-
records: Record|Record[]|string, callback: CreateChangeCallback): void;
628628
deleteRecords(
629629
recordsOrCallback?: Record|Record[]|string|CreateChangeCallback,
630630
callback?: CreateChangeCallback): void|Promise<CreateChangeResponse> {
@@ -642,6 +642,9 @@ class Zone extends ServiceObject {
642642
}
643643
this.createChange({delete: records as Record[]}, callback!);
644644
}
645+
646+
empty(): Promise<CreateChangeResponse|[]>;
647+
empty(callback: CreateChangeCallback): void;
645648
/**
646649
* Emptying your zone means leaving only 'NS' and 'SOA' records. This method
647650
* will first fetch the non-NS and non-SOA records from your zone using
@@ -653,8 +656,6 @@ class Zone extends ServiceObject {
653656
* @param {CreateChangeCallback} [callback] Callback function.
654657
* @returns {Promise<CreateChangeResponse>}
655658
*/
656-
empty(): Promise<CreateChangeResponse|[]>;
657-
empty(callback: CreateChangeCallback): void;
658659
empty(callback?: CreateChangeCallback):
659660
void|Promise<CreateChangeResponse|[]> {
660661
this.getRecords((err, records) => {
@@ -672,6 +673,9 @@ class Zone extends ServiceObject {
672673
}
673674
});
674675
}
676+
677+
export(localPath: string): Promise<ZoneExportResponse>;
678+
export(localPath: string, callback: ZoneExportCallback): void;
675679
/**
676680
* Provide a path to a zone file to copy records into the zone.
677681
*
@@ -699,8 +703,6 @@ class Zone extends ServiceObject {
699703
* //-
700704
* zone.export(zoneFilename).then(() => {});
701705
*/
702-
export(localPath: string): Promise<ZoneExportResponse>;
703-
export(localPath: string, callback: ZoneExportCallback): void;
704706
export(localPath: string, callback?: ZoneExportCallback):
705707
void|Promise<ZoneExportResponse> {
706708
this.getRecords((err, records) => {
@@ -714,6 +716,10 @@ class Zone extends ServiceObject {
714716
});
715717
});
716718
}
719+
720+
getChanges(query?: GetChangesRequest): Promise<GetChangesResponse>;
721+
getChanges(callback: GetChangesCallback): void;
722+
getChanges(query: GetChangesRequest, callback: GetChangesCallback): void;
717723
/**
718724
* Get the list of changes associated with this zone. A change is an atomic
719725
* update to a collection of records.
@@ -753,9 +759,6 @@ class Zone extends ServiceObject {
753759
* const changes = data[0];
754760
* });
755761
*/
756-
getChanges(query?: GetChangesRequest): Promise<GetChangesResponse>;
757-
getChanges(callback: GetChangesCallback): void;
758-
getChanges(query: GetChangesRequest, callback: GetChangesCallback): void;
759762
getChanges(
760763
queryOrCallback?: GetChangesRequest|GetChangesCallback,
761764
callback?: GetChangesCallback): void|Promise<GetChangesResponse> {
@@ -792,6 +795,13 @@ class Zone extends ServiceObject {
792795
callback!(null, changes, nextQuery, resp);
793796
});
794797
}
798+
799+
getRecords(query?: GetRecordsRequest|string|
800+
string[]): Promise<GetRecordsResponse>;
801+
getRecords(callback: GetRecordsCallback): void;
802+
getRecords(
803+
query: GetRecordsRequest|string|string[],
804+
callback: GetRecordsCallback): void;
795805
/**
796806
* Query object for listing records.
797807
*
@@ -883,12 +893,6 @@ class Zone extends ServiceObject {
883893
* const records = data[0];
884894
* });
885895
*/
886-
getRecords(query?: GetRecordsRequest|string|
887-
string[]): Promise<GetRecordsResponse>;
888-
getRecords(callback: GetRecordsCallback): void;
889-
getRecords(
890-
query: GetRecordsRequest|string|string[],
891-
callback: GetRecordsCallback): void;
892896
getRecords(
893897
queryOrCallback?: GetRecordsRequest|GetRecordsCallback|string|string[],
894898
callback?: GetRecordsCallback): void|Promise<GetRecordsResponse> {
@@ -939,6 +943,9 @@ class Zone extends ServiceObject {
939943
callback!(null, records, nextQuery, resp);
940944
});
941945
}
946+
947+
import(localPath: string): Promise<CreateChangeResponse>;
948+
import(localPath: string, callback: CreateChangeCallback): void;
942949
/**
943950
* Copy the records from a zone file into this zone.
944951
*
@@ -968,8 +975,6 @@ class Zone extends ServiceObject {
968975
* const apiResponse = data[1];
969976
* });
970977
*/
971-
import(localPath: string): Promise<CreateChangeResponse>;
972-
import(localPath: string, callback: CreateChangeCallback): void;
973978
import(localPath: string, callback?: CreateChangeCallback): void|Promise<CreateChangeResponse> {fs.readFile(localPath, 'utf-8', (err, file) => {
974979
if (err) {
975980
callback!(err);
@@ -1043,8 +1048,13 @@ import(localPath: string, callback?: CreateChangeCallback): void|Promise<CreateC
10431048
*/
10441049
record(type: string, metadata: RecordMetadata) {return new Record(this, type, metadata);}
10451050

1051+
replaceRecords(recordType: string|string[], newRecords: Record|Record[]): Promise<CreateChangeResponse>;
1052+
replaceRecords(
1053+
recordType: string|string[], newRecords: Record|Record[],
1054+
callback: CreateChangeCallback): void;
10461055
/**
1047-
* Provide a record type that should be deleted and replaced with other records.
1056+
* Provide a record type that should be deleted and replaced with other
1057+
* records.
10481058
*
10491059
* **This is not an atomic request.** Two API requests are made
10501060
* (one to get records of the type that you've requested, then another to
@@ -1095,10 +1105,6 @@ import(localPath: string, callback?: CreateChangeCallback): void|Promise<CreateC
10951105
* const apiResponse = data[1];
10961106
* });
10971107
*/
1098-
replaceRecords(recordType: string|string[], newRecords: Record|Record[]): Promise<CreateChangeResponse>;
1099-
replaceRecords(
1100-
recordType: string|string[], newRecords: Record|Record[],
1101-
callback: CreateChangeCallback): void;
11021108
replaceRecords(
11031109
recordType: string|string[], newRecords: Record|Record[],
11041110
callback?: CreateChangeCallback): void|Promise<CreateChangeResponse> {
@@ -1116,6 +1122,9 @@ import(localPath: string, callback?: CreateChangeCallback): void|Promise<CreateC
11161122
});
11171123
}
11181124

1125+
deleteRecordsByType_(recordTypes: string[]): Promise<CreateChangeResponse>;
1126+
deleteRecordsByType_(recordTypes: string[], callback: CreateChangeCallback):
1127+
void;
11191128
/**
11201129
* Delete records from the zone matching an array of types.
11211130
*
@@ -1134,9 +1143,6 @@ import(localPath: string, callback?: CreateChangeCallback): void|Promise<CreateC
11341143
* }
11351144
* });
11361145
*/
1137-
deleteRecordsByType_(recordTypes: string[]): Promise<CreateChangeResponse>;
1138-
deleteRecordsByType_(recordTypes: string[], callback: CreateChangeCallback):
1139-
void;
11401146
deleteRecordsByType_(recordTypes: string[], callback?: CreateChangeCallback):
11411147
void|Promise<CreateChangeResponse> {
11421148
this.getRecords(recordTypes, (err, records) => {

0 commit comments

Comments
 (0)