@shopify/app-bridge-types 0.5.0 → 0.5.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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.5.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#796](https://github.com/Shopify/extensibility/pull/796) [`dd9205fceb4f2a7e8cfe8e161dd1d80537fd2747`](https://github.com/Shopify/extensibility/commit/dd9205fceb4f2a7e8cfe8e161dd1d80537fd2747) Thanks [@andrewiggins](https://github.com/andrewiggins)! - Improve `resourcePicker()` to infer it's return type based on the given options
8
+
3
9
  ## 0.5.0
4
10
 
5
11
  ### Minor Changes
package/dist/shopify.ts CHANGED
@@ -978,13 +978,13 @@ interface Resource {
978
978
  id: string;
979
979
  }
980
980
 
981
- type ResourcePickerApi = (options: ResourcePickerOptions) => Promise<SelectPayload<ResourcePickerOptions['type']> | undefined>;
981
+ type ResourcePickerApi = <ResourceType extends keyof ResourceTypes = keyof ResourceTypes>(options: ResourcePickerOptions<ResourceType>) => Promise<SelectPayload<ResourceType> | undefined>;
982
982
 
983
- interface ResourcePickerOptions {
983
+ interface ResourcePickerOptions<ResourceType extends keyof ResourceTypes = keyof ResourceTypes> {
984
984
  /**
985
985
  * The type of resource you want to pick.
986
986
  */
987
- type: 'product' | 'variant' | 'collection';
987
+ type: ResourceType;
988
988
  /**
989
989
  * The action verb appears in the title and as the primary action of the Resource Picker.
990
990
  * @defaultValue 'add'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopify/app-bridge-types",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "Companion types library for the Shopify App Bridge script",
5
5
  "private": false,
6
6
  "publishConfig": {
@@ -19,6 +19,7 @@
19
19
  },
20
20
  "devDependencies": {
21
21
  "@standard-schema/spec": "^1.0.0",
22
+ "@types/node": "^22.9.0",
22
23
  "cjyes": "^0.3.1"
23
24
  },
24
25
  "files": [
@@ -27,6 +28,7 @@
27
28
  ],
28
29
  "scripts": {
29
30
  "prebuild": "mkdir -p ./dist && touch ./dist/index.mjs",
30
- "build": "npm run prebuild && cjyes && node ./scripts/build.mjs"
31
+ "build": "npm run prebuild && cjyes && node ./scripts/build.mjs",
32
+ "type-check": "tsc -p tests"
31
33
  }
32
34
  }