@spiffcommerce/core 21.8.2 → 21.9.0-alpha.1
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 +13 -1
- package/dist/index.js +517 -473
- package/dist/index.umd.cjs +60 -60
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1093,14 +1093,23 @@ 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.
|
|
1102
1110
|
*/
|
|
1103
1111
|
getLocalOrFromServer(assetKey: string): Promise<Asset>;
|
|
1112
|
+
getOriginalFile(asset: Asset): Promise<Asset>;
|
|
1104
1113
|
/**
|
|
1105
1114
|
* Caches an asset if it doesn't already exist.
|
|
1106
1115
|
*/
|
|
@@ -1110,7 +1119,7 @@ declare class AssetService implements AssetManager {
|
|
|
1110
1119
|
*/
|
|
1111
1120
|
cacheMaterial(material: MaterialResource): void;
|
|
1112
1121
|
/**
|
|
1113
|
-
* Allows for retrieving
|
|
1122
|
+
* Allows for retrieving a material, returns the option from a cache if possible.
|
|
1114
1123
|
* @param id The option ID to be retrieved.
|
|
1115
1124
|
*/
|
|
1116
1125
|
getMaterialLocalOrFromServer(id: string): Promise<MaterialResource>;
|
|
@@ -1119,7 +1128,9 @@ declare class AssetService implements AssetManager {
|
|
|
1119
1128
|
* The asset will be stored via the persistence service for future access, if available.
|
|
1120
1129
|
*/
|
|
1121
1130
|
uploadAssetWithProgress(file: FileInfo, assetType: AssetType, onProgress: (val: number) => void, anonymous?: boolean, temporary?: boolean): Promise<Asset>;
|
|
1131
|
+
uploadAsset(file: FileInfo, assetType: AssetType, anonymous?: boolean, temporary?: boolean): Promise<Asset>;
|
|
1122
1132
|
uploadFile(file: File, onProgress: (val: number) => void): Promise<Asset>;
|
|
1133
|
+
removeBackgroundFromAsset(asset: Asset): Promise<Asset>;
|
|
1123
1134
|
removePersistedAsset(assetKey: string): void;
|
|
1124
1135
|
getPersistedAssets(): PersistedAsset[];
|
|
1125
1136
|
/**
|
|
@@ -1132,6 +1143,7 @@ declare class AssetService implements AssetManager {
|
|
|
1132
1143
|
* @param assetType The type of asset we're expecting to upload
|
|
1133
1144
|
*/
|
|
1134
1145
|
private dispatchCreateAssetRequest;
|
|
1146
|
+
private removeBackground;
|
|
1135
1147
|
private guessMIME;
|
|
1136
1148
|
}
|
|
1137
1149
|
interface PersistedAsset {
|