@uniformdev/assets 20.72.4-alpha.13 → 20.72.4-alpha.6

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.mts CHANGED
@@ -1870,14 +1870,20 @@ type ImageFromTransformProps = XOR<{
1870
1870
  y: number;
1871
1871
  };
1872
1872
  }>;
1873
+ /**
1874
+ * Fluent API for reading and transforming an asset image URL.
1875
+ */
1876
+ interface ImageFromApi {
1877
+ /** Returns the image URL with the current transformations applied. */
1878
+ url: () => string;
1879
+ /** Applies image transformations and returns the same fluent API. */
1880
+ transform: (transformProps: ImageFromTransformProps) => ImageFromApi;
1881
+ }
1873
1882
  /**
1874
1883
  * A helper function for extracting the image URL from an asset and optionally
1875
1884
  * applying transformation URL query parameters.
1876
1885
  */
1877
- declare const imageFrom: (asset: Asset | AssetParamValueItem | string) => {
1878
- url: () => string;
1879
- transform: (transformProps: ImageFromTransformProps) => /*elided*/ any;
1880
- };
1886
+ declare const imageFrom: (asset: Asset | AssetParamValueItem | string) => ImageFromApi;
1881
1887
 
1882
1888
  /**
1883
1889
  * Converts a content asset to a put content asset body that has only the properties expected to the PUT API.
@@ -1888,4 +1894,4 @@ declare function convertAssetToPutAsset(asset: {
1888
1894
  projectId: string;
1889
1895
  }): AssetUpsertRequest;
1890
1896
 
1891
- export { type Asset, AssetClient, type AssetDefinitionType, type AssetDeleteRequest, type AssetGetRequest, type AssetGetRequestList, type AssetGetRequestSingle, type AssetGetResponse, type AssetGetResponseList, type AssetGetResponseSingle, type AssetParamValue, type AssetParamValueItem, type AssetUpsertRequest, type ImageDeliveryParams, type ImageFromTransformProps, UncachedAssetClient, assetDefinitions, convertAssetToPutAsset, getAssetDefinitionType, imageFrom };
1897
+ export { type Asset, AssetClient, type AssetDefinitionType, type AssetDeleteRequest, type AssetGetRequest, type AssetGetRequestList, type AssetGetRequestSingle, type AssetGetResponse, type AssetGetResponseList, type AssetGetResponseSingle, type AssetParamValue, type AssetParamValueItem, type AssetUpsertRequest, type ImageDeliveryParams, type ImageFromApi, type ImageFromTransformProps, UncachedAssetClient, assetDefinitions, convertAssetToPutAsset, getAssetDefinitionType, imageFrom };
package/dist/index.d.ts CHANGED
@@ -1870,14 +1870,20 @@ type ImageFromTransformProps = XOR<{
1870
1870
  y: number;
1871
1871
  };
1872
1872
  }>;
1873
+ /**
1874
+ * Fluent API for reading and transforming an asset image URL.
1875
+ */
1876
+ interface ImageFromApi {
1877
+ /** Returns the image URL with the current transformations applied. */
1878
+ url: () => string;
1879
+ /** Applies image transformations and returns the same fluent API. */
1880
+ transform: (transformProps: ImageFromTransformProps) => ImageFromApi;
1881
+ }
1873
1882
  /**
1874
1883
  * A helper function for extracting the image URL from an asset and optionally
1875
1884
  * applying transformation URL query parameters.
1876
1885
  */
1877
- declare const imageFrom: (asset: Asset | AssetParamValueItem | string) => {
1878
- url: () => string;
1879
- transform: (transformProps: ImageFromTransformProps) => /*elided*/ any;
1880
- };
1886
+ declare const imageFrom: (asset: Asset | AssetParamValueItem | string) => ImageFromApi;
1881
1887
 
1882
1888
  /**
1883
1889
  * Converts a content asset to a put content asset body that has only the properties expected to the PUT API.
@@ -1888,4 +1894,4 @@ declare function convertAssetToPutAsset(asset: {
1888
1894
  projectId: string;
1889
1895
  }): AssetUpsertRequest;
1890
1896
 
1891
- export { type Asset, AssetClient, type AssetDefinitionType, type AssetDeleteRequest, type AssetGetRequest, type AssetGetRequestList, type AssetGetRequestSingle, type AssetGetResponse, type AssetGetResponseList, type AssetGetResponseSingle, type AssetParamValue, type AssetParamValueItem, type AssetUpsertRequest, type ImageDeliveryParams, type ImageFromTransformProps, UncachedAssetClient, assetDefinitions, convertAssetToPutAsset, getAssetDefinitionType, imageFrom };
1897
+ export { type Asset, AssetClient, type AssetDefinitionType, type AssetDeleteRequest, type AssetGetRequest, type AssetGetRequestList, type AssetGetRequestSingle, type AssetGetResponse, type AssetGetResponseList, type AssetGetResponseSingle, type AssetParamValue, type AssetParamValueItem, type AssetUpsertRequest, type ImageDeliveryParams, type ImageFromApi, type ImageFromTransformProps, UncachedAssetClient, assetDefinitions, convertAssetToPutAsset, getAssetDefinitionType, imageFrom };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/assets",
3
- "version": "20.72.4-alpha.13+a24dcae01b",
3
+ "version": "20.72.4-alpha.6+93c66ff08a",
4
4
  "description": "Uniform Assets",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -21,11 +21,12 @@
21
21
  "sideEffects": false,
22
22
  "scripts": {
23
23
  "build": "run-s update-openapi build:ts",
24
- "build:ts": "tsup",
24
+ "build:ts": "tsup && pnpm test:types",
25
25
  "dev": "run-s update-openapi dev:ts",
26
26
  "dev:ts": "tsup --watch",
27
27
  "clean": "rimraf dist",
28
28
  "test": "vitest run",
29
+ "test:types": "tsc --ignoreConfig --noEmit --strict --skipLibCheck --module esnext --moduleResolution bundler --target es2018 type-tests/imageFrom.ts",
29
30
  "format": "prettier --write \"src/**/*.{js,ts,tsx}\"",
30
31
  "update-openapi": "tsx ./scripts/update-openapi.cts"
31
32
  },
@@ -36,11 +37,11 @@
36
37
  "access": "public"
37
38
  },
38
39
  "dependencies": {
39
- "@uniformdev/context": "20.72.4-alpha.13+a24dcae01b",
40
- "@uniformdev/files": "20.72.4-alpha.13+a24dcae01b"
40
+ "@uniformdev/context": "20.72.4-alpha.6+93c66ff08a",
41
+ "@uniformdev/files": "20.72.4-alpha.6+93c66ff08a"
41
42
  },
42
43
  "devDependencies": {
43
44
  "ts-xor": "^1.3.0"
44
45
  },
45
- "gitHead": "a24dcae01b019225974c60290cfef988f1405ea8"
46
+ "gitHead": "93c66ff08aa52bcdf60dd38e32e6e39f6ddebab6"
46
47
  }