表示对 Google Cloud Storage 对象的引用。开发人员可以上传、下载和删除对象,以及获取/设置对象元数据。
签名:
export interface StorageReference
特性
财产 | 类型 | 描述 |
---|---|---|
桶 | 细绳 | 包含此引用的对象的存储桶的名称。 |
完整路径 | 细绳 | 该对象的完整路径。 |
姓名 | 细绳 | 该对象的短名称,它是完整路径的最后一个组成部分。例如,如果 fullPath 为“full/path/image.png”,则名称为“image.png”。 |
家长 | 存储参考|无效的 | 指向此引用的父位置的引用,如果此引用是根,则为 null。 |
根 | 存储参考 | 对此对象存储桶的根的引用。 |
贮存 | Firebase存储 | 与此引用关联的FirebaseStorage实例。 |
方法
方法 | 描述 |
---|---|
toString() | 返回此对象的 gs:// URL,格式为gs://<bucket>/<path>/<to>/<object> |
StorageReference.bucket
包含此引用的对象的存储桶的名称。
签名:
bucket: string;
StorageReference.fullPath
该对象的完整路径。
签名:
fullPath: string;
StorageReference.name
该对象的短名称,它是完整路径的最后一个组成部分。例如,如果 fullPath 为“full/path/image.png”,则名称为“image.png”。
签名:
name: string;
StorageReference.parent
指向此引用的父位置的引用,如果此引用是根,则为 null。
签名:
parent: StorageReference | null;
存储参考.root
对此对象存储桶的根的引用。
签名:
root: StorageReference;
StorageReference.storage
与此引用关联的FirebaseStorage实例。
签名:
storage: FirebaseStorage;
StorageReference.toString()
返回此对象的 gs:// URL,格式为gs://<bucket>/<path>/<to>/<object>
签名:
toString(): string;
返回:
细绳
gs:// URL。