@swell/apps-sdk 1.0.118 → 1.0.120

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.
@@ -1,4 +1,4 @@
1
- import { ShopifyCompatibility } from '@/compatibility/shopify';
1
+ import type { ShopifyCompatibility } from '@/compatibility/shopify';
2
2
  import type { ThemeFont } from '@/liquid/font';
3
3
  import type { ThemeForm } from '@/liquid/form';
4
4
  import ShopifyArticle from './article';
@@ -2,10 +2,10 @@ import { ShopifyCompatibility } from '../shopify';
2
2
  import type { SwellStorefrontCollection } from '@/resources';
3
3
  import type { SwellData, SwellRecord } from 'types/swell';
4
4
  export declare class ShopifyResource {
5
- props: Record<string, unknown>;
5
+ props: Record<string | symbol, unknown>;
6
6
  stringProp?: string;
7
7
  linkProps?: string[];
8
- constructor(props: Record<string, any>, stringProp?: string, linkProps?: string[]);
8
+ constructor(props: Record<string | symbol, any>, stringProp?: string, linkProps?: string[]);
9
9
  valueOf(): unknown;
10
10
  clone(): ShopifyResource;
11
11
  }
@@ -1,6 +1,6 @@
1
1
  import type { Swell } from './api';
2
2
  import type { ShopifyCompatibility } from './compatibility/shopify';
3
- import type { SwellData, SwellRecord, SwellCollection, InferSwellCollection, SwellCollectionPages, StorefrontResourceGetter } from '../types/swell';
3
+ import type { SwellData, SwellRecord, SwellCollection, InferSwellCollection, SwellCollectionPages, StorefrontResourceGetter, StorefrontCollectionGetter } from '../types/swell';
4
4
  export declare const MAX_QUERY_PAGE_LIMIT = 100;
5
5
  export declare const DEFAULT_QUERY_PAGE_LIMIT = 15;
6
6
  export declare class StorefrontResource<T extends SwellData = SwellData> {
@@ -47,7 +47,7 @@ export declare class SwellStorefrontCollection<T extends SwellCollection = Swell
47
47
  page_count?: number;
48
48
  limit: number;
49
49
  name?: string;
50
- constructor(swell: Swell, collection: string, query?: SwellData, getter?: StorefrontResourceGetter<T>);
50
+ constructor(swell: Swell, collection: string, query?: SwellData, getter?: StorefrontCollectionGetter<T>);
51
51
  _getProxy(): SwellStorefrontCollection<T>;
52
52
  _initQuery(query: SwellData): SwellData;
53
53
  _defaultGetter(): StorefrontResourceGetter<T>;
@@ -96,7 +96,7 @@ export declare class SwellTheme {
96
96
  setCompatibilityConfigs(configs: ThemeConfigs): Promise<void>;
97
97
  setCompatibilityData(pageData: SwellData): void;
98
98
  getLocaleConfig(localeCode?: string, suffix?: string): Promise<ThemeLocaleConfig>;
99
- resolveLookupSetting(setting: ThemeSettingFieldSchema, value: any): SwellData | SwellStorefrontRecord | SwellStorefrontCollection | null;
99
+ resolveLookupSetting(setting: ThemeSettingFieldSchema, value: unknown): SwellData | SwellStorefrontRecord | SwellStorefrontCollection | null;
100
100
  resolveLookupResource(collection: string, id: string): StorefrontResource<SwellRecord>;
101
101
  resolveMenuSettings(): Promise<Record<string, SwellMenu | undefined>>;
102
102
  resolveMenuSetting(value: string): SwellMenu | null;
@@ -215,6 +215,7 @@ export interface SwellMenuItem {
215
215
  }
216
216
  export type QueryParams = import('qs').ParsedQs;
217
217
  export type StorefrontResourceGetter<T extends SwellData = SwellData> = (this: SwellStorefrontResource<T>) => Promise<T | null> | T | null;
218
+ export type StorefrontCollectionGetter<T extends SwellCollection = SwellCollection> = (this: SwellStorefrontCollection<T>) => Promise<T | null> | T | null;
218
219
  export interface ThemeSettings {
219
220
  [key: string]: any;
220
221
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@swell/apps-sdk",
3
3
  "type": "module",
4
- "version": "1.0.118",
4
+ "version": "1.0.120",
5
5
  "description": "Swell SDK for building isomorphic apps.",
6
6
  "author": "Swell",
7
7
  "license": "MIT",