Skip to content

Commit 38ae160

Browse files
JustinBeckwithshivanee-p
authored andcommitted
docs: improve jsdoc (#689)
1 parent 9e5aba2 commit 38ae160

11 files changed

Lines changed: 99 additions & 147 deletions

File tree

handwritten/bigtable/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ npm install @google-cloud/bigtable
5656

5757
```javascript
5858
// Imports the Google Cloud client library
59-
const Bigtable = require('@google-cloud/bigtable');
59+
const {Bigtable} = require('@google-cloud/bigtable');
6060

61-
const bigtable = Bigtable();
61+
const bigtable = new Bigtable();
6262

6363
async function quickstart() {
6464
// Connect to an existing instance:my-bigtable-instance

handwritten/bigtable/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"scripts": {
2828
"compile": "tsc -p . && cp -r proto* build/",
2929
"compile-protos": "compileProtos src",
30+
"predocs": "npm run compile",
3031
"docs": "jsdoc -c .jsdoc.js",
3132
"predocs-test": "npm run docs",
3233
"docs-test": "linkinator docs",

handwritten/bigtable/src/app-profile.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export type SetAppProfileMetadataResponse = [google.protobuf.Empty];
125125
* @param {string} name Name of the app profile.
126126
*
127127
* @example
128-
* const Bigtable = require('@google-cloud/bigtable');
128+
* const {Bigtable} = require('@google-cloud/bigtable');
129129
* const bigtable = new Bigtable();
130130
* const instance = bigtable.instance('my-instance');
131131
* const appProfile = instance.appProfile('my-app-profile');

handwritten/bigtable/src/cluster.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export type GetClusterMetadataCallback = (
8383
* @param {string} id Id of the cluster.
8484
*
8585
* @example
86-
* const Bigtable = require('@google-cloud/bigtable');
86+
* const {Bigtable} = require('@google-cloud/bigtable');
8787
* const bigtable = new Bigtable();
8888
* const instance = bigtable.instance('my-instance');
8989
* const cluster = instance.cluster('my-cluster');

handwritten/bigtable/src/family.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export class FamilyError extends Error {
9797
* @param {string} id
9898
*
9999
* @example
100-
* const Bigtable = require('@google-cloud/bigtable');
100+
* const {Bigtable} = require('@google-cloud/bigtable');
101101
* const bigtable = new Bigtable();
102102
* const instance = bigtable.instance('my-instance');
103103
* const table = instance.table('prezzy');

handwritten/bigtable/src/filter.ts

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ export class Filter {
133133
* @returns {string}
134134
*
135135
* @example
136-
* var regexString = Filter.convertToRegExpString(['a', 'b', 'c']);
136+
* const regexString = Filter.convertToRegExpString(['a', 'b', 'c']);
137137
* // => '(a|b|c)'
138138
*/
139139
static convertToRegExpString(
@@ -185,10 +185,10 @@ export class Filter {
185185
* @returns {object}
186186
*
187187
* @example
188-
* const Bigtable = require('@google-cloud/bigtable');
188+
* const {Bigtable} = require('@google-cloud/bigtable');
189189
* const Filter = Bigtable.Filter;
190190
*
191-
* var range = Filter.createRange('value1', 'value2', 'Test');
191+
* const range = Filter.createRange('value1', 'value2', 'Test');
192192
* // {
193193
* // startTestInclusive: new Buffer('value1'),
194194
* // endTestExclusive: new Buffer('value2')
@@ -198,12 +198,12 @@ export class Filter {
198198
* // It's also possible to pass in objects to specify inclusive/exclusive
199199
* // bounds.
200200
* //-
201-
* var upperBound = {
201+
* const upperBound = {
202202
* value: 'value3',
203203
* inclusive: false
204204
* };
205205
*
206-
* var range = Filter.createRange(upperBound, null, 'Test2');
206+
* const range = Filter.createRange(upperBound, null, 'Test2');
207207
* // => {
208208
* // startTest2Exclusive: 'value3'
209209
* // }
@@ -244,7 +244,7 @@ export class Filter {
244244
* @returns {object}
245245
*
246246
* @example
247-
* var filter = Filter.parse([
247+
* const filter = Filter.parse([
248248
* {
249249
* family: 'my-family',
250250
* }, {
@@ -292,15 +292,15 @@ export class Filter {
292292
* // Matches all cells, regardless of input. Functionally equivalent to
293293
* // leaving `filter` unset, but included for completeness.
294294
* //-
295-
* var filter = {
295+
* const filter = {
296296
* all: true
297297
* };
298298
*
299299
* //-
300300
* // Does not match any cells, regardless of input. Useful for temporarily
301301
* // disabling just part of a filter.
302302
* //-
303-
* var filter = {
303+
* const filter = {
304304
* all: false
305305
* };
306306
*/
@@ -324,7 +324,7 @@ export class Filter {
324324
* // Using the following filter, we would retrieve the `tjefferson` and
325325
* // `gwashington` columns.
326326
* //-
327-
* var filter = [
327+
* const filter = [
328328
* {
329329
* column: /[a-z]+on$/
330330
* }
@@ -334,7 +334,7 @@ export class Filter {
334334
* // You can also provide a string (optionally containing regexp characters)
335335
* // for simple column filters.
336336
* //-
337-
* var filter = [
337+
* const filter = [
338338
* {
339339
* column: 'gwashington'
340340
* }
@@ -344,7 +344,7 @@ export class Filter {
344344
* // Or you can provide an array of strings if you wish to match against
345345
* // multiple columns.
346346
* //-
347-
* var filter = [
347+
* const filter = [
348348
* {
349349
* column: [
350350
* 'gwashington',
@@ -357,7 +357,7 @@ export class Filter {
357357
* // If you wish to use additional column filters, consider using the following
358358
* // syntax.
359359
* //-
360-
* var filter = [
360+
* const filter = [
361361
* {
362362
* column: {
363363
* name: 'gwashington'
@@ -377,7 +377,7 @@ export class Filter {
377377
* // {@link Filter#interleave} filter, each copy of the cell is
378378
* // counted separately.
379379
* //-
380-
* var filter = [
380+
* const filter = [
381381
* {
382382
* column: {
383383
* cellLimit: 2
@@ -396,7 +396,7 @@ export class Filter {
396396
* // When the `start` bound is omitted it is interpreted as an empty string.
397397
* // When the `end` bound is omitted it is interpreted as Infinity.
398398
* //-
399-
* var filter = [
399+
* const filter = [
400400
* {
401401
* column: {
402402
* family: 'follows',
@@ -411,7 +411,7 @@ export class Filter {
411411
* // override these by providing an object explicity stating whether or not it
412412
* // is `inclusive`.
413413
* //-
414-
* var filter = [
414+
* const filter = [
415415
* {
416416
* column: {
417417
* family: 'follows',
@@ -475,7 +475,7 @@ export class Filter {
475475
* // `gwashington` data. If he does not, we'll instead return all of the
476476
* // `tjefferson` data.
477477
* //-
478-
* var filter = [
478+
* const filter = [
479479
* {
480480
* condition: {
481481
* // If `test` outputs any cells, then `pass` will be evaluated on the
@@ -528,7 +528,7 @@ export class Filter {
528528
* @param {regex} family Expression to filter family
529529
*
530530
* @example
531-
* var filter = [
531+
* const filter = [
532532
* {
533533
* family: 'follows'
534534
* }
@@ -564,7 +564,7 @@ export class Filter {
564564
* // results for entries that were either created between December 17th, 2015
565565
* // and March 22nd, 2016 or entries that have data for `follows:tjefferson`.
566566
* //-
567-
* var filter = [
567+
* const filter = [
568568
* {
569569
* interleave: [
570570
* [
@@ -610,7 +610,7 @@ export class Filter {
610610
* may be relaxed in the future.
611611
*
612612
* @example
613-
* var filter = {
613+
* const filter = {
614614
* label: 'my-label'
615615
* };
616616
*/
@@ -636,7 +636,7 @@ export class Filter {
636636
* // row keys ending with the letters "on", which would then yield
637637
* // `gwashington` and `tjefferson`.
638638
* //-
639-
* var filter = [
639+
* const filter = [
640640
* {
641641
* row: /[a-z]+on$/
642642
* }
@@ -646,7 +646,7 @@ export class Filter {
646646
* // You can also provide a string (optionally containing regexp characters)
647647
* // for simple key filters.
648648
* //-
649-
* var filter = [
649+
* const filter = [
650650
* {
651651
* row: 'gwashington'
652652
* }
@@ -656,7 +656,7 @@ export class Filter {
656656
* // Or you can provide an array of strings if you wish to match against
657657
* // multiple keys.
658658
* //-
659-
* var filter = [
659+
* const filter = [
660660
* {
661661
* row: [
662662
* 'gwashington',
@@ -669,7 +669,7 @@ export class Filter {
669669
* // If you wish to use additional row filters, consider using the following
670670
* // syntax.
671671
* //-
672-
* var filter = [
672+
* const filter = [
673673
* {
674674
* row: {
675675
* key: 'gwashington'
@@ -683,7 +683,7 @@ export class Filter {
683683
* // Matches all cells from a row with probability p, and matches no cells
684684
* // from the row with probability 1-p.
685685
* //-
686-
* var filter = [
686+
* const filter = [
687687
* {
688688
* row: {
689689
* sample: 1
@@ -699,7 +699,7 @@ export class Filter {
699699
* // {@link Filter#interleave}, each copy of the cell is counted
700700
* // separately.
701701
* //-
702-
* var filter = [
702+
* const filter = [
703703
* {
704704
* row: {
705705
* cellOffset: 2
@@ -715,7 +715,7 @@ export class Filter {
715715
* // {@link Filter#interleave}, each copy of the cell is counted
716716
* // separately.
717717
* //-
718-
* var filter = [
718+
* const filter = [
719719
* {
720720
* row: {
721721
* cellLimit: 4
@@ -782,7 +782,7 @@ export class Filter {
782782
* // present in the final result, despite being excluded by the qualifier
783783
* // filter
784784
* //-
785-
* var filter = [
785+
* const filter = [
786786
* {
787787
* family: 'follows'
788788
* },
@@ -827,7 +827,7 @@ export class Filter {
827827
* @param {object} time Start and End time Object
828828
*
829829
* @example
830-
* var filter = [
830+
* const filter = [
831831
* {
832832
* time: {
833833
* start: new Date('December 17, 2006 03:24:00'),
@@ -871,7 +871,7 @@ export class Filter {
871871
* @param {?string|string[]|object} value Value to filter cells
872872
*
873873
* @example
874-
* var filter = [
874+
* const filter = [
875875
* {
876876
* value: /[0-9]/
877877
* }
@@ -881,7 +881,7 @@ export class Filter {
881881
* // You can also provide a string (optionally containing regexp characters)
882882
* // for value filters.
883883
* //-
884-
* var filter = [
884+
* const filter = [
885885
* {
886886
* value: '1'
887887
* }
@@ -891,7 +891,7 @@ export class Filter {
891891
* // You can also provide an array of strings if you wish to match against
892892
* // multiple values.
893893
* //-
894-
* var filter = [
894+
* const filter = [
895895
* {
896896
* value: ['1', '9']
897897
* }
@@ -901,8 +901,8 @@ export class Filter {
901901
* // Or you can provide a Buffer or an array of Buffers if you wish to match
902902
* // against specfic binary value(s).
903903
* //-
904-
* var userInputedFaces = [Buffer.from('.|.'), Buffer.from(':-)')];
905-
* var filter = [
904+
* const userInputedFaces = [Buffer.from('.|.'), Buffer.from(':-)')];
905+
* const filter = [
906906
* {
907907
* value: userInputedFaces
908908
* }
@@ -916,7 +916,7 @@ export class Filter {
916916
* // When the `start` bound is omitted it is interpreted as an empty string.
917917
* // When the `end` bound is omitted it is interpreted as Infinity.
918918
* //-
919-
* var filter = [
919+
* const filter = [
920920
* {
921921
* value: {
922922
* start: '1',
@@ -930,7 +930,7 @@ export class Filter {
930930
* // override these by providing an object explicity stating whether or not it
931931
* // is `inclusive`.
932932
* //-
933-
* var filter = [
933+
* const filter = [
934934
* {
935935
* value: {
936936
* start: {
@@ -950,7 +950,7 @@ export class Filter {
950950
* //
951951
* // Replaces each cell's value with an emtpy string.
952952
* //-
953-
* var filter = [
953+
* const filter = [
954954
* {
955955
* value: {
956956
* strip: true

0 commit comments

Comments
 (0)