@@ -193,29 +193,39 @@ export interface ISharedNotebook extends ISharedDocument {
193
193
deleteMetadata ( key : string ) : void ;
194
194
195
195
/**
196
- * Returns some metadata associated with the notebook.
196
+ * Returns all metadata associated with the notebook.
197
197
*
198
- * If no `key` is provided, it will return all metadata.
199
- * Else it will return the value for that key.
200
- *
201
- * @param key Key to get from the metadata
202
198
* @returns Notebook's metadata.
203
199
*/
204
- getMetadata ( key ?: string ) : nbformat . INotebookMetadata ;
205
-
206
- /**
207
- * Sets some metadata associated with the notebook.
208
- *
209
- * If only one argument is provided, it will override all notebook metadata.
210
- * Otherwise a single key will be set to a new value.
211
- *
212
- * @param metadata All Notebook's metadata or the key to set.
213
- * @param value New metadata value
214
- */
215
- setMetadata (
216
- metadata : nbformat . INotebookMetadata | string ,
217
- value ?: PartialJSONValue
218
- ) : void ;
200
+ getMetadata ( ) : nbformat . INotebookMetadata ;
201
+
202
+ /**
203
+ * Returns a metadata associated with the notebook.
204
+ *
205
+ * @param key Key to get from the metadata
206
+ * @returns Notebook's metadata.
207
+ */
208
+ getMetadata ( key : string ) : PartialJSONValue | undefined ;
209
+
210
+ /**
211
+ * Sets all metadata associated with the notebook.
212
+ *
213
+ * @param metadata All Notebook's metadata.
214
+ */
215
+ setMetadata (
216
+ metadata : nbformat . INotebookMetadata ,
217
+ ) : void ;
218
+
219
+ /**
220
+ * Sets a metadata associated with the notebook.
221
+ *
222
+ * @param metadata The key to set.
223
+ * @param value New metadata value
224
+ */
225
+ setMetadata (
226
+ metadata : string ,
227
+ value : PartialJSONValue
228
+ ) : void ;
219
229
220
230
/**
221
231
* Updates the metadata associated with the notebook.
@@ -427,27 +437,38 @@ export interface ISharedBaseCell<
427
437
deleteMetadata ( key : string ) : void ;
428
438
429
439
/**
430
- * Returns some metadata associated with the cell.
440
+ * Returns all metadata associated with the cell.
431
441
*
432
- * If a `key` is provided, returns the metadata value.
433
- * Otherwise returns all metadata
442
+ * @returns Cell's metadata.
443
+ */
444
+ getMetadata ( ) : Partial < Metadata > ;
445
+
446
+ /**
447
+ * Returns a metadata associated with the cell.
434
448
*
449
+ * @param key Metadata key to get
435
450
* @returns Cell's metadata.
436
451
*/
437
- getMetadata ( key ? : string ) : Partial < Metadata > ;
452
+ getMetadata ( key : string ) : PartialJSONValue | undefined ;
438
453
439
454
/**
440
455
* Sets some cell metadata.
441
456
*
442
- * If only one argument is provided, it will override all cell metadata.
443
- * Otherwise a single key will be set to a new value.
457
+ * @param metadata Cell's metadata.
458
+ */
459
+ setMetadata (
460
+ metadata : Partial < Metadata > ,
461
+ ) : void ;
462
+
463
+ /**
464
+ * Sets a cell metadata.
444
465
*
445
- * @param metadata Cell's metadata or key.
466
+ * @param metadata Cell's metadata key.
446
467
* @param value Metadata value
447
468
*/
448
469
setMetadata (
449
- metadata : Partial < Metadata > | string ,
450
- value ? : PartialJSONValue
470
+ metadata : string ,
471
+ value : PartialJSONValue
451
472
) : void ;
452
473
453
474
/**
0 commit comments