@@ -272,11 +272,11 @@ declare namespace admin {
272272 function messaging ( app ?: admin . app . App ) : admin . messaging . Messaging ;
273273
274274 /**
275- * Gets the {@link admin.ml .MachineLearning `MachineLearning`} service for the
275+ * Gets the {@link admin.machineLearning .MachineLearning `MachineLearning`} service for the
276276 * default app or a given app.
277277 *
278278 * `admin.machineLearning()` can be called with no arguments to access the
279- * default app's {@link admin.machineLearing .MachineLearning
279+ * default app's {@link admin.machineLearning .MachineLearning
280280 * `MachineLearning`} service or as `admin.machineLearning(app)` to access
281281 * the {@link admin.machineLearning.MachineLearning `MachineLearning`}
282282 * service associated with a specific app.
@@ -5208,52 +5208,124 @@ declare namespace admin.machineLearning {
52085208 * Interface representing options for listing Models.
52095209 */
52105210 interface ListModelsOptions {
5211+ /**
5212+ * An expression that specifies how to filter the results.
5213+ *
5214+ * Examples:
5215+ *
5216+ * ```
5217+ * display_name = your_model
5218+ * display_name : experimental_*
5219+ * tags: face_detector AND tags: experimental
5220+ * state.published = true
5221+ * ```
5222+ *
5223+ * See https://firebase.google.com/docs/ml-kit/manage-hosted-models#list_your_projects_models
5224+ */
52115225 filter ?: string ;
5226+
5227+ /** The number of results to return in each page. */
52125228 pageSize ?: number ;
5229+
5230+ /** A token that specifies the result page to return. */
52135231 pageToken ?: string ;
52145232 }
52155233
52165234 /** Response object for a listModels operation. */
52175235 interface ListModelsResult {
5236+ /** A list of models in your project. */
52185237 readonly models : Model [ ] ;
5238+
5239+ /**
5240+ * A token you can use to retrieve the next page of results. If null, the
5241+ * current page is the final page.
5242+ */
52195243 readonly pageToken ?: string ;
52205244 }
52215245
52225246 /**
5223- * A TFLite Model output object
5247+ * A TensorFlow Lite Model output object
52245248 */
52255249 interface TFLiteModel {
5250+ /** The size of the model. */
52265251 readonly sizeBytes : number ;
52275252
5253+ /** The URI from which the model was originally provided to Firebase. */
52285254 readonly gcsTfliteUri ?: string ;
52295255 }
52305256
52315257 /**
52325258 * A Firebase ML Model input object
52335259 */
52345260 interface ModelOptions {
5261+ /** A name for the model. This is the name you use from your app to load the model. */
52355262 displayName ?: string ;
5263+
5264+ /** Tags for easier model management. */
52365265 tags ?: string [ ] ;
52375266
5267+ /**
5268+ * An object containing the URI of the model in Cloud Storage.
5269+ *
5270+ * Example: `tfliteModel: { gcsTfliteUri: 'gs://your-bucket/your-model.tflite' }`
5271+ */
52385272 tfliteModel ?: { gcsTfliteUri : string ; } ;
52395273 }
52405274
52415275 /**
52425276 * A Firebase ML Model output object
52435277 */
52445278 interface Model {
5279+ /** The ID of the model. */
52455280 readonly modelId : string ;
5281+
5282+ /** The model's name. This is the name you use from your app to load the model. */
52465283 readonly displayName : string ;
5284+
5285+ /** The model's tags. */
52475286 readonly tags ?: string [ ] ;
5287+
5288+ /** The timestamp of the model's creation. */
52485289 readonly createTime : string ;
5290+
5291+ /** The timestamp of the model's most recent update. */
52495292 readonly updateTime : string ;
5293+
5294+ /** Error message when model validation fails. */
52505295 readonly validationError ?: string ;
5296+
5297+ /** True if the model is published. */
52515298 readonly published : boolean ;
5299+
5300+ /**
5301+ * The ETag identifier of the current version of the model. This value
5302+ * changes whenever you update any of the model's properties.
5303+ */
52525304 readonly etag : string ;
5305+
5306+ /**
5307+ * The hash of the model's `tflite` file. This value changes only when
5308+ * you upload a new TensorFlow Lite model.
5309+ */
52535310 readonly modelHash ?: string ;
5311+
5312+ /**
5313+ * True if the model is locked by a server-side operation. You can't make
5314+ * changes to a locked model. See {@link waitForUnlocked `waitForUnlocked()`}.
5315+ */
52545316 readonly locked : boolean ;
5317+
5318+ /**
5319+ * Wait for the model to be unlocked.
5320+ *
5321+ * @param {number } maxTimeSeconds The maximum time in seconds to wait.
5322+ *
5323+ * @return {Promise<void> } A promise that resolves when the model is unlocked
5324+ * or the maximum wait time has passed.
5325+ */
52555326 waitForUnlocked ( maxTimeSeconds ?: number ) : Promise < void > ;
52565327
5328+ /** Metadata about the model's TensorFlow Lite model file. */
52575329 readonly tfliteModel ?: TFLiteModel ;
52585330 }
52595331
@@ -5264,6 +5336,10 @@ declare namespace admin.machineLearning {
52645336 * [`admin.machineLearning()`](admin.machineLearning#machineLearning).
52655337 */
52665338 interface MachineLearning {
5339+ /**
5340+ * The {@link admin.app.App} associated with the current `MachineLearning`
5341+ * service instance.
5342+ */
52675343 app : admin . app . App ;
52685344
52695345 /**
@@ -5278,7 +5354,7 @@ declare namespace admin.machineLearning {
52785354 /**
52795355 * Updates a model in Firebase ML.
52805356 *
5281- * @param {string } modelId The id of the model to update.
5357+ * @param {string } modelId The ID of the model to update.
52825358 * @param {ModelOptions } model The model fields to update.
52835359 *
52845360 * @return {Promise<Model> } A Promise fulfilled with the updated model.
@@ -5288,7 +5364,7 @@ declare namespace admin.machineLearning {
52885364 /**
52895365 * Publishes a model in Firebase ML.
52905366 *
5291- * @param {string } modelId The id of the model to publish.
5367+ * @param {string } modelId The ID of the model to publish.
52925368 *
52935369 * @return {Promise<Model> } A Promise fulfilled with the published model.
52945370 */
@@ -5297,7 +5373,7 @@ declare namespace admin.machineLearning {
52975373 /**
52985374 * Unpublishes a model in Firebase ML.
52995375 *
5300- * @param {string } modelId The id of the model to unpublish.
5376+ * @param {string } modelId The ID of the model to unpublish.
53015377 *
53025378 * @return {Promise<Model> } A Promise fulfilled with the unpublished model.
53035379 */
@@ -5306,9 +5382,9 @@ declare namespace admin.machineLearning {
53065382 /**
53075383 * Gets a model from Firebase ML.
53085384 *
5309- * @param {string } modelId The id of the model to get.
5385+ * @param {string } modelId The ID of the model to get.
53105386 *
5311- * @return {Promise<Model> } A Promise fulfilled with the unpublished model.
5387+ * @return {Promise<Model> } A Promise fulfilled with the model object .
53125388 */
53135389 getModel ( modelId : string ) : Promise < Model > ;
53145390
@@ -5317,17 +5393,17 @@ declare namespace admin.machineLearning {
53175393 *
53185394 * @param {ListModelsOptions } options The listing options.
53195395 *
5320- * @return {Promise<{models: Model[], pageToken?: string} > } A promise that
5396+ * @return {Promise<ListModelsResult > } A promise that
53215397 * resolves with the current (filtered) list of models and the next page
53225398 * token. For the last page, an empty list of models and no page token
5323- * are returned.
5399+ * are returned.
53245400 */
53255401 listModels ( options ?: ListModelsOptions ) : Promise < ListModelsResult > ;
53265402
53275403 /**
53285404 * Deletes a model from Firebase ML.
53295405 *
5330- * @param {string } modelId The id of the model to delete.
5406+ * @param {string } modelId The ID of the model to delete.
53315407 */
53325408 deleteModel ( modelId : string ) : Promise < void > ;
53335409 }
0 commit comments