@uniformdev/assets 20.72.3-alpha.14 → 20.72.3-alpha.23

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
@@ -1883,14 +1883,20 @@ type ImageFromTransformProps = XOR<{
1883
1883
  y: number;
1884
1884
  };
1885
1885
  }>;
1886
+ /**
1887
+ * Fluent API for reading and transforming an asset image URL.
1888
+ */
1889
+ interface ImageFromApi {
1890
+ /** Returns the image URL with the current transformations applied. */
1891
+ url: () => string;
1892
+ /** Applies image transformations and returns the same fluent API. */
1893
+ transform: (transformProps: ImageFromTransformProps) => ImageFromApi;
1894
+ }
1886
1895
  /**
1887
1896
  * A helper function for extracting the image URL from an asset and optionally
1888
1897
  * applying transformation URL query parameters.
1889
1898
  */
1890
- declare const imageFrom: (asset: Asset | AssetParamValueItem | string) => {
1891
- url: () => string;
1892
- transform: (transformProps: ImageFromTransformProps) => /*elided*/ any;
1893
- };
1899
+ declare const imageFrom: (asset: Asset | AssetParamValueItem | string) => ImageFromApi;
1894
1900
 
1895
1901
  /**
1896
1902
  * Converts a content asset to a put content asset body that has only the properties expected to the PUT API.
@@ -1901,4 +1907,4 @@ declare function convertAssetToPutAsset(asset: {
1901
1907
  projectId: string;
1902
1908
  }): AssetUpsertRequest;
1903
1909
 
1904
- 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 };
1910
+ 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
@@ -1883,14 +1883,20 @@ type ImageFromTransformProps = XOR<{
1883
1883
  y: number;
1884
1884
  };
1885
1885
  }>;
1886
+ /**
1887
+ * Fluent API for reading and transforming an asset image URL.
1888
+ */
1889
+ interface ImageFromApi {
1890
+ /** Returns the image URL with the current transformations applied. */
1891
+ url: () => string;
1892
+ /** Applies image transformations and returns the same fluent API. */
1893
+ transform: (transformProps: ImageFromTransformProps) => ImageFromApi;
1894
+ }
1886
1895
  /**
1887
1896
  * A helper function for extracting the image URL from an asset and optionally
1888
1897
  * applying transformation URL query parameters.
1889
1898
  */
1890
- declare const imageFrom: (asset: Asset | AssetParamValueItem | string) => {
1891
- url: () => string;
1892
- transform: (transformProps: ImageFromTransformProps) => /*elided*/ any;
1893
- };
1899
+ declare const imageFrom: (asset: Asset | AssetParamValueItem | string) => ImageFromApi;
1894
1900
 
1895
1901
  /**
1896
1902
  * Converts a content asset to a put content asset body that has only the properties expected to the PUT API.
@@ -1901,4 +1907,4 @@ declare function convertAssetToPutAsset(asset: {
1901
1907
  projectId: string;
1902
1908
  }): AssetUpsertRequest;
1903
1909
 
1904
- 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 };
1910
+ 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.3-alpha.14+1e232e59cd",
3
+ "version": "20.72.3-alpha.23+cbe06f1e8a",
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.3-alpha.14+1e232e59cd",
40
- "@uniformdev/files": "20.72.3-alpha.14+1e232e59cd"
40
+ "@uniformdev/context": "20.72.3-alpha.23+cbe06f1e8a",
41
+ "@uniformdev/files": "20.72.3-alpha.23+cbe06f1e8a"
41
42
  },
42
43
  "devDependencies": {
43
44
  "ts-xor": "^1.3.0"
44
45
  },
45
- "gitHead": "1e232e59cd3ded97b85b063986cc95e954b8c937"
46
+ "gitHead": "cbe06f1e8a5bb93b0e3cae6b1c8774f21c10506e"
46
47
  }