@retailcrm/embed-ui 0.2.2 → 0.2.4

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.
Files changed (3) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/index.d.ts +70 -0
  3. package/package.json +3 -3
package/CHANGELOG.md CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [0.2.4](https://github.com/retailcrm/embed-ui/compare/v0.2.3...v0.2.4) (2024-11-04)
6
+
7
+
8
+ ### Fixes
9
+
10
+ * Types declaration of the main entrypoint ([4c50e51](https://github.com/retailcrm/embed-ui/commit/4c50e51c3b71b30c05871f101617440b32cb2a4c))
11
+
12
+ ### [0.2.3](https://github.com/retailcrm/embed-ui/compare/v0.2.2...v0.2.3) (2024-11-04)
13
+
14
+
15
+ ### Fixes
16
+
17
+ * Types declaration generation ([e555013](https://github.com/retailcrm/embed-ui/commit/e5550137889f40ebfa35e27dc13c133d5c28b49e))
18
+
5
19
  ### [0.2.2](https://github.com/retailcrm/embed-ui/compare/v0.2.1...v0.2.2) (2024-11-04)
6
20
 
7
21
 
package/index.d.ts ADDED
@@ -0,0 +1,70 @@
1
+ import { ComputedRef } from 'vue'
2
+ import { Context } from './types/context/schema'
3
+ import { ContextAccessor } from './types/context/schema'
4
+ import { ContextSchema } from './types/context/schema'
5
+ import { Endpoint } from '@remote-ui/rpc'
6
+ import { IsReadonly } from './types/context/schema'
7
+ import { MessageEndpoint } from '@remote-ui/rpc'
8
+ import { Schema } from './types/context/customer/card'
9
+ import { Schema as Schema_2 } from './types/context/customer/card-phone'
10
+ import { Schema as Schema_3 } from './types/context/order/card'
11
+ import { Schema as Schema_4 } from './types/context/settings'
12
+ import { SchemaList } from '../types/context'
13
+ import { Store } from 'pinia'
14
+ import { StoreDefinition } from 'pinia'
15
+ import { TypeOf } from './types/context/schema'
16
+ import { WidgetRunner } from './types/widget'
17
+ import { WritableComputedRef } from 'vue'
18
+
19
+ declare type Computed<S extends ContextSchema, F extends keyof S> = IsReadonly<S[F]> extends true ? ComputedRef<TypeOf<S[F]>> : WritableComputedRef<TypeOf<S[F]>>;
20
+
21
+ export declare const createWidgetEndpoint: (widget: WidgetRunner, messenger: MessageEndpoint) => Endpoint<ContextAccessor<SchemaList>>
22
+
23
+ export declare const customerCardPhoneSchema: Schema_2
24
+
25
+ export declare const customerCardSchema: Schema
26
+
27
+ export declare const orderCardSchema: Schema_3
28
+
29
+ export declare const settingsSchema: Schema_4
30
+
31
+ export declare const useCustomerCardContext: StoreDefinition<'customer/card', Context<Schema>, {
32
+ schema: () => Schema;
33
+ }, {
34
+ initialize(): Promise<void>;
35
+ set<F extends keyof Schema>(field: F, value: TypeOf<Schema[F]>): void;
36
+ }>
37
+
38
+ export declare const useCustomerCardPhoneContext: StoreDefinition<'customer/card:phone', Context<Schema_2>, {
39
+ schema: () => Schema_2;
40
+ }, {
41
+ initialize(): Promise<void>;
42
+ set<F extends keyof Schema_2>(field: F, value: TypeOf<Schema_2[F]>): void;
43
+ }>
44
+
45
+ export declare const useField: <S extends ContextSchema, F extends keyof S>(store: Store<string, Context<S>, {
46
+ schema(): S;
47
+ }, {
48
+ initialize(): Promise<void>;
49
+ set<F_1 extends keyof S>(field: F_1, value: TypeOf<S[F_1]>): void;
50
+ }>, field: F) => Computed<S, F>
51
+
52
+ export declare const useOrderCardContext: StoreDefinition<'order/card', Context<Schema_3>, {
53
+ schema: () => Schema_3;
54
+ }, {
55
+ initialize(): Promise<void>;
56
+ set<F extends keyof Schema_3>(field: F, value: TypeOf<Schema_3[F]>): void;
57
+ }>
58
+
59
+ export declare const useSettingsContext: StoreDefinition<'settings', Context<Schema_4>, {
60
+ schema: () => Schema_4;
61
+ }, {
62
+ initialize(): Promise<void>;
63
+ set<F extends keyof Schema_4>(field: F, value: TypeOf<Schema_4[F]>): void;
64
+ }>
65
+
66
+ declare module 'pinia' {
67
+ interface PiniaCustomProperties {
68
+ endpoint: Endpoint<ContextAccessor>;
69
+ }
70
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@retailcrm/embed-ui",
3
3
  "type": "module",
4
- "version": "0.2.2",
4
+ "version": "0.2.4",
5
5
  "description": "API and components for creating RetailCRM UI extensions",
6
6
  "repository": "git@github.com:retailcrm/embed-ui.git",
7
7
  "author": "RetailDriverLLC <integration@retailcrm.ru>",
@@ -13,13 +13,13 @@
13
13
  ".": {
14
14
  "import": "./dist/index.mjs",
15
15
  "require": "./dist/index.cjs",
16
- "types": "./dist/index.d.ts",
16
+ "types": "./index.d.ts",
17
17
  "default": "./dist/index.mjs"
18
18
  },
19
19
  "./dist/*": "./dist/*",
20
20
  "./types/*": "./types/*"
21
21
  },
22
- "types": "dist/index.d.ts",
22
+ "types": "index.d.ts",
23
23
  "scripts": {
24
24
  "build": "vite build",
25
25
  "eslint": "eslint .",