@learncard/helpers 1.3.13 → 1.4.0

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 (49) hide show
  1. package/dist/Utilities.d.ts +59 -0
  2. package/dist/Utilities.d.ts.map +1 -0
  3. package/dist/app-install/index.d.ts +62 -0
  4. package/dist/app-install/index.d.ts.map +1 -0
  5. package/dist/arrays/index.d.ts +3 -0
  6. package/dist/arrays/index.d.ts.map +1 -0
  7. package/dist/bitstring-status-list/index.d.ts +8 -0
  8. package/dist/bitstring-status-list/index.d.ts.map +1 -0
  9. package/dist/credential-format.d.ts +96 -0
  10. package/dist/credential-format.d.ts.map +1 -0
  11. package/dist/did.d.ts +3 -0
  12. package/dist/did.d.ts.map +1 -0
  13. package/dist/environment.d.ts +32 -0
  14. package/dist/environment.d.ts.map +1 -0
  15. package/dist/helpers.cjs.development.cjs +189 -123
  16. package/dist/helpers.cjs.development.cjs.map +4 -4
  17. package/dist/helpers.cjs.production.min.cjs +15 -11
  18. package/dist/helpers.cjs.production.min.cjs.map +4 -4
  19. package/dist/helpers.esm.js +136 -79
  20. package/dist/helpers.esm.js.map +4 -4
  21. package/dist/images/discord.helpers.d.ts +65 -0
  22. package/dist/images/discord.helpers.d.ts.map +1 -0
  23. package/dist/images/filestack.helpers.d.ts +92 -0
  24. package/dist/images/filestack.helpers.d.ts.map +1 -0
  25. package/dist/images/images.helpers.d.ts +32 -0
  26. package/dist/images/images.helpers.d.ts.map +1 -0
  27. package/dist/images/index.d.ts +2 -0
  28. package/dist/images/index.d.ts.map +1 -0
  29. package/dist/images/unsplash.helpers.d.ts +64 -0
  30. package/dist/images/unsplash.helpers.d.ts.map +1 -0
  31. package/dist/images/url.helpers.d.ts +14 -0
  32. package/dist/images/url.helpers.d.ts.map +1 -0
  33. package/dist/index.d.cts +43 -0
  34. package/dist/index.d.ts +43 -0
  35. package/dist/index.d.ts.map +1 -0
  36. package/dist/numbers/index.d.ts +5 -0
  37. package/dist/numbers/index.d.ts.map +1 -0
  38. package/dist/state.d.ts +130 -0
  39. package/dist/state.d.ts.map +1 -0
  40. package/dist/strings/index.d.ts +2 -0
  41. package/dist/strings/index.d.ts.map +1 -0
  42. package/dist/types/index.d.ts +3 -0
  43. package/dist/types/index.d.ts.map +1 -0
  44. package/package.json +8 -8
  45. package/src/credential-format.ts +5 -4
  46. package/src/environment.ts +75 -0
  47. package/src/index.ts +11 -10
  48. package/dist/helpers.d.cts +0 -979
  49. package/dist/helpers.d.ts +0 -979
@@ -1,979 +0,0 @@
1
- // Generated by dts-bundle-generator v6.13.0
2
-
3
- import { DataTransformer } from '@trpc/server';
4
- import { Draft } from 'immer';
5
- import { Dispatch, SetStateAction } from 'react';
6
- import { DraftFunction, Updater } from 'use-immer';
7
-
8
- declare const UnsignedVCValidator: z.ZodObject<{
9
- "@context": z.ZodArray<z.ZodUnion<[
10
- z.ZodString,
11
- z.ZodRecord<z.ZodString, z.ZodAny>
12
- ]>>;
13
- id: z.ZodOptional<z.ZodString>;
14
- type: z.ZodArray<z.ZodString>;
15
- issuer: z.ZodUnion<[
16
- z.ZodString,
17
- z.ZodObject<{
18
- id: z.ZodOptional<z.ZodString>;
19
- type: z.ZodUnion<[
20
- z.ZodString,
21
- z.ZodOptional<z.ZodArray<z.ZodString>>
22
- ]>;
23
- name: z.ZodOptional<z.ZodString>;
24
- url: z.ZodOptional<z.ZodString>;
25
- phone: z.ZodOptional<z.ZodString>;
26
- description: z.ZodOptional<z.ZodString>;
27
- endorsement: z.ZodOptional<z.ZodArray<z.ZodAny>>;
28
- image: z.ZodOptional<z.ZodUnion<[
29
- z.ZodString,
30
- z.ZodObject<{
31
- id: z.ZodString;
32
- type: z.ZodString;
33
- caption: z.ZodOptional<z.ZodString>;
34
- }, z.core.$strip>
35
- ]>>;
36
- email: z.ZodOptional<z.ZodString>;
37
- address: z.ZodOptional<z.ZodObject<{
38
- type: z.ZodUnion<[
39
- z.ZodString,
40
- z.ZodArray<z.ZodString>
41
- ]>;
42
- addressCountry: z.ZodOptional<z.ZodString>;
43
- addressCountryCode: z.ZodOptional<z.ZodString>;
44
- addressRegion: z.ZodOptional<z.ZodString>;
45
- addressLocality: z.ZodOptional<z.ZodString>;
46
- streetAddress: z.ZodOptional<z.ZodString>;
47
- postOfficeBoxNumber: z.ZodOptional<z.ZodString>;
48
- postalCode: z.ZodOptional<z.ZodString>;
49
- geo: z.ZodOptional<z.ZodObject<{
50
- type: z.ZodUnion<[
51
- z.ZodString,
52
- z.ZodArray<z.ZodString>
53
- ]>;
54
- latitude: z.ZodNumber;
55
- longitude: z.ZodNumber;
56
- }, z.core.$strip>>;
57
- }, z.core.$strip>>;
58
- otherIdentifier: z.ZodOptional<z.ZodArray<z.ZodObject<{
59
- type: z.ZodUnion<[
60
- z.ZodString,
61
- z.ZodArray<z.ZodString>
62
- ]>;
63
- identifier: z.ZodString;
64
- identifierType: z.ZodUnion<[
65
- z.ZodEnum<{
66
- sourcedId: "sourcedId";
67
- systemId: "systemId";
68
- productId: "productId";
69
- userName: "userName";
70
- accountId: "accountId";
71
- emailAddress: "emailAddress";
72
- nationalIdentityNumber: "nationalIdentityNumber";
73
- isbn: "isbn";
74
- issn: "issn";
75
- lisSourcedId: "lisSourcedId";
76
- oneRosterSourcedId: "oneRosterSourcedId";
77
- sisSourcedId: "sisSourcedId";
78
- ltiContextId: "ltiContextId";
79
- ltiDeploymentId: "ltiDeploymentId";
80
- ltiToolId: "ltiToolId";
81
- ltiPlatformId: "ltiPlatformId";
82
- ltiUserId: "ltiUserId";
83
- identifier: "identifier";
84
- }>,
85
- z.ZodString
86
- ]>;
87
- }, z.core.$strip>>>;
88
- official: z.ZodOptional<z.ZodString>;
89
- parentOrg: z.ZodOptional<z.ZodAny>;
90
- familyName: z.ZodOptional<z.ZodString>;
91
- givenName: z.ZodOptional<z.ZodString>;
92
- additionalName: z.ZodOptional<z.ZodString>;
93
- patronymicName: z.ZodOptional<z.ZodString>;
94
- honorificPrefix: z.ZodOptional<z.ZodString>;
95
- honorificSuffix: z.ZodOptional<z.ZodString>;
96
- familyNamePrefix: z.ZodOptional<z.ZodString>;
97
- dateOfBirth: z.ZodOptional<z.ZodString>;
98
- }, z.core.$catchall<z.ZodAny>>
99
- ]>;
100
- credentialSubject: z.ZodUnion<[
101
- z.ZodObject<{
102
- id: z.ZodOptional<z.ZodString>;
103
- }, z.core.$catchall<z.ZodAny>>,
104
- z.ZodArray<z.ZodObject<{
105
- id: z.ZodOptional<z.ZodString>;
106
- }, z.core.$catchall<z.ZodAny>>>
107
- ]>;
108
- refreshService: z.ZodOptional<z.ZodUnion<[
109
- z.ZodObject<{
110
- id: z.ZodOptional<z.ZodString>;
111
- type: z.ZodString;
112
- }, z.core.$catchall<z.ZodAny>>,
113
- z.ZodArray<z.ZodObject<{
114
- id: z.ZodOptional<z.ZodString>;
115
- type: z.ZodString;
116
- }, z.core.$catchall<z.ZodAny>>>
117
- ]>>;
118
- credentialSchema: z.ZodOptional<z.ZodUnion<[
119
- z.ZodObject<{
120
- id: z.ZodString;
121
- type: z.ZodString;
122
- }, z.core.$catchall<z.ZodAny>>,
123
- z.ZodArray<z.ZodObject<{
124
- id: z.ZodString;
125
- type: z.ZodString;
126
- }, z.core.$catchall<z.ZodAny>>>
127
- ]>>;
128
- issuanceDate: z.ZodOptional<z.ZodString>;
129
- expirationDate: z.ZodOptional<z.ZodString>;
130
- credentialStatus: z.ZodOptional<z.ZodUnion<[
131
- z.ZodObject<{
132
- type: z.ZodString;
133
- id: z.ZodOptional<z.ZodString>;
134
- }, z.core.$catchall<z.ZodAny>>,
135
- z.ZodArray<z.ZodObject<{
136
- type: z.ZodString;
137
- id: z.ZodOptional<z.ZodString>;
138
- }, z.core.$catchall<z.ZodAny>>>
139
- ]>>;
140
- name: z.ZodOptional<z.ZodString>;
141
- description: z.ZodOptional<z.ZodString>;
142
- validFrom: z.ZodOptional<z.ZodString>;
143
- validUntil: z.ZodOptional<z.ZodString>;
144
- status: z.ZodOptional<z.ZodUnion<[
145
- z.ZodObject<{
146
- type: z.ZodString;
147
- id: z.ZodOptional<z.ZodString>;
148
- }, z.core.$catchall<z.ZodAny>>,
149
- z.ZodArray<z.ZodObject<{
150
- type: z.ZodString;
151
- id: z.ZodOptional<z.ZodString>;
152
- }, z.core.$catchall<z.ZodAny>>>
153
- ]>>;
154
- termsOfUse: z.ZodOptional<z.ZodUnion<[
155
- z.ZodObject<{
156
- type: z.ZodString;
157
- id: z.ZodOptional<z.ZodString>;
158
- }, z.core.$catchall<z.ZodAny>>,
159
- z.ZodArray<z.ZodObject<{
160
- type: z.ZodString;
161
- id: z.ZodOptional<z.ZodString>;
162
- }, z.core.$catchall<z.ZodAny>>>
163
- ]>>;
164
- evidence: z.ZodOptional<z.ZodUnion<readonly [
165
- z.ZodObject<{
166
- id: z.ZodOptional<z.ZodString>;
167
- type: z.ZodArray<z.ZodString>;
168
- name: z.ZodOptional<z.ZodString>;
169
- narrative: z.ZodOptional<z.ZodString>;
170
- description: z.ZodOptional<z.ZodString>;
171
- genre: z.ZodOptional<z.ZodString>;
172
- audience: z.ZodOptional<z.ZodString>;
173
- }, z.core.$catchall<z.ZodAny>>,
174
- z.ZodArray<z.ZodObject<{
175
- id: z.ZodOptional<z.ZodString>;
176
- type: z.ZodArray<z.ZodString>;
177
- name: z.ZodOptional<z.ZodString>;
178
- narrative: z.ZodOptional<z.ZodString>;
179
- description: z.ZodOptional<z.ZodString>;
180
- genre: z.ZodOptional<z.ZodString>;
181
- audience: z.ZodOptional<z.ZodString>;
182
- }, z.core.$catchall<z.ZodAny>>>
183
- ]>>;
184
- renderMethod: z.ZodOptional<z.ZodUnion<readonly [
185
- z.ZodUnion<readonly [
186
- z.ZodObject<{
187
- type: z.ZodLiteral<"TemplateRenderMethod">;
188
- renderSuite: z.ZodString;
189
- template: z.ZodString;
190
- renderProperty: z.ZodOptional<z.ZodArray<z.ZodString>>;
191
- outputPreference: z.ZodOptional<z.ZodObject<{
192
- mediaType: z.ZodString;
193
- }, z.core.$strip>>;
194
- }, z.core.$strip>,
195
- z.ZodRecord<z.ZodString, z.ZodAny>
196
- ]>,
197
- z.ZodArray<z.ZodUnion<readonly [
198
- z.ZodObject<{
199
- type: z.ZodLiteral<"TemplateRenderMethod">;
200
- renderSuite: z.ZodString;
201
- template: z.ZodString;
202
- renderProperty: z.ZodOptional<z.ZodArray<z.ZodString>>;
203
- outputPreference: z.ZodOptional<z.ZodObject<{
204
- mediaType: z.ZodString;
205
- }, z.core.$strip>>;
206
- }, z.core.$strip>,
207
- z.ZodRecord<z.ZodString, z.ZodAny>
208
- ]>>
209
- ]>>;
210
- }, z.core.$catchall<z.ZodAny>>;
211
- export type UnsignedVC = z.infer<typeof UnsignedVCValidator>;
212
- declare const VCValidator: z.ZodObject<{
213
- "@context": z.ZodArray<z.ZodUnion<[
214
- z.ZodString,
215
- z.ZodRecord<z.ZodString, z.ZodAny>
216
- ]>>;
217
- id: z.ZodOptional<z.ZodString>;
218
- type: z.ZodArray<z.ZodString>;
219
- issuer: z.ZodUnion<[
220
- z.ZodString,
221
- z.ZodObject<{
222
- id: z.ZodOptional<z.ZodString>;
223
- type: z.ZodUnion<[
224
- z.ZodString,
225
- z.ZodOptional<z.ZodArray<z.ZodString>>
226
- ]>;
227
- name: z.ZodOptional<z.ZodString>;
228
- url: z.ZodOptional<z.ZodString>;
229
- phone: z.ZodOptional<z.ZodString>;
230
- description: z.ZodOptional<z.ZodString>;
231
- endorsement: z.ZodOptional<z.ZodArray<z.ZodAny>>;
232
- image: z.ZodOptional<z.ZodUnion<[
233
- z.ZodString,
234
- z.ZodObject<{
235
- id: z.ZodString;
236
- type: z.ZodString;
237
- caption: z.ZodOptional<z.ZodString>;
238
- }, z.core.$strip>
239
- ]>>;
240
- email: z.ZodOptional<z.ZodString>;
241
- address: z.ZodOptional<z.ZodObject<{
242
- type: z.ZodUnion<[
243
- z.ZodString,
244
- z.ZodArray<z.ZodString>
245
- ]>;
246
- addressCountry: z.ZodOptional<z.ZodString>;
247
- addressCountryCode: z.ZodOptional<z.ZodString>;
248
- addressRegion: z.ZodOptional<z.ZodString>;
249
- addressLocality: z.ZodOptional<z.ZodString>;
250
- streetAddress: z.ZodOptional<z.ZodString>;
251
- postOfficeBoxNumber: z.ZodOptional<z.ZodString>;
252
- postalCode: z.ZodOptional<z.ZodString>;
253
- geo: z.ZodOptional<z.ZodObject<{
254
- type: z.ZodUnion<[
255
- z.ZodString,
256
- z.ZodArray<z.ZodString>
257
- ]>;
258
- latitude: z.ZodNumber;
259
- longitude: z.ZodNumber;
260
- }, z.core.$strip>>;
261
- }, z.core.$strip>>;
262
- otherIdentifier: z.ZodOptional<z.ZodArray<z.ZodObject<{
263
- type: z.ZodUnion<[
264
- z.ZodString,
265
- z.ZodArray<z.ZodString>
266
- ]>;
267
- identifier: z.ZodString;
268
- identifierType: z.ZodUnion<[
269
- z.ZodEnum<{
270
- sourcedId: "sourcedId";
271
- systemId: "systemId";
272
- productId: "productId";
273
- userName: "userName";
274
- accountId: "accountId";
275
- emailAddress: "emailAddress";
276
- nationalIdentityNumber: "nationalIdentityNumber";
277
- isbn: "isbn";
278
- issn: "issn";
279
- lisSourcedId: "lisSourcedId";
280
- oneRosterSourcedId: "oneRosterSourcedId";
281
- sisSourcedId: "sisSourcedId";
282
- ltiContextId: "ltiContextId";
283
- ltiDeploymentId: "ltiDeploymentId";
284
- ltiToolId: "ltiToolId";
285
- ltiPlatformId: "ltiPlatformId";
286
- ltiUserId: "ltiUserId";
287
- identifier: "identifier";
288
- }>,
289
- z.ZodString
290
- ]>;
291
- }, z.core.$strip>>>;
292
- official: z.ZodOptional<z.ZodString>;
293
- parentOrg: z.ZodOptional<z.ZodAny>;
294
- familyName: z.ZodOptional<z.ZodString>;
295
- givenName: z.ZodOptional<z.ZodString>;
296
- additionalName: z.ZodOptional<z.ZodString>;
297
- patronymicName: z.ZodOptional<z.ZodString>;
298
- honorificPrefix: z.ZodOptional<z.ZodString>;
299
- honorificSuffix: z.ZodOptional<z.ZodString>;
300
- familyNamePrefix: z.ZodOptional<z.ZodString>;
301
- dateOfBirth: z.ZodOptional<z.ZodString>;
302
- }, z.core.$catchall<z.ZodAny>>
303
- ]>;
304
- credentialSubject: z.ZodUnion<[
305
- z.ZodObject<{
306
- id: z.ZodOptional<z.ZodString>;
307
- }, z.core.$catchall<z.ZodAny>>,
308
- z.ZodArray<z.ZodObject<{
309
- id: z.ZodOptional<z.ZodString>;
310
- }, z.core.$catchall<z.ZodAny>>>
311
- ]>;
312
- refreshService: z.ZodOptional<z.ZodUnion<[
313
- z.ZodObject<{
314
- id: z.ZodOptional<z.ZodString>;
315
- type: z.ZodString;
316
- }, z.core.$catchall<z.ZodAny>>,
317
- z.ZodArray<z.ZodObject<{
318
- id: z.ZodOptional<z.ZodString>;
319
- type: z.ZodString;
320
- }, z.core.$catchall<z.ZodAny>>>
321
- ]>>;
322
- credentialSchema: z.ZodOptional<z.ZodUnion<[
323
- z.ZodObject<{
324
- id: z.ZodString;
325
- type: z.ZodString;
326
- }, z.core.$catchall<z.ZodAny>>,
327
- z.ZodArray<z.ZodObject<{
328
- id: z.ZodString;
329
- type: z.ZodString;
330
- }, z.core.$catchall<z.ZodAny>>>
331
- ]>>;
332
- issuanceDate: z.ZodOptional<z.ZodString>;
333
- expirationDate: z.ZodOptional<z.ZodString>;
334
- credentialStatus: z.ZodOptional<z.ZodUnion<[
335
- z.ZodObject<{
336
- type: z.ZodString;
337
- id: z.ZodOptional<z.ZodString>;
338
- }, z.core.$catchall<z.ZodAny>>,
339
- z.ZodArray<z.ZodObject<{
340
- type: z.ZodString;
341
- id: z.ZodOptional<z.ZodString>;
342
- }, z.core.$catchall<z.ZodAny>>>
343
- ]>>;
344
- name: z.ZodOptional<z.ZodString>;
345
- description: z.ZodOptional<z.ZodString>;
346
- validFrom: z.ZodOptional<z.ZodString>;
347
- validUntil: z.ZodOptional<z.ZodString>;
348
- status: z.ZodOptional<z.ZodUnion<[
349
- z.ZodObject<{
350
- type: z.ZodString;
351
- id: z.ZodOptional<z.ZodString>;
352
- }, z.core.$catchall<z.ZodAny>>,
353
- z.ZodArray<z.ZodObject<{
354
- type: z.ZodString;
355
- id: z.ZodOptional<z.ZodString>;
356
- }, z.core.$catchall<z.ZodAny>>>
357
- ]>>;
358
- termsOfUse: z.ZodOptional<z.ZodUnion<[
359
- z.ZodObject<{
360
- type: z.ZodString;
361
- id: z.ZodOptional<z.ZodString>;
362
- }, z.core.$catchall<z.ZodAny>>,
363
- z.ZodArray<z.ZodObject<{
364
- type: z.ZodString;
365
- id: z.ZodOptional<z.ZodString>;
366
- }, z.core.$catchall<z.ZodAny>>>
367
- ]>>;
368
- evidence: z.ZodOptional<z.ZodUnion<readonly [
369
- z.ZodObject<{
370
- id: z.ZodOptional<z.ZodString>;
371
- type: z.ZodArray<z.ZodString>;
372
- name: z.ZodOptional<z.ZodString>;
373
- narrative: z.ZodOptional<z.ZodString>;
374
- description: z.ZodOptional<z.ZodString>;
375
- genre: z.ZodOptional<z.ZodString>;
376
- audience: z.ZodOptional<z.ZodString>;
377
- }, z.core.$catchall<z.ZodAny>>,
378
- z.ZodArray<z.ZodObject<{
379
- id: z.ZodOptional<z.ZodString>;
380
- type: z.ZodArray<z.ZodString>;
381
- name: z.ZodOptional<z.ZodString>;
382
- narrative: z.ZodOptional<z.ZodString>;
383
- description: z.ZodOptional<z.ZodString>;
384
- genre: z.ZodOptional<z.ZodString>;
385
- audience: z.ZodOptional<z.ZodString>;
386
- }, z.core.$catchall<z.ZodAny>>>
387
- ]>>;
388
- renderMethod: z.ZodOptional<z.ZodUnion<readonly [
389
- z.ZodUnion<readonly [
390
- z.ZodObject<{
391
- type: z.ZodLiteral<"TemplateRenderMethod">;
392
- renderSuite: z.ZodString;
393
- template: z.ZodString;
394
- renderProperty: z.ZodOptional<z.ZodArray<z.ZodString>>;
395
- outputPreference: z.ZodOptional<z.ZodObject<{
396
- mediaType: z.ZodString;
397
- }, z.core.$strip>>;
398
- }, z.core.$strip>,
399
- z.ZodRecord<z.ZodString, z.ZodAny>
400
- ]>,
401
- z.ZodArray<z.ZodUnion<readonly [
402
- z.ZodObject<{
403
- type: z.ZodLiteral<"TemplateRenderMethod">;
404
- renderSuite: z.ZodString;
405
- template: z.ZodString;
406
- renderProperty: z.ZodOptional<z.ZodArray<z.ZodString>>;
407
- outputPreference: z.ZodOptional<z.ZodObject<{
408
- mediaType: z.ZodString;
409
- }, z.core.$strip>>;
410
- }, z.core.$strip>,
411
- z.ZodRecord<z.ZodString, z.ZodAny>
412
- ]>>
413
- ]>>;
414
- proof: z.ZodUnion<[
415
- z.ZodObject<{
416
- type: z.ZodString;
417
- created: z.ZodString;
418
- challenge: z.ZodOptional<z.ZodString>;
419
- domain: z.ZodOptional<z.ZodString>;
420
- nonce: z.ZodOptional<z.ZodString>;
421
- proofPurpose: z.ZodString;
422
- verificationMethod: z.ZodString;
423
- jws: z.ZodOptional<z.ZodString>;
424
- }, z.core.$catchall<z.ZodAny>>,
425
- z.ZodArray<z.ZodObject<{
426
- type: z.ZodString;
427
- created: z.ZodString;
428
- challenge: z.ZodOptional<z.ZodString>;
429
- domain: z.ZodOptional<z.ZodString>;
430
- nonce: z.ZodOptional<z.ZodString>;
431
- proofPurpose: z.ZodString;
432
- verificationMethod: z.ZodString;
433
- jws: z.ZodOptional<z.ZodString>;
434
- }, z.core.$catchall<z.ZodAny>>>
435
- ]>;
436
- }, z.core.$catchall<z.ZodAny>>;
437
- export type VC = z.infer<typeof VCValidator>;
438
- declare const CredentialFormatValidator: z.ZodEnum<{
439
- "w3c-vc-2.0": "w3c-vc-2.0";
440
- "w3c-vc-1.1": "w3c-vc-1.1";
441
- "jwt-vc-json": "jwt-vc-json";
442
- "dc+sd-jwt": "dc+sd-jwt";
443
- "vc+sd-jwt": "vc+sd-jwt";
444
- mso_mdoc: "mso_mdoc";
445
- }>;
446
- export type CredentialFormat = z.infer<typeof CredentialFormatValidator>;
447
- export type StoredCredentialEnvelope = {
448
- format: CredentialFormat;
449
- data: string | Uint8Array;
450
- [key: string]: unknown;
451
- };
452
- /**
453
- * Format-discriminated read view over a stored credential. Returned
454
- * by `toStoredCredential(record)` in `@learncard/helpers`.
455
- *
456
- * The `data` field carries the correct wire-form representation for
457
- * the credential's format:
458
- * - W3C VCs: the JSON-LD VC object (also what `record.vc` holds)
459
- * - JWT-VC: the compact JWS string (extracted from `record.vc.proof.jwt`
460
- * if the record uses the legacy LDP-around-JWT envelope, otherwise
461
- * the raw string from `record.rawWireForm`)
462
- * - SD-JWT-VC: the compact `<JWT>~<disclosures>~` string
463
- * - mDoc: base64url-encoded CBOR bytes (stored as a string for
464
- * LearnCloud's JSON-only encrypted store; consumers base64-decode
465
- * when they need raw bytes)
466
- *
467
- * Format-aware consumers pattern-match on `format` and use `data`.
468
- * Legacy consumers continue to read `record.vc` directly — the
469
- * projector is opt-in, never required.
470
- */
471
- export type StoredCredential = {
472
- format: "w3c-vc-2.0";
473
- data: VC;
474
- } | {
475
- format: "w3c-vc-1.1";
476
- data: VC;
477
- } | {
478
- format: "jwt-vc-json";
479
- data: string;
480
- } | {
481
- format: "dc+sd-jwt";
482
- data: string;
483
- } | {
484
- format: "vc+sd-jwt";
485
- data: string;
486
- } | {
487
- format: "mso_mdoc";
488
- data: string;
489
- };
490
- export type CredentialRecord<Metadata extends Record<string, any> = Record<never, never>> = {
491
- id: string;
492
- uri: string;
493
- /**
494
- * Wire-format discriminator for the credential. Optional — when
495
- * absent, legacy readers infer it from `vc` shape (see
496
- * `toStoredCredential` in `@learncard/helpers`). Populated on new
497
- * writes once the consumer is format-aware.
498
- *
499
- * Added in ADR-0001 Phase 1 as additive metadata; existing
500
- * records without this field continue to work unchanged.
501
- */
502
- format?: CredentialFormat;
503
- /**
504
- * Optional semantic type hint for fast filtering without parsing
505
- * the full credential — `vct` for SD-JWT-VC, last-non-VC type for
506
- * W3C VCs, doctype for mDoc. Added in ADR-0001 Phase 1.
507
- */
508
- semanticType?: string;
509
- /**
510
- * On-the-wire representation for formats whose `vc` field cannot
511
- * hold the canonical form (SD-JWT compact, JWT-VC compact, base64
512
- * mDoc CBOR). Undefined for W3C VCs (`vc` IS the wire form). Added
513
- * in ADR-0001 Phase 1.
514
- */
515
- rawWireForm?: string;
516
- [key: string]: any;
517
- } & Metadata;
518
- declare const JWEValidator: z.ZodObject<{
519
- protected: z.ZodString;
520
- iv: z.ZodString;
521
- ciphertext: z.ZodString;
522
- tag: z.ZodString;
523
- aad: z.ZodOptional<z.ZodString>;
524
- recipients: z.ZodOptional<z.ZodArray<z.ZodObject<{
525
- header: z.ZodObject<{
526
- alg: z.ZodString;
527
- iv: z.ZodString;
528
- tag: z.ZodString;
529
- epk: z.ZodOptional<z.ZodObject<{
530
- kty: z.ZodOptional<z.ZodString>;
531
- crv: z.ZodOptional<z.ZodString>;
532
- x: z.ZodOptional<z.ZodString>;
533
- y: z.ZodOptional<z.ZodOptional<z.ZodString>>;
534
- n: z.ZodOptional<z.ZodOptional<z.ZodString>>;
535
- d: z.ZodOptional<z.ZodOptional<z.ZodString>>;
536
- }, z.core.$strip>>;
537
- kid: z.ZodOptional<z.ZodString>;
538
- apv: z.ZodOptional<z.ZodString>;
539
- apu: z.ZodOptional<z.ZodString>;
540
- }, z.core.$strip>;
541
- encrypted_key: z.ZodString;
542
- }, z.core.$strip>>>;
543
- }, z.core.$strip>;
544
- export type JWE = z.infer<typeof JWEValidator>;
545
- declare const BitstringStatusPurposeValidator: z.ZodEnum<{
546
- revocation: "revocation";
547
- suspension: "suspension";
548
- }>;
549
- export type BitstringStatusPurpose = z.infer<typeof BitstringStatusPurposeValidator>;
550
- declare const BitstringStatusListEntryValidator: z.ZodObject<{
551
- id: z.ZodOptional<z.ZodString>;
552
- type: z.ZodLiteral<"BitstringStatusListEntry">;
553
- statusPurpose: z.ZodEnum<{
554
- revocation: "revocation";
555
- suspension: "suspension";
556
- }>;
557
- statusListIndex: z.ZodUnion<[
558
- z.ZodString,
559
- z.ZodNumber
560
- ]>;
561
- statusListCredential: z.ZodString;
562
- }, z.core.$strip>;
563
- export type BitstringStatusListEntry = z.infer<typeof BitstringStatusListEntryValidator>;
564
- declare const Providers: {
565
- filestack: typeof filestack;
566
- unsplash: typeof unsplash;
567
- discord: typeof discord;
568
- };
569
- export declare const getProvider: (url?: string) => keyof typeof Providers | null;
570
- export declare const changeQuality: (url: string, quality: number) => string;
571
- export declare const fixUrl: (url: string, mimetype?: string, webp?: boolean) => string;
572
- export declare const generateSrcSet: (url: string, resolutions: number[], options?: {
573
- mimetype?: string;
574
- fix?: boolean;
575
- webp?: boolean;
576
- }) => string;
577
- export declare const resizeAndChangeQuality: (url: string, size: number, quality: number, options?: {
578
- mimetype?: string;
579
- fix?: boolean;
580
- webp?: boolean;
581
- }) => string;
582
- export declare const DEFAULT_RESOLUTIONS: number[];
583
- /**
584
- * Gets an array of URLs from a srcSet string
585
- *
586
- * @param srcSet HTML srcSet string (e.g. 'test.com/img 100w, test.com/img2 200w')
587
- *
588
- * @return URLs
589
- */
590
- export declare const getUrlsFromSrcSet: (srcSet: string) => [
591
- string,
592
- string
593
- ][];
594
- /** Quantizes a number to the closest number in an array of numbers */
595
- export declare const quantizeValue: (value: number, array: number[]) => number;
596
- export declare const isNotMaybe: <T>(value?: T | null | undefined) => value is T;
597
- export declare const filterMaybes: <T>(array?: (T | null | undefined)[]) => T[];
598
- export declare const capitalizeFirstLetter: (string: string) => string;
599
- /**
600
- * Formats a number into a friendlier string i.e. 1,234 becomes 1.2K
601
- */
602
- export declare const formatNumber: (num: number) => string;
603
- export type SetState<T> = Dispatch<SetStateAction<T>>;
604
- export type UpdaterArgs<T> = T | DraftFunction<T>;
605
- export type CurriedReturn<ValueArg, Value> = undefined extends ValueArg ? (innerValue: Value) => void : void;
606
- export type InnerImmerOuterImmer<State> = <Field extends keyof Draft<State>, Value extends UpdaterArgs<Draft<State>[Field]>, ValueArg extends Value | undefined>(field: Field, value?: ValueArg) => CurriedReturn<ValueArg, Value>;
607
- export type InnerReactOuterImmer<State> = <Field extends keyof Draft<State>, Value extends SetStateAction<Draft<State>[Field]>, ValueArg extends Value | undefined>(field: Field, value?: ValueArg) => CurriedReturn<ValueArg, Value>;
608
- export type InnerImmerOuterReact<State> = <Field extends keyof State, Value extends UpdaterArgs<State[Field]>, ValueArg extends Value | undefined>(field: Field, value?: ValueArg) => CurriedReturn<ValueArg, Value>;
609
- export type InnerReactOuterReact<State> = <Field extends keyof State, Value extends SetStateAction<State[Field]>, ValueArg extends Value | undefined>(field: Field, value?: ValueArg) => CurriedReturn<ValueArg, Value>;
610
- export declare function innerImmerOuterImmer<State, Field extends keyof Draft<State>, Value extends UpdaterArgs<Draft<State>[Field]>>(setState: Updater<State>, field: Field): (innerValue: NonNullable<Value>) => void;
611
- export declare function innerImmerOuterImmer<State, Field extends keyof Draft<State>, Value extends UpdaterArgs<Draft<State>[Field]>, ValueArg extends Value | undefined>(setState: Updater<State>, field: Field, value: ValueArg): void;
612
- /**
613
- * Curry function to allow innerImmerOuterImmer to be used without constantly passing in setState
614
- *
615
- * Use like so:
616
- *
617
- * [state, setState] = useImmer<{ num: number; string: string; }>({ num: 1, string: 'str' });
618
- *
619
- * const updateField = curriedInnerImmerOuterImmer(setState);
620
- *
621
- * updateField('num', 3); // Updates state to { num: 3, string: 'str' }
622
- *
623
- * updateField(
624
- * 'num',
625
- * oldNum => {
626
- * oldNum += 1;
627
- * },
628
- * ); // Updates state to { num: 4, string: 'str' }
629
- *
630
- * updateField(setState, 'num', 'three'); // TS Error due to invalid type
631
- */
632
- export declare const curriedInnerImmerOuterImmer: <State>(setState: Updater<State>) => InnerImmerOuterImmer<State>;
633
- export declare function innerReactOuterImmer<State, Field extends keyof Draft<State>, Value extends SetStateAction<Draft<State>[Field]>>(setState: Updater<State>, field: Field): (innerValue: NonNullable<Value>) => void;
634
- export declare function innerReactOuterImmer<State, Field extends keyof Draft<State>, Value extends SetStateAction<Draft<State>[Field]>, ValueArg extends Value | undefined>(setState: Updater<State>, field: Field, value: ValueArg): void;
635
- /**
636
- * Curry function to allow innerReactOuterImmer to be used without constantly passing in setState
637
- *
638
- * Use like so:
639
- *
640
- * [state, setState] = useImmer<{ num: number; string: string; }>({ num: 1, string: 'str' });
641
- *
642
- * const updateField = curriedUpdateImmerSetStateField(setState);
643
- *
644
- * updateField('num', 3); // Updates state to { num: 3, string: 'str' }
645
- *
646
- * updateField('num', oldNum => oldNum + 1); // Updates state to { num: 4, string: 'str' }
647
- *
648
- * updateField(setState, 'num', 'three'); // TS Error due to invalid type
649
- */
650
- export declare const curriedInnerReactOuterImmer: <State>(setState: Updater<State>) => InnerReactOuterImmer<State>;
651
- export declare function innerImmerOuterReact<State, Field extends keyof State, Value extends UpdaterArgs<State[Field]>>(setState: SetState<State>, field: Field): (innerValue: NonNullable<Value>) => void;
652
- export declare function innerImmerOuterReact<State, Field extends keyof State, Value extends UpdaterArgs<State[Field]>, ValueArg extends Value | undefined>(setState: SetState<State>, field: Field, value: ValueArg): void;
653
- /**
654
- * Curry function to allow innerImmerOuterReact to be used without constantly passing in setState
655
- *
656
- * Use like so:
657
- *
658
- * [state, setState] = useImmer<{ num: number; string: string; }>({ num: 1, string: 'str' });
659
- *
660
- * const updateField = curriedInnerImmerOuterImmer(setState);
661
- *
662
- * updateField('num', 3); // Updates state to { num: 3, string: 'str' }
663
- *
664
- * updateField(
665
- * 'num',
666
- * oldNum => {
667
- * oldNum += 1;
668
- * },
669
- * ); // Updates state to { num: 4, string: 'str' }
670
- *
671
- * updateField(setState, 'num', 'three'); // TS Error due to invalid type
672
- */
673
- export declare const curriedInnerImmerOuterReact: <State>(setState: SetState<State>) => InnerImmerOuterReact<State>;
674
- export declare function innerReactOuterReact<State, Field extends keyof State, Value extends SetStateAction<State[Field]>>(setState: SetState<State>, field: Field): (innerValue: NonNullable<Value>) => void;
675
- export declare function innerReactOuterReact<State, Field extends keyof State, Value extends SetStateAction<State[Field]>, ValueArg extends Value | undefined>(setState: SetState<State>, field: Field, value: ValueArg): void;
676
- /**
677
- * Curry function to allow updateSetStateField to be used without constantly passing in setState
678
- *
679
- * If possible, please consider updating your useState calls to useImmer and using the immer
680
- * versions of these functions
681
- *
682
- * Use like so:
683
- *
684
- * [state, setState] = useState<{ num: number; string: string; }>({ num: 1, string: 'str' });
685
- *
686
- * const updateField = curriedInnerReactOuterReact(setState);
687
- *
688
- * updateField('num', 3); // Updates state to { num: 3, string: 'str' }
689
- *
690
- * updateField('num', oldNum => oldNum + 1); // Updates state to { num: 4, string: 'str' }
691
- *
692
- * updateField(setState, 'num', 'three'); // TS Error due to invalid type
693
- */
694
- export declare const curriedInnerReactOuterReact: <State>(setState: SetState<State>) => InnerReactOuterReact<State>;
695
- export declare function curriedStateSlice<State>(setState: Updater<State>): InnerImmerOuterImmer<State>;
696
- export declare function curriedStateSlice<State>(setState: Updater<State>, options: {
697
- inner: "immer";
698
- outer: "immer";
699
- }): InnerImmerOuterImmer<State>;
700
- export declare function curriedStateSlice<State>(setState: Updater<State>, options: {
701
- inner: "immer";
702
- outer: "react";
703
- }): InnerImmerOuterReact<State>;
704
- export declare function curriedStateSlice<State>(setState: SetState<State>, options: {
705
- inner: "react";
706
- outer: "immer";
707
- }): InnerReactOuterImmer<State>;
708
- export declare function curriedStateSlice<State>(setState: SetState<State>, options: {
709
- inner: "react";
710
- outer: "react";
711
- }): InnerReactOuterReact<State>;
712
- export type UpdateSlice<State> = {
713
- (index: number): Updater<State>;
714
- (index: number, value: UpdaterArgs<State>): void;
715
- };
716
- export type CurriedArraySlice = {
717
- <State>(setState: SetState<State[]>): UpdateSlice<State>;
718
- <State>(setState: SetState<State[]>, index: number): Updater<State>;
719
- <State>(setState: SetState<State[]>, index: number, value: State): void;
720
- };
721
- export declare const curriedArraySlice: CurriedArraySlice;
722
- export type ImmerArraySlice = {
723
- <State>(setState: Updater<State[]>): UpdateSlice<State>;
724
- <State>(setState: Updater<State[]>, index: number): Updater<State>;
725
- <State>(setState: Updater<State[]>, index: number, value: State): void;
726
- };
727
- export declare const immerArraySlice: ImmerArraySlice;
728
- export declare const getCredentialStatusArray: (credential: unknown) => Record<string, unknown>[];
729
- export declare const isBitstringStatusListEntry: (status: unknown) => status is BitstringStatusListEntry;
730
- export declare const getBitstringStatusListEntries: (credential: unknown) => BitstringStatusListEntry[];
731
- export declare const getBitstringStatusListEntryForPurpose: (credential: unknown, statusPurpose: BitstringStatusPurpose) => BitstringStatusListEntry | undefined;
732
- export declare const getBitstringStatusListBit: (bitstring: Uint8Array, index: number) => boolean;
733
- export declare const setBitstringStatusListBit: (bitstring: Uint8Array, index: number, value: boolean) => void;
734
- export declare const ImageResizingValidator: z.ZodObject<{
735
- type: z.ZodLiteral<"resizing">;
736
- }, z.core.$strip>;
737
- export type ImageResizing = z.infer<typeof ImageResizingValidator>;
738
- export declare const ImageUploadingValidator: z.ZodObject<{
739
- type: z.ZodLiteral<"uploading">;
740
- progress: z.ZodOptional<z.ZodNumber>;
741
- }, z.core.$strip>;
742
- export type ImageUploading = z.infer<typeof ImageUploadingValidator>;
743
- export declare const ImageWithLoadingStateValdator: z.ZodObject<{
744
- image: z.ZodString;
745
- loading: z.ZodOptional<z.ZodUnion<readonly [
746
- z.ZodObject<{
747
- type: z.ZodLiteral<"resizing">;
748
- }, z.core.$strip>,
749
- z.ZodObject<{
750
- type: z.ZodLiteral<"uploading">;
751
- progress: z.ZodOptional<z.ZodNumber>;
752
- }, z.core.$strip>
753
- ]>>;
754
- }, z.core.$strip>;
755
- export type ImageWithLoadingState = z.infer<typeof ImageWithLoadingStateValdator>;
756
- export type FilestackImage = {
757
- filename: string;
758
- handle: string;
759
- mimetype: string;
760
- originalFile: {
761
- name: string;
762
- size: number;
763
- type: string;
764
- };
765
- originalPath: string;
766
- size: number;
767
- source: string;
768
- status: string;
769
- uploadId: string;
770
- url: string;
771
- };
772
- export type Simplify<T> = {
773
- [KeyType in keyof T]: T[KeyType];
774
- };
775
- export type Maybify<T> = Simplify<{
776
- [P in keyof T]?: Maybify<T[P]> | null;
777
- }>;
778
- /** If Maybify gives you an exceeds maximum length error, try this one! */
779
- export type PerformantMaybify<T> = {
780
- [P in keyof T]?: PerformantMaybify<T[P]> | null;
781
- };
782
- export type DeepValues<ObjectType extends object> = {
783
- [Key in keyof ObjectType & (string | number)]: ObjectType[Key] extends object ? DeepValues<ObjectType[Key]> : ObjectType[Key];
784
- }[keyof ObjectType & (string | number)];
785
- export interface Nothing {
786
- }
787
- export type Other<T> = T & Nothing;
788
- export type SuggestString<Literals extends string> = Literals | Other<string>;
789
- export type DeepPartial<T> = T extends Date ? T : T extends object ? {
790
- [P in keyof T]?: DeepPartial<T[P]>;
791
- } : T;
792
- export declare const isNotUndefined: <T>(value: T | null | undefined) => value is T;
793
- export declare const filterUndefined: <T>(arr: (T | null | undefined)[]) => T[];
794
- /**
795
- * App installation age restriction logic shared between frontend and backend.
796
- *
797
- * This helper evaluates whether a user can install an app based on:
798
- * - Hard age blocks (min_age) - always blocks, even with guardian approval
799
- * - Soft age restrictions (age_rating) - can be approved by guardian for child profiles
800
- * - Contract requirements - require guardian approval for child profiles
801
- */
802
- export type AppInstallCheckResult = {
803
- action: "proceed";
804
- } | {
805
- action: "hard_blocked";
806
- reason: string;
807
- } | {
808
- action: "require_dob";
809
- reason: string;
810
- } | {
811
- action: "require_guardian_approval";
812
- reason: string;
813
- };
814
- export type AppInstallCheckInput = {
815
- /** Whether the user is a child profile (managed account) */
816
- isChildProfile: boolean;
817
- /** User's age calculated from DOB, null if DOB is unknown */
818
- userAge: number | null;
819
- /** Hard minimum age requirement (blocks completely, no guardian override) */
820
- minAge?: number;
821
- /** Soft age rating string (e.g., '4+', '9+', '12+', '17+') */
822
- ageRating?: string;
823
- /** Whether the app has an associated consent contract */
824
- hasContract: boolean;
825
- /** Whether guardian approval has already been obtained (for backend validation) */
826
- hasGuardianApproval?: boolean;
827
- };
828
- /**
829
- * Evaluates whether a user can install an app based on age restrictions and profile type.
830
- *
831
- * Cases:
832
- * 1. Hard block: min_age violation (blocks completely, cannot be overridden)
833
- * 2. Child profile scenarios:
834
- * 2a. Child age unknown → require DOB entry (with guardian approval)
835
- * 2b. No age rating specified → require guardian approval
836
- * 2c. Child too young for age rating → require guardian approval
837
- * 2d. App has a contract → require guardian approval
838
- * 2e. Child old enough, no contract → proceed without guardian
839
- * 3. Adult user old enough → proceed
840
- *
841
- * @param input - The check parameters
842
- * @returns The action to take and reason if blocked/requires approval
843
- */
844
- export declare const checkAppInstallEligibility: (input: AppInstallCheckInput) => AppInstallCheckResult;
845
- /**
846
- * Map age_rating strings to numeric minimum ages.
847
- */
848
- export declare const AGE_RATING_TO_MIN_AGE: Record<string, number>;
849
- /**
850
- * Calculate age in years from a date of birth string.
851
- * @param dob - Date of birth as ISO string or parseable date string
852
- * @returns Age in years, or null if the date is invalid
853
- */
854
- export declare const calculateAgeFromDob: (dob?: string | null) => number | null;
855
- /**
856
- * Project a `CredentialRecord` into a format-discriminated read view.
857
- *
858
- * Two paths into the same output:
859
- *
860
- * 1. **Explicit format**: if the record carries an explicit `format`
861
- * discriminator (and `rawWireForm` where required), the projector
862
- * trusts it. This is the path new format-aware writers take.
863
- *
864
- * 2. **Inferred from shape** (legacy fallback): for records that
865
- * pre-date format-tagging, the projector inspects `record.vc` and
866
- * infers the format. W3C VCs → `w3c-vc-2.0` / `w3c-vc-1.1` based
867
- * on `@context`; transitional SD-JWT wrappers (which never shipped
868
- * but exist on branch `lc-1796-3`) → `dc+sd-jwt` with the compact
869
- * extracted from `proof.jwt`; legacy JWT-VC envelopes → `jwt-vc-json`.
870
- *
871
- * Returns a `StoredCredential` for every conceivable record. Never
872
- * throws — credentials with unrecognizable shape fall back to
873
- * `w3c-vc-1.1` with `data = record.vc` so legacy consumers keep
874
- * something they can read.
875
- *
876
- * This projector is the SAFETY NET that makes the format-tagging
877
- * migration non-breaking: writers can adopt format-tagging at their
878
- * own pace; readers using this projector see the right discriminator
879
- * either way.
880
- */
881
- export declare const toStoredCredential: (record: CredentialRecord) => StoredCredential;
882
- /**
883
- * Extract the meaningful identifying segment from an SD-JWT-VC `vct` claim
884
- * so it can be projected onto the W3C-VC `type` array and `name` field.
885
- *
886
- * Returns `undefined` for vct values where no meaningful name can be
887
- * derived (numeric-only URN tails, empty string). Shared between the
888
- * receipt-time wrapper synthesizer and the read-time display projector
889
- * so SD-JWT credentials produce the same wrapper shape on both paths.
890
- */
891
- export declare const extractVctSegment: (vct: string) => string | undefined;
892
- /**
893
- * PascalCase identifier suitable for the W3C-VC `type` array. Picks acronyms
894
- * for short single-word lowercase segments ("pid" → "PID") and otherwise
895
- * concatenates capitalized words ("playground-credential" → "PlaygroundCredential").
896
- */
897
- export declare const deriveTypeFromVct: (vct: string | undefined) => string | undefined;
898
- /**
899
- * Human-readable display name for the `name` field. Same input handling
900
- * as {@link deriveTypeFromVct} but keeps spaces between words so it reads
901
- * naturally in UIs ("Playground Credential" not "PlaygroundCredential").
902
- */
903
- export declare const deriveNameFromVct: (vct: string | undefined) => string | undefined;
904
- export declare const stripSdJwtReservedClaims: (claims: Record<string, unknown>) => Record<string, unknown>;
905
- export declare const synthesizeDidJwk: (jwk: Record<string, unknown>) => string | undefined;
906
- export declare const deriveSdJwtIssuedAtIso: (options: {
907
- issuedAt?: Date;
908
- notBefore?: Date;
909
- iat?: number;
910
- nbf?: number;
911
- }) => string;
912
- /**
913
- * Read-path shim: when a storage plugin returns a `StoredCredentialEnvelope` (because we
914
- * wrote a native non-W3C format like SD-JWT-VC), legacy UI components
915
- * that read `.credentialSubject` / `.issuer` / `.proof` need a VC-shaped
916
- * object. This projector synthesizes a minimal display-only VC from the
917
- * envelope so existing consumers keep working without per-component
918
- * format awareness.
919
- *
920
- * For SD-JWT-VC: decodes the unsigned JWS payload (signature is NOT
921
- * verified here — verification belongs to the dedicated verify chain),
922
- * surfaces the disclosed claims under `credentialSubject`, preserves
923
- * the compact form under `proof.jwt` and `proof.type = 'SdJwtCompactProof'`
924
- * so anything that already understands the SD-JWT-Compact-Proof shape
925
- * keeps working.
926
- *
927
- * For JWT-VC: decodes the JWS payload, returns its `vc` claim.
928
- *
929
- * For mDoc / unknown formats: returns `undefined` — the caller MUST
930
- * branch on format (`record.format === 'mso_mdoc'`) and use a
931
- * format-specific display path. We don't fabricate a fake VC for
932
- * binary credentials.
933
- *
934
- * This projector is intentionally LOSSY for SD-JWT — it produces a
935
- * display-only view, NOT a re-issuable credential. Egress paths
936
- * (sharing, presenting, re-uploading) MUST go through
937
- * `serializeForWire(stored)` (Phase 3) to recover the canonical
938
- * compact form from `envelope.data`. NEVER re-serialize from the
939
- * projected VC.
940
- */
941
- export declare const projectEnvelopeToDisplayVc: (envelope: StoredCredentialEnvelope) => VC | undefined;
942
- /**
943
- * Convenience: detect an envelope on the wire and return a legacy VC
944
- * shape suitable for downstream W3C-only consumers. Returns the input
945
- * unchanged if it's not an envelope (so callers can wrap any
946
- * `read.get` result without branching themselves).
947
- */
948
- export declare const resolveStorageReadResult: (value: VC | StoredCredentialEnvelope | undefined) => VC | StoredCredentialEnvelope | undefined;
949
- /** Generates a did:web for a user given the app domain and profile ID. */
950
- export declare const getDidWeb: (domain: string, profileId: string) => string;
951
- /**
952
- * Determines whether or not a string is a valid hexadecimal string
953
- *
954
- * E.g. 'abc123' is valid hex, 'zzz' is not
955
- */
956
- export declare const isHex: (str: string) => boolean;
957
- /** Determines whether or not an object is an encrypted JWE */
958
- export declare const isEncrypted: (item: Record<string, any>) => item is JWE;
959
- /**
960
- * tRPC data transformer that handles RegExp serialization/deserialization
961
- */
962
- export declare const RegExpTransformer: DataTransformer;
963
- /**
964
- * Determines if a credential uses VC 2.0 format by checking the context array
965
- */
966
- export declare const isVC2Format: (credential: UnsignedVC | VC) => boolean;
967
- /** Unwraps a boost credential from a CertifiedBoostCredential, if it is one */
968
- export declare const unwrapBoostCredential: (vc?: VC | UnsignedVC) => any;
969
- /**
970
- * Checks if a DID is an app-specific did:web
971
- *
972
- * App did:webs follow the pattern: `did:web:learncard.app:app:&lt;slug&gt;`
973
- *
974
- * @param did - The DID to check
975
- * @returns true if the DID is an app did:web, false otherwise
976
- */
977
- export declare const isAppDidWeb: (did?: string) => boolean;
978
-
979
- export {};