@powerhousedao/reactor-browser 6.2.2-dev.2 → 6.2.2-dev.21

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 (34) hide show
  1. package/README.md +178 -0
  2. package/dist/client-DAJGpNZH.d.ts +14 -0
  3. package/dist/client-DAJGpNZH.d.ts.map +1 -0
  4. package/dist/{client-u13cr-Vg.js → client-DKuvLO3_.js} +30 -3
  5. package/dist/client-DKuvLO3_.js.map +1 -0
  6. package/dist/index-B3keszpu.d.ts +144 -0
  7. package/dist/index-B3keszpu.d.ts.map +1 -0
  8. package/dist/index-Cj_YGHcz.d.ts +692 -0
  9. package/dist/index-Cj_YGHcz.d.ts.map +1 -0
  10. package/dist/index.d.ts +100 -382
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +105 -7
  13. package/dist/index.js.map +1 -1
  14. package/dist/{inspector-proxy-CvQDDxmT.d.ts → inspector-proxy-Doocf0nD.d.ts} +1 -1
  15. package/dist/{inspector-proxy-CvQDDxmT.d.ts.map → inspector-proxy-Doocf0nD.d.ts.map} +1 -1
  16. package/dist/{index-DS4W07Y8.d.ts → pglite-CntadC_p-BgIvrYtV.d.ts} +2 -142
  17. package/dist/pglite-CntadC_p-BgIvrYtV.d.ts.map +1 -0
  18. package/dist/{renown-D-1c_Bvx.js → renown-DBvu1oq7.js} +424 -27
  19. package/dist/renown-DBvu1oq7.js.map +1 -0
  20. package/dist/src/graphql/client.d.ts +2 -1
  21. package/dist/src/relational/index.d.ts +1 -1
  22. package/dist/src/renown/index.d.ts +2 -2
  23. package/dist/src/renown/index.js +2 -2
  24. package/dist/src/rpc/index.d.ts +2 -2
  25. package/dist/src/rpc/index.js +1 -1
  26. package/dist/{client-09xv0Dq6.d.ts → types-CVZRGBXo.d.ts} +2 -11
  27. package/dist/types-CVZRGBXo.d.ts.map +1 -0
  28. package/package.json +9 -9
  29. package/dist/client-09xv0Dq6.d.ts.map +0 -1
  30. package/dist/client-u13cr-Vg.js.map +0 -1
  31. package/dist/index-D3bV5rcl.d.ts +0 -216
  32. package/dist/index-D3bV5rcl.d.ts.map +0 -1
  33. package/dist/index-DS4W07Y8.d.ts.map +0 -1
  34. package/dist/renown-D-1c_Bvx.js.map +0 -1
@@ -0,0 +1,692 @@
1
+ import { t as PGlite } from "./pglite-CntadC_p-BgIvrYtV.js";
2
+ import { c as ReactorGraphQLClient, r as GraphQLClientWindowEvents } from "./types-CVZRGBXo.js";
3
+ import { r as IWorkerAdminClient, t as IInspectorProxy } from "./inspector-proxy-Doocf0nD.js";
4
+ import { Action, DocumentAction, DocumentModelModule, PHDocument } from "@powerhousedao/shared/document-model";
5
+ import { DocumentDriveDocument } from "@powerhousedao/shared/document-drive";
6
+ import { IDocumentModelLoader, IReactorClient, InProcessReactorClientModule, InProcessReactorModule, ReactorClientModule, ReactorModule } from "@powerhousedao/reactor";
7
+ import { CSSProperties, DragEventHandler, ReactNode } from "react";
8
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
9
+ import * as _renown_sdk0 from "@renown/sdk";
10
+ import { CREDENTIAL_SCHEMA_EIP712_TYPE, CREDENTIAL_SUBJECT_TYPE, CREDENTIAL_TYPES, DOMAIN_TYPE, IRenown, ISSUER_TYPE, LoginStatus, User, VERIFIABLE_CREDENTIAL_EIP712_TYPE } from "@renown/sdk";
11
+ import { IAttachmentService } from "@powerhousedao/reactor-attachments/client";
12
+ import { LoginMethod, WalletAdaptersConfig, WalletSession, WalletTheme } from "@renown/sdk/wallet";
13
+ import { DocumentModelLib, RegistryPackageSource } from "@powerhousedao/shared";
14
+ import { PHConnectRenownAdapters } from "@powerhousedao/shared/clis";
15
+
16
+ //#region src/types/documents.d.ts
17
+ type DocumentDispatch<TAction extends Action> = (actionOrActions: TAction | TAction[] | DocumentAction | DocumentAction[] | undefined, onErrors?: (errors: Error[]) => void, onSuccess?: (result: PHDocument) => void) => void;
18
+ type PromiseWithState<T> = Promise<T> & PromiseState<T>;
19
+ type FulfilledPromise<T> = Promise<T> & {
20
+ status: "fulfilled";
21
+ value: T;
22
+ };
23
+ type RejectedPromise<T> = Promise<T> & {
24
+ status: "rejected";
25
+ reason: unknown;
26
+ };
27
+ type PromiseState<T> = {
28
+ status: "pending";
29
+ } | {
30
+ status: "fulfilled";
31
+ value: T;
32
+ } | {
33
+ status: "rejected";
34
+ reason: unknown;
35
+ };
36
+ interface IDocumentCache {
37
+ get(id: string, refetch?: boolean): Promise<PHDocument>;
38
+ getBatch(ids: string[], refetch?: boolean): Promise<PHDocument[]>;
39
+ subscribe(id: string | string[], callback: () => void): () => void;
40
+ }
41
+ //#endregion
42
+ //#region src/renown/use-renown-auth.d.ts
43
+ type RenownAuthStatus = LoginStatus | "loading";
44
+ interface RenownAuth {
45
+ status: RenownAuthStatus | undefined;
46
+ user: User | undefined;
47
+ address: string | undefined;
48
+ ensName: string | undefined;
49
+ avatarUrl: string | undefined;
50
+ profileId: string | undefined;
51
+ displayName: string | undefined;
52
+ displayAddress: string | undefined;
53
+ login: (session?: WalletSession, method?: LoginMethod) => void;
54
+ pending: boolean;
55
+ error: Error | undefined;
56
+ logout: () => Promise<void>;
57
+ openProfile: () => void;
58
+ }
59
+ declare function useRenownAuth(): RenownAuth;
60
+ type RenownAuthResolution = "authenticated" | "resolving" | "unauthenticated";
61
+ interface RenownAuthAsync extends RenownAuth {
62
+ /** Collapsed routing state; "resolving" until auth is known. */
63
+ state: RenownAuthResolution;
64
+ isResolving: boolean;
65
+ }
66
+ declare function useRenownAuthAsync(): RenownAuthAsync;
67
+ //#endregion
68
+ //#region src/renown/session.d.ts
69
+ declare function openRenown(documentId?: string): void;
70
+ declare function login(userDid: string | undefined, renown: IRenown | undefined): Promise<User | undefined>;
71
+ declare function logout(): Promise<void>;
72
+ //#endregion
73
+ //#region src/types/config.d.ts
74
+ type PHGlobalConfig = PHCommonGlobalConfig & PHAppConfig & PHDocumentEditorConfig & PHDrivesGlobalConfig & PHAnalyticsGlobalConfig & PHRelationalProcessorsGlobalConfig & PHProcessorsGlobalConfig & PHRenownGlobalConfig & PHSentryGlobalConfig;
75
+ type PHGlobalConfigKey = keyof PHGlobalConfig;
76
+ type PHGlobalConfigSetters = PHGlobalConfigSettersForKey<PHGlobalConfigKey>;
77
+ type PHGlobalConfigHooks = PHGlobalConfigHooksForKey<PHGlobalConfigKey>;
78
+ /**
79
+ * Editor configuration settings which are globally available to your custom apps.
80
+ *
81
+ * Setting these will override the defaults when your editor is mounted.
82
+ */
83
+ type PHAppConfig = {
84
+ /** Allows you to specify the document types that are allowed to be added to the drive.
85
+ * An empty array means that any document type is allowed.
86
+ */
87
+ allowedDocumentTypes?: string[]; /** Whether drag and drop is enabled for the app. */
88
+ isDragAndDropEnabled?: boolean;
89
+ };
90
+ type PHAppConfigKey = keyof PHAppConfig;
91
+ type PHAppConfigSetters = PHGlobalConfigSettersForKey<PHAppConfigKey>;
92
+ type PHAppConfigHooks = PHGlobalConfigHooksForKey<PHAppConfigKey>;
93
+ type PHDocumentEditorConfig = {
94
+ /** Whether external controls are enabled for the document editor. */isExternalControlsEnabled?: boolean;
95
+ };
96
+ type PHDocumentEditorConfigKey = keyof PHDocumentEditorConfig;
97
+ type PHDocumentEditorConfigSetters = PHGlobalConfigSettersForKey<PHDocumentEditorConfigKey>;
98
+ type PHDocumentEditorConfigHooks = PHGlobalConfigHooksForKey<PHDocumentEditorConfigKey>;
99
+ type PHCommonGlobalConfig = {
100
+ basePath?: string;
101
+ routerBasename?: string;
102
+ version?: string;
103
+ requiresHardRefresh?: boolean;
104
+ warnOutdatedApp?: boolean;
105
+ studioMode?: boolean;
106
+ versionCheckInterval?: number;
107
+ cliVersion?: string;
108
+ fileUploadOperationsChunkSize?: number;
109
+ gaTrackingId?: string;
110
+ isDocumentModelSelectionSettingsEnabled?: boolean;
111
+ isAddDriveEnabled?: boolean;
112
+ isPublicDrivesEnabled?: boolean;
113
+ isAddPublicDrivesEnabled?: boolean;
114
+ isDeletePublicDrivesEnabled?: boolean;
115
+ isCloudDrivesEnabled?: boolean;
116
+ isAddCloudDrivesEnabled?: boolean;
117
+ isDeleteCloudDrivesEnabled?: boolean;
118
+ isLocalDrivesEnabled?: boolean;
119
+ isAddLocalDrivesEnabled?: boolean;
120
+ isDeleteLocalDrivesEnabled?: boolean;
121
+ allowList?: string[];
122
+ analyticsDatabaseName?: string;
123
+ logLevel?: "debug" | "info" | "warn" | "error";
124
+ isEditorDebugModeEnabled?: boolean;
125
+ isEditorReadModeEnabled?: boolean;
126
+ disabledEditors?: string[];
127
+ enabledEditors?: string[];
128
+ };
129
+ type PHDrivesGlobalConfig = {
130
+ defaultDrivesUrl?: string;
131
+ drivesPreserveStrategy?: string;
132
+ };
133
+ type PHAnalyticsGlobalConfig = {
134
+ isAnalyticsEnabled?: boolean;
135
+ isAnalyticsDatabaseWorkerEnabled?: boolean;
136
+ isDiffAnalyticsEnabled?: boolean;
137
+ isDriveAnalyticsEnabled?: boolean;
138
+ isAnalyticsExternalProcessorsEnabled?: boolean;
139
+ };
140
+ type PHRelationalProcessorsGlobalConfig = {
141
+ isRelationalProcessorsEnabled?: boolean;
142
+ isExternalRelationalProcessorsEnabled?: boolean;
143
+ };
144
+ type PHProcessorsGlobalConfig = {
145
+ isExternalProcessorsEnabled?: boolean;
146
+ isExternalPackagesEnabled?: boolean;
147
+ };
148
+ type PHRenownGlobalConfig = {
149
+ renownUrl?: string;
150
+ renownNetworkId?: string;
151
+ renownChainId?: number;
152
+ switchboardUrl?: string;
153
+ renownAdapters?: PHConnectRenownAdapters;
154
+ };
155
+ type PHSentryGlobalConfig = {
156
+ sentryRelease?: string;
157
+ sentryDsn?: string;
158
+ sentryEnv?: string;
159
+ isSentryTracingEnabled?: boolean;
160
+ };
161
+ type PHGlobalConfigSettersForKey<T extends PHGlobalConfigKey> = { [K in T]: (value: PHGlobalConfig[K]) => void };
162
+ type PHGlobalConfigHooksForKey<TKey extends PHGlobalConfigKey> = { [K in TKey]: () => PHGlobalConfig[K] };
163
+ /** Helper type for ensuring keys are all present while still allowing them to be set */
164
+ type FullPHGlobalConfig = Record<PHGlobalConfigKey, PHGlobalConfig[PHGlobalConfigKey]>;
165
+ //#endregion
166
+ //#region src/types/modals.d.ts
167
+ type PHModal = {
168
+ type: "createDocument";
169
+ documentType: string;
170
+ } | {
171
+ type: "deleteItem";
172
+ id: string;
173
+ } | {
174
+ type: "addDrive";
175
+ } | {
176
+ type: "upgradeDrive";
177
+ driveId: string;
178
+ } | {
179
+ type: "deleteDrive";
180
+ driveId: string;
181
+ } | {
182
+ type: "driveSettings";
183
+ driveId: string;
184
+ } | {
185
+ type: "settings";
186
+ } | {
187
+ type: "clearStorage";
188
+ } | {
189
+ type: "debugSettings";
190
+ } | {
191
+ type: "disclaimer";
192
+ } | {
193
+ type: "cookiesPolicy";
194
+ } | {
195
+ type: "downloadDocumentWithErrors";
196
+ documentId: string;
197
+ } | {
198
+ type: "inspector";
199
+ } | {
200
+ type: "missingPackage";
201
+ documentType: string;
202
+ } | {
203
+ type: "driveAuthRequired";
204
+ } | {
205
+ type: "openFileDocuments";
206
+ } | {
207
+ type: "login";
208
+ };
209
+ //#endregion
210
+ //#region src/types/package-discovery.d.ts
211
+ type PendingInstallation = {
212
+ documentType: string;
213
+ packageNames: string[];
214
+ };
215
+ type FailedInstallationReason = "no-registry" | "not-in-registry" | "registry-error" | "install-failed" | "dismissed" | "offline";
216
+ type FailedInstallation = {
217
+ documentType: string;
218
+ reason: FailedInstallationReason;
219
+ packageNames: string[];
220
+ error: Error | null;
221
+ };
222
+ type DiscoveryEvent = {
223
+ type: "type-discovered";
224
+ documentType: string;
225
+ packageNames: string[];
226
+ } | {
227
+ type: "installation-prompted";
228
+ documentType: string;
229
+ packageNames: string[];
230
+ } | {
231
+ type: "installation-approved";
232
+ packageName: string;
233
+ documentTypes: string[];
234
+ } | {
235
+ type: "installation-dismissed";
236
+ packageName: string;
237
+ documentTypes: string[];
238
+ } | {
239
+ type: "installation-failed";
240
+ packageName: string;
241
+ error: Error;
242
+ } | {
243
+ type: "registry-query-failed";
244
+ documentType: string;
245
+ error: Error;
246
+ } | {
247
+ type: "load-failed";
248
+ documentType: string;
249
+ reason: FailedInstallationReason;
250
+ };
251
+ type DiscoveryEventListener = (event: DiscoveryEvent) => void;
252
+ interface IPackageDiscoveryService {
253
+ load(documentType: string): Promise<DocumentModelModule<any>>;
254
+ getPendingInstallations(): PendingInstallation[];
255
+ subscribePending(listener: () => void): () => void;
256
+ getFailedInstallations(): FailedInstallation[];
257
+ subscribeFailed(listener: () => void): () => void;
258
+ subscribeEvents(listener: DiscoveryEventListener): () => void;
259
+ approveInstallation(packageName: string): Promise<void>;
260
+ dismissInstallation(packageName: string): void;
261
+ promptInstallation(documentType: string): void;
262
+ retryInstallation(documentType: string): Promise<void>;
263
+ }
264
+ //#endregion
265
+ //#region src/types/timeline.d.ts
266
+ type TimelineBarItem = {
267
+ id: string;
268
+ type: "bar";
269
+ addSize?: 0 | 1 | 2 | 3 | 4;
270
+ delSize?: 0 | 1 | 2 | 3 | 4;
271
+ timestampUtcMs?: string;
272
+ additions?: number;
273
+ deletions?: number;
274
+ revision?: number;
275
+ startDate?: Date;
276
+ endDate?: Date;
277
+ };
278
+ type TimelineDividerItem = {
279
+ id: string;
280
+ type: "divider";
281
+ timestampUtcMs?: string;
282
+ title?: string;
283
+ subtitle?: string;
284
+ revision?: number;
285
+ startDate?: Date;
286
+ endDate?: Date;
287
+ };
288
+ type TimelineItem = TimelineBarItem | TimelineDividerItem;
289
+ //#endregion
290
+ //#region src/types/toast.d.ts
291
+ type PHToastType = "default" | "success" | "error" | "warning" | "info" | "connect-success" | "connect-warning" | "connect-loading" | "connect-deleted";
292
+ type PHToastOptions = {
293
+ type?: PHToastType;
294
+ autoClose?: number | false;
295
+ containerId?: string;
296
+ };
297
+ type PHToastFn = (content: ReactNode | string, options?: PHToastOptions) => void;
298
+ //#endregion
299
+ //#region src/types/vetra.d.ts
300
+ type IPackagesListener = (data: {
301
+ packages: DocumentModelLib[];
302
+ }) => void;
303
+ type IPackageListerUnsubscribe = () => void;
304
+ type PackageManagerInstallResult = {
305
+ type: "success";
306
+ package: DocumentModelLib;
307
+ } | {
308
+ type: "error";
309
+ error: Error;
310
+ };
311
+ interface IPackageManager extends IDocumentModelLoader {
312
+ registryUrl: string | null;
313
+ packages: DocumentModelLib[];
314
+ addPackage(packageName: string): Promise<PackageManagerInstallResult> | PackageManagerInstallResult;
315
+ addPackages(packageNames: string[]): Promise<PackageManagerInstallResult[]> | PackageManagerInstallResult[];
316
+ removePackage(name: string): void;
317
+ updateLocalPackage(pkg: DocumentModelLib, version?: string): void;
318
+ subscribe(handler: IPackagesListener): IPackageListerUnsubscribe;
319
+ getPackageSource: (packageName: string) => RegistryPackageSource | null;
320
+ getPackageVersion: (packageName: string) => string | undefined;
321
+ /**
322
+ * Registry-installed packages keyed by their storage name (the registry
323
+ * spec, e.g. "@powerhousedao/clint-common"). Used by callers that need to
324
+ * diff against an external source of truth such as the publish-reload
325
+ * channel's `/__packages` SSE feed.
326
+ */
327
+ getRegistryPackages: () => {
328
+ name: string;
329
+ version: string | undefined;
330
+ }[];
331
+ addLocalPackage: (name: string, loadedPackage: DocumentModelLib, version?: string) => void;
332
+ }
333
+ //#endregion
334
+ //#region src/hooks/node-drag-and-drop.d.ts
335
+ type DraggingNode = {
336
+ srcId: string;
337
+ parentId: string | null | undefined;
338
+ };
339
+ declare const addDraggingNodeEventHandler: () => void;
340
+ declare function useDragNode(args: {
341
+ srcId: string | undefined;
342
+ parentId: string | null | undefined;
343
+ }): {
344
+ isDragging: boolean;
345
+ draggable: boolean;
346
+ onDragStart: DragEventHandler;
347
+ onDragEnd: DragEventHandler;
348
+ };
349
+ declare function useDropNode(targetId: string | undefined): {
350
+ isDropTarget: boolean;
351
+ onDragEnter: DragEventHandler;
352
+ onDragOver: DragEventHandler;
353
+ onDragLeave: DragEventHandler;
354
+ onDrop: DragEventHandler;
355
+ };
356
+ //#endregion
357
+ //#region src/types/global.d.ts
358
+ interface BrowserReactorModule extends InProcessReactorModule {
359
+ pg: PGlite;
360
+ }
361
+ interface BrowserReactorClientModule extends InProcessReactorClientModule {
362
+ kind: "browser";
363
+ reactorModule: BrowserReactorModule | undefined;
364
+ }
365
+ type WorkerReactorModule = ReactorModule;
366
+ interface WorkerReactorClientModule extends ReactorClientModule {
367
+ kind: "worker";
368
+ reactorModule: WorkerReactorModule;
369
+ adminClient: IWorkerAdminClient;
370
+ inspector: IInspectorProxy;
371
+ }
372
+ type LOADING = null;
373
+ type PHGlobal = PHGlobalConfig & {
374
+ loading?: boolean;
375
+ reactorClientModule?: BrowserReactorClientModule | WorkerReactorClientModule;
376
+ reactorClient?: IReactorClient;
377
+ attachmentService?: IAttachmentService;
378
+ reactorGraphQLClient?: ReactorGraphQLClient | undefined;
379
+ renown?: IRenown | LOADING;
380
+ vetraPackageManager?: IPackageManager;
381
+ drives?: DocumentDriveDocument[];
382
+ documentCache?: IDocumentCache;
383
+ selectedDriveId?: string;
384
+ selectedNodeId?: string;
385
+ draggingNode?: DraggingNode;
386
+ modal?: PHModal;
387
+ selectedTimelineRevision?: string | number | null;
388
+ revisionHistoryVisible?: boolean;
389
+ selectedTimelineItem?: TimelineItem | null;
390
+ packageDiscoveryService?: IPackageDiscoveryService;
391
+ features?: Map<string, boolean>;
392
+ toast?: PHToastFn;
393
+ };
394
+ type PHGlobalKey = keyof PHGlobal;
395
+ type PHGlobalValue = PHGlobal[PHGlobalKey];
396
+ type UsePHGlobalValue<TValue extends PHGlobalValue> = () => TValue | undefined;
397
+ type SetPHGlobalValue<TValue extends PHGlobalValue> = (value: TValue | undefined) => void;
398
+ type AddPHGlobalEventHandler = () => void;
399
+ type PHGlobalEventHandlerAdders = Record<PHGlobalKey, AddPHGlobalEventHandler>;
400
+ type SetEvent<TKey extends PHGlobalKey> = CustomEvent<{ [key in TKey]: PHGlobal[TKey] | undefined }>;
401
+ declare global {
402
+ interface Window {
403
+ ph?: PHGlobal;
404
+ }
405
+ interface WindowEventMap extends GraphQLClientWindowEvents {}
406
+ } //# sourceMappingURL=global.d.ts.map
407
+ //#endregion
408
+ //#region src/hooks/renown.d.ts
409
+ /** Adds an event handler for the renown instance */
410
+ declare const addRenownEventHandler: () => void;
411
+ /** Returns the renown instance */
412
+ declare const useRenown: () => IRenown | LOADING | undefined;
413
+ /** Sets the renown instance */
414
+ declare const setRenown: (value: IRenown | LOADING | undefined) => void;
415
+ /** Returns the DID from the renown instance */
416
+ declare function useDid(): string | undefined;
417
+ /** Returns the current user from the renown instance, subscribing to user events */
418
+ declare function useUser(): User | undefined;
419
+ /** Returns the login status, subscribing to renown status events */
420
+ declare function useLoginStatus(): LoginStatus | "loading" | undefined;
421
+ //#endregion
422
+ //#region src/renown/components/RenownAuthButton.d.ts
423
+ interface RenownAuthButtonProps {
424
+ className?: string;
425
+ darkMode?: boolean;
426
+ loginContent?: ReactNode;
427
+ userContent?: ReactNode;
428
+ loadingContent?: ReactNode;
429
+ children?: (auth: RenownAuth) => ReactNode;
430
+ }
431
+ declare function RenownAuthButton({
432
+ className,
433
+ darkMode,
434
+ loginContent,
435
+ userContent,
436
+ loadingContent,
437
+ children
438
+ }: RenownAuthButtonProps): react_jsx_runtime0.JSX.Element;
439
+ //#endregion
440
+ //#region src/renown/components/RenownLoginButton.d.ts
441
+ interface RenownLoginButtonProps {
442
+ onLogin?: () => void;
443
+ darkMode?: boolean;
444
+ style?: CSSProperties;
445
+ className?: string;
446
+ asChild?: boolean;
447
+ children?: ReactNode;
448
+ }
449
+ declare function RenownLoginButton({
450
+ onLogin: onLoginProp,
451
+ style,
452
+ className,
453
+ asChild,
454
+ children
455
+ }: RenownLoginButtonProps): react_jsx_runtime0.JSX.Element;
456
+ //#endregion
457
+ //#region src/renown/components/RenownUserButton.d.ts
458
+ interface RenownUserButtonMenuItem {
459
+ label: string;
460
+ icon?: ReactNode;
461
+ onClick: () => void;
462
+ style?: CSSProperties;
463
+ }
464
+ interface RenownUserButtonProps {
465
+ address?: string;
466
+ username?: string;
467
+ avatarUrl?: string;
468
+ userId?: string;
469
+ onDisconnect?: () => void;
470
+ style?: CSSProperties;
471
+ className?: string;
472
+ asChild?: boolean;
473
+ children?: ReactNode;
474
+ menuItems?: RenownUserButtonMenuItem[];
475
+ }
476
+ declare function RenownUserButton({
477
+ address: addressProp,
478
+ username: usernameProp,
479
+ avatarUrl: avatarUrlProp,
480
+ userId: userIdProp,
481
+ onDisconnect: onDisconnectProp,
482
+ style,
483
+ className,
484
+ asChild,
485
+ children,
486
+ menuItems
487
+ }: RenownUserButtonProps): react_jsx_runtime0.JSX.Element;
488
+ //#endregion
489
+ //#region src/renown/components/icons.d.ts
490
+ interface IconProps {
491
+ size?: number;
492
+ width?: number;
493
+ height?: number;
494
+ color?: string;
495
+ style?: CSSProperties;
496
+ className?: string;
497
+ }
498
+ interface RenownLogoProps extends IconProps {
499
+ hovered?: boolean;
500
+ }
501
+ declare function RenownLogo({
502
+ width,
503
+ height,
504
+ hovered,
505
+ color,
506
+ className
507
+ }: RenownLogoProps): react_jsx_runtime0.JSX.Element;
508
+ declare function CopyIcon({
509
+ size,
510
+ color
511
+ }: IconProps): react_jsx_runtime0.JSX.Element;
512
+ declare function DisconnectIcon({
513
+ size,
514
+ color
515
+ }: IconProps): react_jsx_runtime0.JSX.Element;
516
+ declare function SpinnerIcon({
517
+ size,
518
+ color
519
+ }: IconProps): react_jsx_runtime0.JSX.Element;
520
+ declare function ChevronDownIcon({
521
+ size,
522
+ color,
523
+ style
524
+ }: IconProps): react_jsx_runtime0.JSX.Element;
525
+ declare function UserIcon({
526
+ size,
527
+ color
528
+ }: IconProps): react_jsx_runtime0.JSX.Element;
529
+ //#endregion
530
+ //#region src/renown/crypto.d.ts
531
+ /**
532
+ * @deprecated Use {@link initRenownCrypto} instead
533
+ *
534
+ * Initialize ConnectCrypto
535
+ * @returns ConnectCrypto instance
536
+ */
537
+ declare function initConnectCrypto(): Promise<_renown_sdk0.RenownCrypto>;
538
+ /**
539
+ * Initialize RenownCrypto
540
+ * @returns RenownCrypto instance
541
+ */
542
+ declare function initRenownCrypto(): Promise<_renown_sdk0.RenownCrypto>;
543
+ //#endregion
544
+ //#region src/renown/constants.d.ts
545
+ declare const RENOWN_URL = "https://www.renown.id";
546
+ declare const RENOWN_NETWORK_ID = "eip155";
547
+ declare const RENOWN_CHAIN_ID = "1";
548
+ //#endregion
549
+ //#region src/renown/initial-user.d.ts
550
+ interface RenownInitialUserProviderProps {
551
+ /** User resolved from a verified session cookie (see `verifyRenownSession`). */
552
+ initialUser?: User;
553
+ children: ReactNode;
554
+ }
555
+ declare function RenownInitialUserProvider({
556
+ initialUser,
557
+ children
558
+ }: RenownInitialUserProviderProps): react_jsx_runtime0.JSX.Element;
559
+ declare function useRenownInitialUser(): User | undefined;
560
+ //#endregion
561
+ //#region src/renown/use-renown-session-cookie.d.ts
562
+ interface RenownSessionCookieOptions {
563
+ /** Route handler that sets (POST) / clears (DELETE) the session cookie. */
564
+ endpoint?: string;
565
+ /** Bearer-token lifetime in seconds (default 7 days). */
566
+ expiresIn?: number;
567
+ /** When false the hook is inert (client-only apps with no server cookie). */
568
+ enabled?: boolean;
569
+ }
570
+ interface RenownSessionCookieState {
571
+ /** True once the cookie reflects the current authenticated user. */
572
+ synced: boolean;
573
+ }
574
+ declare function useRenownSessionCookie(options?: RenownSessionCookieOptions): RenownSessionCookieState;
575
+ declare function useRenownSessionSynced(): boolean;
576
+ //#endregion
577
+ //#region src/renown/use-renown-init.d.ts
578
+ interface RenownInitOptions {
579
+ appName: string;
580
+ /** Prefix for localStorage keys, so multiple apps can share a domain. */
581
+ namespace?: string;
582
+ url?: string;
583
+ switchboardUrl?: string;
584
+ /** Re-check the restored credential against the source (default "always"). */
585
+ revalidate?: "always" | "never";
586
+ }
587
+ /**
588
+ * Hook that initializes the Renown SDK.
589
+ * Call once at the top of your app. Options are read only on first mount.
590
+ * Returns a promise that resolves with the Renown instance.
591
+ *
592
+ * @example
593
+ * ```tsx
594
+ * function App() {
595
+ * const renownPromise = useRenownInit({ appName: "my-app" });
596
+ * return <MyApp />;
597
+ * }
598
+ * ```
599
+ */
600
+ declare function useRenownInit({
601
+ appName,
602
+ namespace,
603
+ url,
604
+ switchboardUrl,
605
+ revalidate
606
+ }: RenownInitOptions): Promise<IRenown>;
607
+ //#endregion
608
+ //#region src/renown/renown-init.d.ts
609
+ interface RenownProps extends RenownInitOptions {
610
+ onError?: (error: unknown) => void;
611
+ }
612
+ /**
613
+ * Side-effect component that initializes the Renown SDK.
614
+ * Renders nothing — place it alongside your app tree.
615
+ *
616
+ * @example
617
+ * ```tsx
618
+ * function App() {
619
+ * return (
620
+ * <>
621
+ * <Renown appName="my-app" onError={console.error} />
622
+ * <MyApp />
623
+ * </>
624
+ * );
625
+ * }
626
+ * ```
627
+ */
628
+ declare function Renown({
629
+ onError,
630
+ ...initOptions
631
+ }: RenownProps): null;
632
+ //#endregion
633
+ //#region src/renown/provider.d.ts
634
+ interface RenownProviderProps {
635
+ appName: string;
636
+ /** Prefix for localStorage keys, so multiple apps can share a domain. */
637
+ namespace?: string;
638
+ url?: string;
639
+ switchboardUrl?: string;
640
+ /** Wallet adapters for in-page sign-in; omit for redirect-only. */
641
+ adapters?: WalletAdaptersConfig;
642
+ theme?: WalletTheme;
643
+ /** Re-check the restored credential against the source (default "always"). */
644
+ revalidate?: "always" | "never";
645
+ /** Server-resolved session (SSR); its presence seeds from the cookie + enables cookie sync. Omit for client-only (seed = localStorage). */
646
+ session?: {
647
+ user?: User;
648
+ } | null;
649
+ /** Endpoint for the session-cookie sync (SSR). Default /api/renown/session. */
650
+ sessionEndpoint?: string;
651
+ onError?: (error: unknown) => void;
652
+ children: ReactNode;
653
+ }
654
+ declare function RenownProvider({
655
+ appName,
656
+ namespace,
657
+ url,
658
+ switchboardUrl,
659
+ adapters,
660
+ theme,
661
+ revalidate,
662
+ session,
663
+ sessionEndpoint,
664
+ onError,
665
+ children
666
+ }: RenownProviderProps): react_jsx_runtime0.JSX.Element;
667
+ //#endregion
668
+ //#region src/renown/wallet-provider.d.ts
669
+ interface RenownWalletProviderProps {
670
+ /** Per-adapter wallet config (e.g. `connect.renown.adapters`); a key's presence enables that adapter. Libraries load lazily on first login; `undefined`/empty = redirect-only. */
671
+ adapters: WalletAdaptersConfig | undefined;
672
+ /** Theme handed to each adapter UI: `"light"`, `"dark"`, or `{ mode, accentColor?, accentColorForeground? }`. */
673
+ theme?: WalletTheme;
674
+ children: ReactNode;
675
+ }
676
+ /** Drop-in provider for Renown in-page wallet sign-in: registers the login activator, lazy-mounts the configured adapters on first click, and merges their controllers for {@link useRenownAuth}. Full walkthrough + examples: the `@powerhousedao/reactor-browser` README ("Renown in-page sign-in") and the Academy Renown authentication guide. Pair with {@link useRenownLoginMethods} to build the login UI. */
677
+ declare function RenownWalletProvider({
678
+ adapters: adaptersConfig,
679
+ theme,
680
+ children
681
+ }: RenownWalletProviderProps): react_jsx_runtime0.JSX.Element;
682
+ //#endregion
683
+ //#region src/renown/login-methods.d.ts
684
+ interface RenownLoginMethod {
685
+ id: LoginMethod;
686
+ label: string;
687
+ }
688
+ /** Derive the offered login methods (wallet + Privy's methods) from an adapters config, for building a login UI. Reads config only — no wallet libraries load. Wire each to `useRenownAuth().login(undefined, id)`. Labels are overridable. See the reactor-browser README + Academy Renown auth guide. */
689
+ declare function useRenownLoginMethods(adapters: WalletAdaptersConfig | undefined, labels?: Partial<Record<LoginMethod, string>>): RenownLoginMethod[];
690
+ //#endregion
691
+ export { PHGlobalEventHandlerAdders as $, RenownAuth as $t, CopyIcon as A, PHAppConfig as At, RenownAuthButton as B, PHGlobalConfig as Bt, RENOWN_CHAIN_ID as C, FailedInstallation as Ct, initConnectCrypto as D, PHModal as Dt, VERIFIABLE_CREDENTIAL_EIP712_TYPE as E, PendingInstallation as Et, RenownUserButton as F, PHDocumentEditorConfig as Ft, useLoginStatus as G, PHGlobalConfigSettersForKey as Gt, addRenownEventHandler as H, PHGlobalConfigHooksForKey as Ht, RenownUserButtonMenuItem as I, PHDocumentEditorConfigHooks as It, AddPHGlobalEventHandler as J, PHRenownGlobalConfig as Jt, useRenown as K, PHProcessorsGlobalConfig as Kt, RenownUserButtonProps as L, PHDocumentEditorConfigKey as Lt, RenownLogo as M, PHAppConfigKey as Mt, SpinnerIcon as N, PHAppConfigSetters as Nt, initRenownCrypto as O, FullPHGlobalConfig as Ot, UserIcon as P, PHCommonGlobalConfig as Pt, PHGlobal as Q, openRenown as Qt, RenownLoginButton as R, PHDocumentEditorConfigSetters as Rt, ISSUER_TYPE as S, DiscoveryEventListener as St, RENOWN_URL as T, IPackageDiscoveryService as Tt, setRenown as U, PHGlobalConfigKey as Ut, RenownAuthButtonProps as V, PHGlobalConfigHooks as Vt, useDid as W, PHGlobalConfigSetters as Wt, BrowserReactorModule as X, login as Xt, BrowserReactorClientModule as Y, PHSentryGlobalConfig as Yt, LOADING as Z, logout as Zt, useRenownInitialUser as _, PHToastType as _t, RenownProvider as a, DocumentDispatch as an, WorkerReactorClientModule as at, CREDENTIAL_TYPES as b, TimelineItem as bt, RenownProps as c, PromiseState as cn, addDraggingNodeEventHandler as ct, RenownSessionCookieOptions as d, IPackageListerUnsubscribe as dt, RenownAuthAsync as en, PHGlobalKey as et, RenownSessionCookieState as f, IPackageManager as ft, RenownInitialUserProviderProps as g, PHToastOptions as gt, RenownInitialUserProvider as h, PHToastFn as ht, RenownWalletProviderProps as i, useRenownAuthAsync as in, UsePHGlobalValue as it, DisconnectIcon as j, PHAppConfigHooks as jt, ChevronDownIcon as k, PHAnalyticsGlobalConfig as kt, RenownInitOptions as l, PromiseWithState as ln, useDragNode as lt, useRenownSessionSynced as m, PackageManagerInstallResult as mt, useRenownLoginMethods as n, RenownAuthStatus as nn, SetEvent as nt, RenownProviderProps as o, FulfilledPromise as on, WorkerReactorModule as ot, useRenownSessionCookie as p, IPackagesListener as pt, useUser as q, PHRelationalProcessorsGlobalConfig as qt, RenownWalletProvider as r, useRenownAuth as rn, SetPHGlobalValue as rt, Renown as s, IDocumentCache as sn, DraggingNode as st, RenownLoginMethod as t, RenownAuthResolution as tn, PHGlobalValue as tt, useRenownInit as u, RejectedPromise as un, useDropNode as ut, CREDENTIAL_SCHEMA_EIP712_TYPE as v, TimelineBarItem as vt, RENOWN_NETWORK_ID as w, FailedInstallationReason as wt, DOMAIN_TYPE as x, DiscoveryEvent as xt, CREDENTIAL_SUBJECT_TYPE as y, TimelineDividerItem as yt, RenownLoginButtonProps as z, PHDrivesGlobalConfig as zt };
692
+ //# sourceMappingURL=index-Cj_YGHcz.d.ts.map