llmz 0.0.4 → 0.0.5
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/chat.d.ts +17 -0
- package/dist/chunk-3U57H7GT.js +608 -0
- package/dist/{chunk-LVKZYKTP.cjs → chunk-4I7UPBLN.cjs} +2 -2
- package/dist/{chunk-W6U2VXSF.cjs → chunk-6WT5VZBG.cjs} +348 -12
- package/dist/{chunk-JK2LZW2G.cjs → chunk-EJRCDWBA.cjs} +45 -6
- package/dist/{chunk-ZCPQ3QOW.js → chunk-HP7RKM25.js} +45 -6
- package/dist/chunk-MU4LFVY7.cjs +608 -0
- package/dist/{chunk-S6WICIDW.js → chunk-S6FOL2HY.js} +2 -2
- package/dist/{chunk-TJQVC4CE.js → chunk-WLUVY5QU.js} +341 -5
- package/dist/{component-LQDU72LX.js → component-R2Y74VUI.js} +3 -1
- package/dist/component-TSNW3SC7.cjs +16 -0
- package/dist/component.d.ts +6 -19
- package/dist/component.default.d.ts +131 -151
- package/dist/context.d.ts +6 -5
- package/dist/{dual-modes-YE4S2AIL.cjs → dual-modes-UHNDHNIF.cjs} +3 -4
- package/dist/{dual-modes-QHBOFWHM.js → dual-modes-ZUQKPJFH.js} +2 -3
- package/dist/{exit-IDKGZD7M.cjs → exit-KJ4COC5N.cjs} +2 -2
- package/dist/{exit-F6ZUL2NV.js → exit-OIYZLBVJ.js} +1 -1
- package/dist/exit.d.ts +5 -1
- package/dist/getter.d.ts +1 -1
- package/dist/index.cjs +72 -127
- package/dist/index.d.ts +7 -5
- package/dist/index.js +67 -122
- package/dist/llmz-VDA4M42R.cjs +604 -0
- package/dist/llmz-YE5N54IU.js +604 -0
- package/dist/llmz.d.ts +6 -9
- package/dist/types.d.ts +2 -0
- package/package.json +1 -1
- package/dist/chunk-4KB5WXHR.js +0 -92
- package/dist/chunk-6YWYCVAB.cjs +0 -92
- package/dist/chunk-EFGXTO64.js +0 -344
- package/dist/chunk-VAF2H6UD.cjs +0 -344
- package/dist/component-HQ5YQNRX.cjs +0 -14
- package/dist/llmz-AS5TGCQS.js +0 -1108
- package/dist/llmz-R6XZG3JQ.cjs +0 -1108
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import { Component
|
|
2
|
-
import { Tool } from './tool.js';
|
|
3
|
-
export type SendMessageHandler = (input: RenderedComponent) => Promise<void> | void;
|
|
4
|
-
export declare const messageTool: (handler: SendMessageHandler) => Tool<import("./types.js").ZuiType, import("./types.js").ZuiType>;
|
|
1
|
+
import { Component } from './component.js';
|
|
5
2
|
export declare const DefaultComponents: {
|
|
6
3
|
Button: Component<{
|
|
7
4
|
type: "leaf";
|
|
@@ -14,25 +11,22 @@ export declare const DefaultComponents: {
|
|
|
14
11
|
code: string;
|
|
15
12
|
}[];
|
|
16
13
|
leaf: {
|
|
17
|
-
props: ({
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
required: false;
|
|
34
|
-
default?: undefined;
|
|
35
|
-
})[];
|
|
14
|
+
props: import("@bpinternal/zui").ZodObject<{
|
|
15
|
+
action: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodEnum<["say", "url", "postback"]>>;
|
|
16
|
+
label: import("@bpinternal/zui").ZodString;
|
|
17
|
+
value: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
|
|
18
|
+
url: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
|
|
19
|
+
}, "strip", {
|
|
20
|
+
label: string;
|
|
21
|
+
action: "say" | "url" | "postback";
|
|
22
|
+
value?: string | undefined;
|
|
23
|
+
url?: string | undefined;
|
|
24
|
+
}, {
|
|
25
|
+
label: string;
|
|
26
|
+
value?: string | undefined;
|
|
27
|
+
action?: "say" | "url" | "postback" | undefined;
|
|
28
|
+
url?: string | undefined;
|
|
29
|
+
}>;
|
|
36
30
|
};
|
|
37
31
|
}>;
|
|
38
32
|
Image: Component<{
|
|
@@ -46,17 +40,16 @@ export declare const DefaultComponents: {
|
|
|
46
40
|
code: string;
|
|
47
41
|
}[];
|
|
48
42
|
leaf: {
|
|
49
|
-
props: ({
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
})[];
|
|
43
|
+
props: import("@bpinternal/zui").ZodObject<{
|
|
44
|
+
url: import("@bpinternal/zui").ZodString;
|
|
45
|
+
alt: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
|
|
46
|
+
}, "strip", {
|
|
47
|
+
url: string;
|
|
48
|
+
alt?: string | undefined;
|
|
49
|
+
}, {
|
|
50
|
+
url: string;
|
|
51
|
+
alt?: string | undefined;
|
|
52
|
+
}>;
|
|
60
53
|
};
|
|
61
54
|
}>;
|
|
62
55
|
File: Component<{
|
|
@@ -70,17 +63,16 @@ export declare const DefaultComponents: {
|
|
|
70
63
|
code: string;
|
|
71
64
|
}[];
|
|
72
65
|
leaf: {
|
|
73
|
-
props: ({
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
})[];
|
|
66
|
+
props: import("@bpinternal/zui").ZodObject<{
|
|
67
|
+
url: import("@bpinternal/zui").ZodString;
|
|
68
|
+
name: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
|
|
69
|
+
}, "strip", {
|
|
70
|
+
url: string;
|
|
71
|
+
name?: string | undefined;
|
|
72
|
+
}, {
|
|
73
|
+
url: string;
|
|
74
|
+
name?: string | undefined;
|
|
75
|
+
}>;
|
|
84
76
|
};
|
|
85
77
|
}>;
|
|
86
78
|
Video: Component<{
|
|
@@ -94,17 +86,16 @@ export declare const DefaultComponents: {
|
|
|
94
86
|
code: string;
|
|
95
87
|
}[];
|
|
96
88
|
leaf: {
|
|
97
|
-
props: ({
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
})[];
|
|
89
|
+
props: import("@bpinternal/zui").ZodObject<{
|
|
90
|
+
url: import("@bpinternal/zui").ZodString;
|
|
91
|
+
title: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
|
|
92
|
+
}, "strip", {
|
|
93
|
+
url: string;
|
|
94
|
+
title?: string | undefined;
|
|
95
|
+
}, {
|
|
96
|
+
url: string;
|
|
97
|
+
title?: string | undefined;
|
|
98
|
+
}>;
|
|
108
99
|
};
|
|
109
100
|
}>;
|
|
110
101
|
Audio: Component<{
|
|
@@ -118,17 +109,16 @@ export declare const DefaultComponents: {
|
|
|
118
109
|
code: string;
|
|
119
110
|
}[];
|
|
120
111
|
leaf: {
|
|
121
|
-
props: ({
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
})[];
|
|
112
|
+
props: import("@bpinternal/zui").ZodObject<{
|
|
113
|
+
url: import("@bpinternal/zui").ZodString;
|
|
114
|
+
title: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
|
|
115
|
+
}, "strip", {
|
|
116
|
+
url: string;
|
|
117
|
+
title?: string | undefined;
|
|
118
|
+
}, {
|
|
119
|
+
url: string;
|
|
120
|
+
title?: string | undefined;
|
|
121
|
+
}>;
|
|
132
122
|
};
|
|
133
123
|
}>;
|
|
134
124
|
Card: Component<{
|
|
@@ -142,17 +132,16 @@ export declare const DefaultComponents: {
|
|
|
142
132
|
code: string;
|
|
143
133
|
}[];
|
|
144
134
|
container: {
|
|
145
|
-
props: ({
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
})[];
|
|
135
|
+
props: import("@bpinternal/zui").ZodObject<{
|
|
136
|
+
title: import("@bpinternal/zui").ZodString;
|
|
137
|
+
subtitle: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
|
|
138
|
+
}, "strip", {
|
|
139
|
+
title: string;
|
|
140
|
+
subtitle?: string | undefined;
|
|
141
|
+
}, {
|
|
142
|
+
title: string;
|
|
143
|
+
subtitle?: string | undefined;
|
|
144
|
+
}>;
|
|
156
145
|
children: ({
|
|
157
146
|
description: string;
|
|
158
147
|
component: {
|
|
@@ -166,17 +155,16 @@ export declare const DefaultComponents: {
|
|
|
166
155
|
code: string;
|
|
167
156
|
}[];
|
|
168
157
|
leaf: {
|
|
169
|
-
props: ({
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
})[];
|
|
158
|
+
props: import("@bpinternal/zui").ZodObject<{
|
|
159
|
+
url: import("@bpinternal/zui").ZodString;
|
|
160
|
+
alt: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
|
|
161
|
+
}, "strip", {
|
|
162
|
+
url: string;
|
|
163
|
+
alt?: string | undefined;
|
|
164
|
+
}, {
|
|
165
|
+
url: string;
|
|
166
|
+
alt?: string | undefined;
|
|
167
|
+
}>;
|
|
180
168
|
};
|
|
181
169
|
};
|
|
182
170
|
} | {
|
|
@@ -192,25 +180,22 @@ export declare const DefaultComponents: {
|
|
|
192
180
|
code: string;
|
|
193
181
|
}[];
|
|
194
182
|
leaf: {
|
|
195
|
-
props: ({
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
required: false;
|
|
212
|
-
default?: undefined;
|
|
213
|
-
})[];
|
|
183
|
+
props: import("@bpinternal/zui").ZodObject<{
|
|
184
|
+
action: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodEnum<["say", "url", "postback"]>>;
|
|
185
|
+
label: import("@bpinternal/zui").ZodString;
|
|
186
|
+
value: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
|
|
187
|
+
url: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
|
|
188
|
+
}, "strip", {
|
|
189
|
+
label: string;
|
|
190
|
+
action: "say" | "url" | "postback";
|
|
191
|
+
value?: string | undefined;
|
|
192
|
+
url?: string | undefined;
|
|
193
|
+
}, {
|
|
194
|
+
label: string;
|
|
195
|
+
value?: string | undefined;
|
|
196
|
+
action?: "say" | "url" | "postback" | undefined;
|
|
197
|
+
url?: string | undefined;
|
|
198
|
+
}>;
|
|
214
199
|
};
|
|
215
200
|
};
|
|
216
201
|
})[];
|
|
@@ -227,7 +212,7 @@ export declare const DefaultComponents: {
|
|
|
227
212
|
code: string;
|
|
228
213
|
}[];
|
|
229
214
|
container: {
|
|
230
|
-
props:
|
|
215
|
+
props: import("@bpinternal/zui").ZodObject<{}, "strip", {}, {}>;
|
|
231
216
|
children: {
|
|
232
217
|
description: string;
|
|
233
218
|
component: {
|
|
@@ -241,17 +226,16 @@ export declare const DefaultComponents: {
|
|
|
241
226
|
code: string;
|
|
242
227
|
}[];
|
|
243
228
|
container: {
|
|
244
|
-
props: ({
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
})[];
|
|
229
|
+
props: import("@bpinternal/zui").ZodObject<{
|
|
230
|
+
title: import("@bpinternal/zui").ZodString;
|
|
231
|
+
subtitle: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
|
|
232
|
+
}, "strip", {
|
|
233
|
+
title: string;
|
|
234
|
+
subtitle?: string | undefined;
|
|
235
|
+
}, {
|
|
236
|
+
title: string;
|
|
237
|
+
subtitle?: string | undefined;
|
|
238
|
+
}>;
|
|
255
239
|
children: ({
|
|
256
240
|
description: string;
|
|
257
241
|
component: {
|
|
@@ -265,17 +249,16 @@ export declare const DefaultComponents: {
|
|
|
265
249
|
code: string;
|
|
266
250
|
}[];
|
|
267
251
|
leaf: {
|
|
268
|
-
props: ({
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
})[];
|
|
252
|
+
props: import("@bpinternal/zui").ZodObject<{
|
|
253
|
+
url: import("@bpinternal/zui").ZodString;
|
|
254
|
+
alt: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
|
|
255
|
+
}, "strip", {
|
|
256
|
+
url: string;
|
|
257
|
+
alt?: string | undefined;
|
|
258
|
+
}, {
|
|
259
|
+
url: string;
|
|
260
|
+
alt?: string | undefined;
|
|
261
|
+
}>;
|
|
279
262
|
};
|
|
280
263
|
};
|
|
281
264
|
} | {
|
|
@@ -291,25 +274,22 @@ export declare const DefaultComponents: {
|
|
|
291
274
|
code: string;
|
|
292
275
|
}[];
|
|
293
276
|
leaf: {
|
|
294
|
-
props: ({
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
required: false;
|
|
311
|
-
default?: undefined;
|
|
312
|
-
})[];
|
|
277
|
+
props: import("@bpinternal/zui").ZodObject<{
|
|
278
|
+
action: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodEnum<["say", "url", "postback"]>>;
|
|
279
|
+
label: import("@bpinternal/zui").ZodString;
|
|
280
|
+
value: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
|
|
281
|
+
url: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
|
|
282
|
+
}, "strip", {
|
|
283
|
+
label: string;
|
|
284
|
+
action: "say" | "url" | "postback";
|
|
285
|
+
value?: string | undefined;
|
|
286
|
+
url?: string | undefined;
|
|
287
|
+
}, {
|
|
288
|
+
label: string;
|
|
289
|
+
value?: string | undefined;
|
|
290
|
+
action?: "say" | "url" | "postback" | undefined;
|
|
291
|
+
url?: string | undefined;
|
|
292
|
+
}>;
|
|
313
293
|
};
|
|
314
294
|
};
|
|
315
295
|
})[];
|
|
@@ -329,7 +309,7 @@ export declare const DefaultComponents: {
|
|
|
329
309
|
code: string;
|
|
330
310
|
}[];
|
|
331
311
|
default: {
|
|
332
|
-
props:
|
|
312
|
+
props: import("@bpinternal/zui").ZodObject<{}, "strip", {}, {}>;
|
|
333
313
|
children: never[];
|
|
334
314
|
};
|
|
335
315
|
}>;
|
package/dist/context.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type Cognitive } from '@botpress/cognitive';
|
|
2
|
+
import { Chat } from './chat.js';
|
|
2
3
|
import { Component } from './component.js';
|
|
3
4
|
import { SnapshotSignal } from './errors.js';
|
|
4
5
|
import { Exit } from './exit.js';
|
|
@@ -9,7 +10,7 @@ import type { OAI } from './openai.js';
|
|
|
9
10
|
import { Prompt } from './prompts/prompt.js';
|
|
10
11
|
import { Snapshot } from './snapshots.js';
|
|
11
12
|
import { Tool } from './tool.js';
|
|
12
|
-
import { TranscriptArray
|
|
13
|
+
import { TranscriptArray } from './transcript.js';
|
|
13
14
|
import { ObjectMutation, Trace } from './types.js';
|
|
14
15
|
type Model = Parameters<InstanceType<typeof Cognitive>['generateContent']>[0]['model'];
|
|
15
16
|
export type IterationParameters = {
|
|
@@ -79,6 +80,8 @@ export declare namespace IterationStatuses {
|
|
|
79
80
|
};
|
|
80
81
|
};
|
|
81
82
|
}
|
|
83
|
+
export declare const ThinkExit: Exit<unknown>;
|
|
84
|
+
export declare const ListenExit: Exit<unknown>;
|
|
82
85
|
export declare class Iteration {
|
|
83
86
|
id: string;
|
|
84
87
|
messages: OAI.Message[];
|
|
@@ -132,12 +135,11 @@ export declare class Iteration {
|
|
|
132
135
|
}
|
|
133
136
|
export declare class Context {
|
|
134
137
|
id: string;
|
|
135
|
-
|
|
138
|
+
chat?: Chat;
|
|
136
139
|
instructions?: ValueOrGetter<string, Context>;
|
|
137
140
|
objects?: ValueOrGetter<ObjectInstance[], Context>;
|
|
138
141
|
tools?: ValueOrGetter<Tool[], Context>;
|
|
139
142
|
exits?: ValueOrGetter<Exit[], Context>;
|
|
140
|
-
components?: ValueOrGetter<Component[], Context>;
|
|
141
143
|
version: Prompt;
|
|
142
144
|
timeout: number;
|
|
143
145
|
loop: number;
|
|
@@ -152,12 +154,11 @@ export declare class Context {
|
|
|
152
154
|
private _getIterationMessages;
|
|
153
155
|
private _refreshIterationParameters;
|
|
154
156
|
constructor(props: {
|
|
157
|
+
chat?: Chat;
|
|
155
158
|
instructions?: ValueOrGetter<string, Context>;
|
|
156
159
|
objects?: ValueOrGetter<ObjectInstance[], Context>;
|
|
157
160
|
tools?: ValueOrGetter<Tool[], Context>;
|
|
158
161
|
exits?: ValueOrGetter<Exit[], Context>;
|
|
159
|
-
transcript?: ValueOrGetter<TranscriptMessage[], Context>;
|
|
160
|
-
components?: ValueOrGetter<Component[], Context>;
|
|
161
162
|
loop?: number;
|
|
162
163
|
temperature?: number;
|
|
163
164
|
model?: Model;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-VAF2H6UD.cjs');
|
|
3
|
+
var _chunk6WT5VZBGcjs = require('./chunk-6WT5VZBG.cjs');
|
|
5
4
|
require('./chunk-IKSIOIIP.cjs');
|
|
6
|
-
require('./chunk-
|
|
5
|
+
require('./chunk-EJRCDWBA.cjs');
|
|
7
6
|
require('./chunk-KMZDFWYZ.cjs');
|
|
8
7
|
require('./chunk-FIVFS4HG.cjs');
|
|
9
8
|
require('./chunk-P7J2WCBB.cjs');
|
|
10
9
|
require('./chunk-UQOBUJIQ.cjs');
|
|
11
10
|
|
|
12
11
|
|
|
13
|
-
exports.DualModePrompt =
|
|
12
|
+
exports.DualModePrompt = _chunk6WT5VZBGcjs.DualModePrompt;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DualModePrompt
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-EFGXTO64.js";
|
|
3
|
+
} from "./chunk-WLUVY5QU.js";
|
|
5
4
|
import "./chunk-JQBT7UWN.js";
|
|
6
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-HP7RKM25.js";
|
|
7
6
|
import "./chunk-ORQP26SZ.js";
|
|
8
7
|
import "./chunk-QT4QF3YA.js";
|
|
9
8
|
import "./chunk-5TRUJES5.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk4I7UPBLNcjs = require('./chunk-4I7UPBLN.cjs');
|
|
4
4
|
require('./chunk-P7J2WCBB.cjs');
|
|
5
5
|
require('./chunk-UQOBUJIQ.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
exports.Exit =
|
|
8
|
+
exports.Exit = _chunk4I7UPBLNcjs.Exit;
|
package/dist/exit.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { type JSONSchema } from '@bpinternal/zui';
|
|
2
2
|
import { ZuiType } from './types.js';
|
|
3
|
+
export type ExitResult<T = unknown> = {
|
|
4
|
+
exit: Exit<T>;
|
|
5
|
+
result: T;
|
|
6
|
+
};
|
|
3
7
|
export declare class Exit<T = unknown> {
|
|
4
8
|
name: string;
|
|
5
9
|
aliases: string[];
|
|
@@ -10,7 +14,7 @@ export declare class Exit<T = unknown> {
|
|
|
10
14
|
rename(name: string): this;
|
|
11
15
|
clone(): Exit<any>;
|
|
12
16
|
is<T>(exit: Exit<T>): this is Exit<T>;
|
|
13
|
-
|
|
17
|
+
match(result: ExitResult): result is ExitResult<T>;
|
|
14
18
|
constructor(props: {
|
|
15
19
|
name: string;
|
|
16
20
|
aliases?: string[];
|
package/dist/getter.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export type ValueOrGetter<T, I> = T | ((ctx: I) => T) | ((ctx: I) => Promise<T>);
|
|
2
|
-
export declare const getValue: <T, I>(valueOrGetter: ValueOrGetter<T, I>, ctx
|
|
2
|
+
export declare const getValue: <T, I>(valueOrGetter: ValueOrGetter<T, I>, ctx?: I) => Promise<T>;
|