@wix/sdk-types 1.2.4 → 1.2.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/build/index.d.mts CHANGED
@@ -1,8 +1,18 @@
1
- type HostModule<T, Host> = {
1
+ type HostModule<T, H extends Host> = {
2
2
  __type: 'host';
3
- create(host: Host): T;
3
+ create(host: H): T;
4
4
  };
5
5
  type HostModuleAPI<T extends HostModule<any, any>> = T extends HostModule<infer U, any> ? U : never;
6
+ type Host<Environment = unknown> = {
7
+ channel: {
8
+ observeState(callback: (props: unknown, environment: Environment) => unknown): {
9
+ disconnect: () => void;
10
+ } | Promise<{
11
+ disconnect: () => void;
12
+ }>;
13
+ };
14
+ environment?: Environment;
15
+ };
6
16
 
7
17
  type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
8
18
  interface HttpClient {
@@ -35,4 +45,4 @@ type AuthenticationStrategy<Host = unknown> = {
35
45
  }>;
36
46
  };
37
47
 
38
- export { APIMetadata, AuthenticationStrategy, BuildRESTFunction, HostModule, HostModuleAPI, HttpClient, HttpResponse, RESTFunctionDescriptor, RequestOptions, RequestOptionsFactory };
48
+ export { APIMetadata, AuthenticationStrategy, BuildRESTFunction, Host, HostModule, HostModuleAPI, HttpClient, HttpResponse, RESTFunctionDescriptor, RequestOptions, RequestOptionsFactory };
package/build/index.d.ts CHANGED
@@ -1,8 +1,18 @@
1
- type HostModule<T, Host> = {
1
+ type HostModule<T, H extends Host> = {
2
2
  __type: 'host';
3
- create(host: Host): T;
3
+ create(host: H): T;
4
4
  };
5
5
  type HostModuleAPI<T extends HostModule<any, any>> = T extends HostModule<infer U, any> ? U : never;
6
+ type Host<Environment = unknown> = {
7
+ channel: {
8
+ observeState(callback: (props: unknown, environment: Environment) => unknown): {
9
+ disconnect: () => void;
10
+ } | Promise<{
11
+ disconnect: () => void;
12
+ }>;
13
+ };
14
+ environment?: Environment;
15
+ };
6
16
 
7
17
  type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
8
18
  interface HttpClient {
@@ -35,4 +45,4 @@ type AuthenticationStrategy<Host = unknown> = {
35
45
  }>;
36
46
  };
37
47
 
38
- export { APIMetadata, AuthenticationStrategy, BuildRESTFunction, HostModule, HostModuleAPI, HttpClient, HttpResponse, RESTFunctionDescriptor, RequestOptions, RequestOptionsFactory };
48
+ export { APIMetadata, AuthenticationStrategy, BuildRESTFunction, Host, HostModule, HostModuleAPI, HttpClient, HttpResponse, RESTFunctionDescriptor, RequestOptions, RequestOptionsFactory };
package/build/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  var __defProp = Object.defineProperty;
2
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/sdk-types",
3
- "version": "1.2.4",
3
+ "version": "1.2.6",
4
4
  "license": "UNLICENSED",
5
5
  "author": {
6
6
  "name": "Ronny Ringel",
@@ -31,7 +31,7 @@
31
31
  "@babel/runtime": "^7.22.6"
32
32
  },
33
33
  "devDependencies": {
34
- "@types/node": "^16.18.38",
34
+ "@types/node": "^16.18.39",
35
35
  "eslint": "^7.32.0",
36
36
  "eslint-config-sdk": "0.0.0",
37
37
  "tsup": "^7.1.0",
@@ -60,5 +60,5 @@
60
60
  "wallaby": {
61
61
  "autoDetect": true
62
62
  },
63
- "falconPackageHash": "97d8b69d010548674ae4be8665fe629d7f95f8dfdfdceb9e0586939b"
63
+ "falconPackageHash": "f767116d62e2663e770dc7d6d5b6378846ae0ccf241d5f6c9053fc21"
64
64
  }