@spiffcommerce/core 21.8.2-8 → 21.9.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1093,9 +1093,17 @@ interface AssetManager {
1093
1093
  * Uploads a file to the Spiff Commerce Platform.
1094
1094
  */
1095
1095
  uploadFile: (file: File, onProgress: (val: number) => void) => Promise<Asset>;
1096
+ /**
1097
+ * From an existing asset, generates a new asset that has the background replaced with transparency.
1098
+ * This process is idempotent, i.e. it will only run once for a given asset.
1099
+ * @param asset The existing asset to remove the background from.
1100
+ * @returns A promise that resolves with a new asset.
1101
+ */
1102
+ removeBackgroundFromAsset(asset: Asset): Promise<Asset>;
1096
1103
  }
1097
1104
  declare class AssetService implements AssetManager {
1098
1105
  private cache;
1106
+ private bgrmCache;
1099
1107
  private materialCache;
1100
1108
  /**
1101
1109
  * Allows for retrieving an asset, returns the option from a cache if possible.
@@ -1110,7 +1118,7 @@ declare class AssetService implements AssetManager {
1110
1118
  */
1111
1119
  cacheMaterial(material: MaterialResource): void;
1112
1120
  /**
1113
- * Allows for retrieving amaterial, returns the option from a cache if possible.
1121
+ * Allows for retrieving a material, returns the option from a cache if possible.
1114
1122
  * @param id The option ID to be retrieved.
1115
1123
  */
1116
1124
  getMaterialLocalOrFromServer(id: string): Promise<MaterialResource>;
@@ -1119,7 +1127,9 @@ declare class AssetService implements AssetManager {
1119
1127
  * The asset will be stored via the persistence service for future access, if available.
1120
1128
  */
1121
1129
  uploadAssetWithProgress(file: FileInfo, assetType: AssetType, onProgress: (val: number) => void, anonymous?: boolean, temporary?: boolean): Promise<Asset>;
1130
+ uploadAsset(file: FileInfo, assetType: AssetType, anonymous?: boolean, temporary?: boolean): Promise<Asset>;
1122
1131
  uploadFile(file: File, onProgress: (val: number) => void): Promise<Asset>;
1132
+ removeBackgroundFromAsset(asset: Asset): Promise<Asset>;
1123
1133
  removePersistedAsset(assetKey: string): void;
1124
1134
  getPersistedAssets(): PersistedAsset[];
1125
1135
  /**
@@ -1132,6 +1142,7 @@ declare class AssetService implements AssetManager {
1132
1142
  * @param assetType The type of asset we're expecting to upload
1133
1143
  */
1134
1144
  private dispatchCreateAssetRequest;
1145
+ private removeBackground;
1135
1146
  private guessMIME;
1136
1147
  }
1137
1148
  interface PersistedAsset {