@capxul/sdk-react 0.0.0-rc-2cdddbb91

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.
@@ -0,0 +1,1167 @@
1
+ import { A as TransitionListener, C as CreateOrganizationFailure, D as OrganizationDetails, E as InvocationOptions, O as ProfileDetails, S as CapxulSend, T as Destination, _ as ReadyDestination, a as ActionResult, b as Slot, c as CapxulAuthenticationController, d as NavigationAction, f as OrgFailure, g as ProfileSlotProps, h as PendingAuthState, i as AccountProgress, k as SendResult, l as ControllerAction, m as OtpPendingState, n as OnboardingControllerProps, o as AuthenticatedState, p as OrgProgress, r as AccountFailure, s as AuthenticationSlots, t as CapxulOnboardingController, u as FaultedState, v as RetryAction, w as CreateOrganizationSubmission, x as CapxulAuth, y as SignedOutState } from "./onboarding-controller-DrJiYWfY.mjs";
2
+ import * as React from "react";
3
+ import { ReactNode, RefCallback } from "react";
4
+ import { QueryClient, UseMutationResult, UseQueryResult } from "@tanstack/react-query";
5
+ import { Account, AccountRequirement, ActivityAnnotation, ActivityAnnotationInput, ActivityDetail, ActivityItem, ActivityKind, ActivityListParams, ActivityPage, ActivityPhase, ActivityRange, ActivityReference, ActivitySummaryTotal, ActorReference, AddressBookEntry, AssetAmount, AssetId, BudgetId, CapxulClient, CapxulError, CapxulResult, CapxulSigner, CurrentHoldings, HostObservability, IdentityDestination, IdentityState, IdentityTransition, MemberView, Money, MoneyParseErrorReason, OrgId, OrganizationAccess, OrganizationOnboarding, OrganizationOnboardingInput, OrganizationPaymentBatchInput, OrganizationPaymentInput, Page, PartyId, Payment, PaymentDirection, PaymentDocumentDownload, PaymentDocumentReadRef, PaymentDocumentRef, PaymentDocumentRender, PaymentStatus, PaymentType, PaymentsPayInput, PayrollGroupId, PayrollGroupInput, PayrollRunId, PayrollRunStatus, Permission, PermissionMethods, PermissionReadResult, Profile, RoleView, StateLabel, SubmittedPermissionExecution, isClaimed, isRestoring } from "@capxul/sdk";
6
+ //#region src/platform/provider.d.ts
7
+ type CapxulProviderSharedProps = {
8
+ /** Bring your own QueryClient; otherwise the provider creates one. */
9
+ readonly queryClient?: QueryClient;
10
+ readonly children: ReactNode;
11
+ };
12
+ /** Browser / app path — the provider bootstraps the client from a publishable key. */
13
+ type CapxulProviderPublishableKeyProps = CapxulProviderSharedProps & {
14
+ readonly publishableKey: string;
15
+ readonly client?: never;
16
+ /** One host-owned product/failure observability module. */
17
+ readonly observability?: HostObservability;
18
+ /** Init-time account readiness target. Default `"none"`. */
19
+ readonly requirement?: AccountRequirement;
20
+ /**
21
+ * Optional consumer-held signer for the deploy lane. Omitted in browser apps
22
+ * with `requirement: "deployed"` — the SDK wires Openfort from bootstrap.
23
+ */
24
+ readonly signer?: CapxulSigner;
25
+ /**
26
+ * Where the bootstrap call goes. Default: the page's own origin, which a
27
+ * host app proxies to Capxul. Set it to the Capxul Site URL to call the
28
+ * backend directly and skip the host's proxy hop; the backend answers the
29
+ * route cross-origin for the publishable key's allowed origins.
30
+ */
31
+ readonly bootstrapBaseUrl?: string;
32
+ /**
33
+ * AUTH A3. Pass `"explicit"` on `/connect` so restore and OTP do not write
34
+ * Profile, Account, or invitations. Default automatic.
35
+ */
36
+ readonly accountSetup?: "automatic" | "explicit";
37
+ };
38
+ /**
39
+ * Node / server / test path — a pre-built client is supplied; lifecycle stays
40
+ * with the caller. Mutually exclusive with `publishableKey`.
41
+ */
42
+ type CapxulProviderInjectedClientProps = CapxulProviderSharedProps & {
43
+ readonly client: CapxulClient;
44
+ readonly publishableKey?: never;
45
+ /** Injected clients must be created with observability at their owning factory. */
46
+ readonly observability?: never;
47
+ readonly requirement?: never;
48
+ readonly signer?: never;
49
+ readonly bootstrapBaseUrl?: never;
50
+ };
51
+ type CapxulProviderProps = CapxulProviderPublishableKeyProps | CapxulProviderInjectedClientProps;
52
+ export declare function CapxulProvider(props: CapxulProviderProps): React.JSX.Element;
53
+ //#endregion
54
+ //#region src/platform/bootstrap-context.d.ts
55
+ type CapxulBootstrapStatus = "bootstrapping" | "ready" | "error";
56
+ interface CapxulBootstrapState {
57
+ readonly status: CapxulBootstrapStatus;
58
+ readonly error: CapxulError | null;
59
+ readonly retry: () => void;
60
+ }
61
+ export declare function useCapxul(): CapxulBootstrapState;
62
+ //#endregion
63
+ //#region src/platform/client-context.d.ts
64
+ /**
65
+ * Returns the client, or `null` while `<CapxulProvider>` is still bootstrapping.
66
+ * Data hooks use this so they can sit in `isPending` (disabled query) until the
67
+ * client resolves, rather than throwing during bootstrap.
68
+ */
69
+ export declare function useCapxulClientOrNull(): CapxulClient | null;
70
+ //#endregion
71
+ //#region src/platform/identity.d.ts
72
+ export declare function useCapxulIdentity(): IdentityState;
73
+ export declare function useCapxulSend(): CapxulSend;
74
+ export declare function useCapxulAuth(): CapxulAuth;
75
+ export declare function useCapxulDestination(): Destination | null;
76
+ export declare function useCapxulTransitions(listener: TransitionListener): void;
77
+ export declare const entered: (record: IdentityTransition, target: StateLabel) => boolean;
78
+ //#endregion
79
+ //#region src/access/use-client-connection.d.ts
80
+ interface OtpSlice {
81
+ readonly email: string;
82
+ readonly pending: boolean;
83
+ readonly canResend: boolean;
84
+ readonly verifyCode: (code: string) => Promise<void>;
85
+ readonly resend: () => Promise<void>;
86
+ }
87
+ interface ConsentSlice {
88
+ readonly verifiedEmail: string;
89
+ readonly clientLabel: string;
90
+ readonly scopeCodes: readonly string[];
91
+ readonly purpose: "login" | "signup";
92
+ readonly setupState: "not_required" | "new" | "resumable";
93
+ readonly pending: boolean;
94
+ readonly accept: () => Promise<void>;
95
+ readonly cancel: () => Promise<void>;
96
+ }
97
+ interface CompleteSlice {
98
+ readonly outcome: "connected";
99
+ }
100
+ interface FailureSlice {
101
+ readonly code: string;
102
+ readonly field?: string;
103
+ readonly retry: () => Promise<void>;
104
+ readonly cancel: () => Promise<void>;
105
+ }
106
+ //#endregion
107
+ //#region src/access/client-connection.d.ts
108
+ interface CapxulClientConnectionProps {
109
+ readonly client: CapxulClient;
110
+ readonly requestId: string;
111
+ readonly children: ReactNode;
112
+ }
113
+ declare function Root$7({ client, requestId, children }: CapxulClientConnectionProps): import("react").JSX.Element;
114
+ declare function Checking$1({ children }: {
115
+ readonly children: ReactNode;
116
+ }): import("react").JSX.Element | null;
117
+ declare function Otp({ children }: {
118
+ readonly children: (slice: OtpSlice) => ReactNode;
119
+ }): import("react").JSX.Element | null;
120
+ declare function Consent({ children }: {
121
+ readonly children: (slice: ConsentSlice) => ReactNode;
122
+ }): import("react").JSX.Element | null;
123
+ declare function Complete({ children }: {
124
+ readonly children: (slice: CompleteSlice) => ReactNode;
125
+ }): import("react").JSX.Element | null;
126
+ declare function Failure({ children }: {
127
+ readonly children: (slice: FailureSlice) => ReactNode;
128
+ }): import("react").JSX.Element | null;
129
+ export declare const CapxulClientConnection: typeof Root$7 & {
130
+ Checking: typeof Checking$1;
131
+ Otp: typeof Otp;
132
+ Consent: typeof Consent;
133
+ Complete: typeof Complete;
134
+ Failure: typeof Failure;
135
+ };
136
+ //#endregion
137
+ //#region src/access/dashboard-access.d.ts
138
+ type DashboardScope = {
139
+ readonly kind: "personal";
140
+ } | {
141
+ readonly kind: "organization";
142
+ readonly orgId?: string;
143
+ };
144
+ type DashboardAccessPhase = "checking" | "error" | "redirect" | "granted";
145
+ /**
146
+ * Which probe produced the error the screen is showing. The
147
+ * error code alone cannot say: a provider failure reads the same whether the
148
+ * session read, the membership list or the lifecycle read raised it, and a
149
+ * consumer that reports a displayed gate error has to keep those apart
150
+ * (#1963 R05-2). It names the SOURCE only; `retry` still re-runs every failed
151
+ * probe, exactly as before.
152
+ */
153
+ type DashboardAccessProbe = "session" | "membership" | "lifecycle" | "authority";
154
+ interface DashboardAccessErrorSlice {
155
+ readonly error: CapxulError;
156
+ /** The probe the surfaced error came from, in the frozen precedence order. */
157
+ readonly probe: DashboardAccessProbe;
158
+ /** Re-runs each failed probe. */
159
+ readonly retry: () => void;
160
+ }
161
+ interface DashboardAccessRedirectSlice {
162
+ readonly destination: IdentityDestination;
163
+ }
164
+ interface CapxulDashboardAccessProps {
165
+ readonly scope: DashboardScope;
166
+ readonly children: ReactNode;
167
+ }
168
+ declare function Root$6({ scope, children }: CapxulDashboardAccessProps): import("react").JSX.Element;
169
+ /** Hands nothing — today's app renders `null` here, exactly as it does now. */
170
+ declare function Checking({ children }: {
171
+ readonly children?: ReactNode;
172
+ }): import("react").JSX.Element | null;
173
+ declare function DashboardError({ children }: {
174
+ readonly children: (slice: DashboardAccessErrorSlice) => ReactNode;
175
+ }): import("react").JSX.Element | null;
176
+ /**
177
+ * Hands the destination and draws nothing. Reaching this part is a REQUEST to
178
+ * navigate, never an arrival: the app may cancel or supersede it, so nothing
179
+ * here — and nothing a consumer hangs off it — may claim a completed redirect
180
+ * (#1963 R05-1). The destination page's own normalized pageview proves arrival.
181
+ */
182
+ declare function Redirect({ children }: {
183
+ readonly children: (slice: DashboardAccessRedirectSlice) => ReactNode;
184
+ }): import("react").JSX.Element | null;
185
+ declare function Granted({ children }: {
186
+ readonly children?: ReactNode;
187
+ }): import("react").JSX.Element | null;
188
+ /** The compound shape the app's own design system already uses (`StatusTabs`). */
189
+ export declare const CapxulDashboardAccess: typeof Root$6 & {
190
+ Checking: typeof Checking;
191
+ Error: typeof DashboardError;
192
+ Redirect: typeof Redirect;
193
+ Granted: typeof Granted;
194
+ };
195
+ //#endregion
196
+ //#region src/profiles/journey-state.d.ts
197
+ type OnboardingIntent = "personal" | "organization";
198
+ type OnboardingStep = "profile" | "organization" | "provisioning";
199
+ type PayoutDraftChain = "evm" | "solana" | "starknet";
200
+ type PayoutDraftEntry = {
201
+ readonly chain: PayoutDraftChain;
202
+ readonly address: string;
203
+ };
204
+ type ProfileDraft = {
205
+ readonly displayName: string;
206
+ readonly country: string;
207
+ readonly withdrawalAddress: string;
208
+ readonly handle?: string;
209
+ readonly payoutAddresses?: readonly PayoutDraftEntry[];
210
+ readonly imageStorageId?: string;
211
+ };
212
+ type OrganizationDraft = {
213
+ readonly name: string;
214
+ readonly handle: string;
215
+ readonly country: string;
216
+ readonly bio?: string;
217
+ readonly size?: string;
218
+ readonly logoStorageId?: string;
219
+ };
220
+ type OnboardingOrigin = {
221
+ readonly kind: "personal";
222
+ } | {
223
+ readonly kind: "organization";
224
+ readonly organizationId: string;
225
+ } | {
226
+ readonly kind: "verification";
227
+ readonly organizationId?: string;
228
+ };
229
+ type OnboardingJourney = {
230
+ readonly version: 1;
231
+ readonly ownerId: string;
232
+ readonly journeyId: string;
233
+ readonly intent: OnboardingIntent;
234
+ readonly entryPoint: "signup" | "dashboard";
235
+ readonly origin?: OnboardingOrigin;
236
+ readonly step: OnboardingStep;
237
+ readonly profile?: ProfileDraft;
238
+ readonly organization?: OrganizationDraft;
239
+ readonly stableHandle?: string;
240
+ readonly organizationId?: string;
241
+ /** #1955: what the organization submit sent, kept for resume. */
242
+ readonly submission?: CreateOrganizationSubmission;
243
+ };
244
+ /**
245
+ * The app-facing projection input: where a resumed journey stands. Consumers
246
+ * map this to their own routes.
247
+ */
248
+ type OnboardingJourneyPosition = {
249
+ readonly intent: OnboardingIntent;
250
+ readonly step: OnboardingStep;
251
+ readonly organizationId?: string;
252
+ readonly verification: boolean;
253
+ };
254
+ export declare function startOnboardingJourney(input: {
255
+ readonly intent: OnboardingIntent;
256
+ readonly ownerId: string;
257
+ readonly entryPoint: "signup" | "dashboard";
258
+ readonly origin?: OnboardingOrigin;
259
+ readonly step?: OnboardingStep;
260
+ }): OnboardingJourney;
261
+ export declare function loadOnboardingJourney(expectedOwnerId?: string): OnboardingJourney | null;
262
+ export declare function saveOnboardingJourney(journey: OnboardingJourney): void;
263
+ export declare function currentOnboardingJourneyId(): string | undefined;
264
+ /** Stop observation attribution while no authenticated owner is established. */
265
+ export declare function invalidateOnboardingJourneyObservation(): void;
266
+ /** Where the journey stands — the pure position apps map to their routes. */
267
+ export declare function onboardingJourneyPosition(journey: OnboardingJourney): OnboardingJourneyPosition;
268
+ /**
269
+ * The interruption-recovery decision (behavior map §4): a journey that does
270
+ * not match the ready destination the app just rendered must resume; a
271
+ * matching one needs no recovery. Returns the journey to resume, or null.
272
+ */
273
+ export declare function activeOnboardingRecovery(ownerId: string, renderedReadyDestination?: {
274
+ readonly kind: "personal";
275
+ } | {
276
+ readonly kind: "organization";
277
+ readonly organizationId: string;
278
+ }): OnboardingJourney | null;
279
+ export declare function acknowledgeOnboardingDestination(destination: {
280
+ readonly kind: "personal";
281
+ } | {
282
+ readonly kind: "organization";
283
+ readonly organizationId: string;
284
+ }, ownerId: string): boolean;
285
+ export declare function clearOnboardingJourney(): void;
286
+ //#endregion
287
+ //#region src/profiles/use-capxul-handle-availability.d.ts
288
+ type HandleAvailability = {
289
+ readonly available: boolean;
290
+ readonly normalized: string;
291
+ };
292
+ type UseCapxulHandleAvailabilityReturn = UseQueryResult<HandleAvailability, CapxulError>;
293
+ /**
294
+ * #1062: debounced availability probe for the handle the user is typing.
295
+ * Disabled until the candidate reaches the 3-character floor; a malformed or
296
+ * reserved candidate surfaces as the query's error (INVALID_INPUT with the
297
+ * boundary's message), not as `available: false` — only a handle someone
298
+ * else owns is "taken".
299
+ */
300
+ export declare function useCapxulHandleAvailability(handle: string, options?: {
301
+ readonly enabled?: boolean;
302
+ readonly debounceMs?: number;
303
+ }): UseCapxulHandleAvailabilityReturn;
304
+ //#endregion
305
+ //#region src/profiles/use-capxul-profile.d.ts
306
+ type UseCapxulProfileReturn = UseQueryResult<Profile | null, CapxulError>;
307
+ export declare function useCapxulProfile(): UseCapxulProfileReturn;
308
+ //#endregion
309
+ //#region src/accounts/use-capxul-account-balance.d.ts
310
+ type UseCapxulAccountBalanceReturn = UseQueryResult<Account, CapxulError>;
311
+ type UseCapxulAccountBalanceOptions = {
312
+ /** When false, skips the Convex readBalance action until the account ladder is ready. */
313
+ readonly enabled?: boolean;
314
+ };
315
+ export declare function useCapxulAccountBalance(options?: UseCapxulAccountBalanceOptions): UseCapxulAccountBalanceReturn;
316
+ //#endregion
317
+ //#region src/accounts/use-capxul-account-fund.d.ts
318
+ type UseCapxulAccountFundReturn = UseMutationResult<{
319
+ readonly txHash: string;
320
+ }, CapxulError, AssetAmount>;
321
+ export declare function useCapxulAccountFund(): UseCapxulAccountFundReturn;
322
+ //#endregion
323
+ //#region src/accounts/use-capxul-holdings.d.ts
324
+ interface UseCapxulHoldingsParams {
325
+ /** Omitted = the signed-in person. SDK core already accepts one. */
326
+ readonly actor?: ActorReference;
327
+ }
328
+ export declare function useCapxulHoldings(params?: UseCapxulHoldingsParams): UseQueryResult<CurrentHoldings, CapxulError>;
329
+ //#endregion
330
+ //#region src/payments/use-recipient-resolution.d.ts
331
+ type SendMoneyRecipientStatus = "empty" | "invalid" | "checking" | "known-party" | "new-email" | "external-warning" | "external-ready" | "not-found" | "failed";
332
+ interface SendMoneyRecipientSlice {
333
+ readonly value: string;
334
+ readonly change: (text: string) => void;
335
+ readonly status: SendMoneyRecipientStatus;
336
+ readonly label: string | null;
337
+ readonly kind: "person" | "organization" | "external_address" | "unresolved" | null;
338
+ readonly isCapxulAccount: boolean | null;
339
+ readonly publicValue: string | null;
340
+ readonly requiresAcknowledgement: boolean;
341
+ readonly acknowledgeExternalAddress: () => void;
342
+ }
343
+ //#endregion
344
+ //#region src/payments/send-money-slices.d.ts
345
+ type SendActor = {
346
+ readonly kind: "personal";
347
+ } | {
348
+ readonly kind: "organization";
349
+ readonly orgId: OrgId | undefined;
350
+ };
351
+ type SentPayment = {
352
+ /** The backend payment row. */
353
+ readonly payment: Payment;
354
+ /** What we parsed and sent — `.value` is the comma-stripped major-unit string. */
355
+ readonly amount: AssetAmount;
356
+ /** The trimmed text the person typed — the app's success toast interpolates it. */
357
+ readonly recipient: string;
358
+ };
359
+ /**
360
+ * Refusal CODES, never sentences (#1447 ruling 8). The app maps each code to
361
+ * the words it already prints; no English refusal string ships from here.
362
+ */
363
+ type CapxulSendMoneyBlockedReason = "signer-not-ready" | "amount-invalid" | "recipient-unresolved" | "no-source" | "no-asset" | "asset-unnamed";
364
+ /**
365
+ * One Budget the member can spend from — the id the payment carries, and
366
+ * nothing else.
367
+ *
368
+ * THE CONTRACT (amended 3) reverses amendment 7: the From row keeps the app's
369
+ * frozen `"<Org> Treasury"` string, and no budget label and no limit display
370
+ * cross this seam until the budgets build ships a remaining figure that is
371
+ * actually computable (ADR-0024 R3). The app already holds the org name and
372
+ * already builds that sentence today, so the option carries only what the app
373
+ * cannot know — which Budget the send is drawn from.
374
+ */
375
+ interface SendMoneySourceOption {
376
+ readonly id: BudgetId;
377
+ }
378
+ /** ADR-0023 R1: a code, never a sentence — the app owns the words. */
379
+ type SendMoneySourceError = "read-failed";
380
+ interface SendMoneySourceSlice {
381
+ readonly options: ReadonlyArray<SendMoneySourceOption>;
382
+ readonly selected: SendMoneySourceOption | null;
383
+ readonly select: (id: string) => void;
384
+ readonly error: SendMoneySourceError | null;
385
+ readonly isPending: boolean;
386
+ }
387
+ interface SendMoneyAssetOption {
388
+ readonly id: AssetId;
389
+ readonly symbol: string;
390
+ readonly availableDisplay: string;
391
+ }
392
+ /** ADR-0023 R1: a code, never a sentence — the app owns the words. */
393
+ type SendMoneyAssetError = "read-failed";
394
+ interface SendMoneyAssetSlice {
395
+ readonly options: ReadonlyArray<SendMoneyAssetOption>;
396
+ readonly selected: SendMoneyAssetOption | null;
397
+ readonly select: (id: string) => void;
398
+ readonly error: SendMoneyAssetError | null;
399
+ readonly isPending: boolean;
400
+ }
401
+ interface SendMoneyAmountSlice {
402
+ readonly value: string;
403
+ readonly change: (text: string) => void;
404
+ /** ADR-0023 R1: the parse verdict as a closed code; the app maps it to copy. */
405
+ readonly error: MoneyParseErrorReason | null;
406
+ readonly availableDisplay: string | null;
407
+ }
408
+ interface SendMoneyActionsSlice {
409
+ readonly submit: () => void;
410
+ readonly isSubmitting: boolean;
411
+ readonly blocked: boolean;
412
+ readonly blockedReason: CapxulSendMoneyBlockedReason | null;
413
+ }
414
+ //#endregion
415
+ //#region src/payments/send-money.d.ts
416
+ interface CapxulSendMoneyProps {
417
+ readonly actor: SendActor;
418
+ readonly onSent: (sent: SentPayment) => void;
419
+ /** ADR-0023 R1: the app maps `error.code` to its own copy; no SDK sentence. */
420
+ readonly onFailed: (error: CapxulError) => void;
421
+ readonly children: ReactNode;
422
+ }
423
+ declare function Root$5({ actor, onSent, onFailed, children }: CapxulSendMoneyProps): import("react").JSX.Element;
424
+ declare function Source({ children }: {
425
+ readonly children: (slice: SendMoneySourceSlice) => ReactNode;
426
+ }): import("react").JSX.Element;
427
+ declare function Asset$1({ children }: {
428
+ readonly children: (slice: SendMoneyAssetSlice) => ReactNode;
429
+ }): import("react").JSX.Element;
430
+ declare function Amount({ children }: {
431
+ readonly children: (slice: SendMoneyAmountSlice) => ReactNode;
432
+ }): import("react").JSX.Element;
433
+ declare function Recipient({ children }: {
434
+ readonly children: (slice: SendMoneyRecipientSlice) => ReactNode;
435
+ }): import("react").JSX.Element;
436
+ declare function Actions$1({ children }: {
437
+ readonly children: (slice: SendMoneyActionsSlice) => ReactNode;
438
+ }): import("react").JSX.Element;
439
+ /** The compound shape the app's own design system already uses (`StatusTabs`). */
440
+ export declare const CapxulSendMoney: typeof Root$5 & {
441
+ Source: typeof Source;
442
+ Asset: typeof Asset$1;
443
+ Amount: typeof Amount;
444
+ Recipient: typeof Recipient;
445
+ Actions: typeof Actions$1;
446
+ };
447
+ //#endregion
448
+ //#region src/payments/use-capxul-money.d.ts
449
+ type CapxulPayIntent = PaymentsPayInput;
450
+ type UseCapxulPayReturn = UseMutationResult<Payment, CapxulError, CapxulPayIntent>;
451
+ export declare function useCapxulPay(): UseCapxulPayReturn;
452
+ type UseCapxulPaymentsReturn = UseQueryResult<Page<Payment>, CapxulError>;
453
+ export declare function useCapxulPayments(options?: {
454
+ readonly enabled?: boolean;
455
+ }): UseCapxulPaymentsReturn;
456
+ type UseCapxulPaymentReturn = UseQueryResult<Payment | null, CapxulError>;
457
+ export declare function useCapxulPayment(paymentId: string | undefined, options?: {
458
+ readonly enabled?: boolean;
459
+ }): UseCapxulPaymentReturn;
460
+ //#endregion
461
+ //#region src/payments/use-capxul-organization-payments.d.ts
462
+ /**
463
+ * `orgId` may be absent because a screen has no branded org id until its org
464
+ * context loads (`OrgView.id` is the branded one). An absent id refuses the
465
+ * mutation the way every other org read refuses one, rather than forcing a
466
+ * `as OrgId` cast at the call site.
467
+ */
468
+ export declare function useCapxulOrganizationPay(orgId: OrgId | undefined): UseMutationResult<Payment, CapxulError, OrganizationPaymentInput>;
469
+ export declare function useCapxulOrganizationPayBatch(orgId: OrgId): UseMutationResult<readonly Payment[], CapxulError, OrganizationPaymentBatchInput>;
470
+ //#endregion
471
+ //#region src/permissions/use-capxul-permissions.d.ts
472
+ type Operation = "create" | "change" | "assign" | "revoke" | "replace";
473
+ type Input<K extends Operation> = Parameters<PermissionMethods[K]>[0];
474
+ export declare const useCapxulPermissionCreate: (orgId: OrgId) => UseMutationResult<SubmittedPermissionExecution, CapxulError, Input<"create">>;
475
+ export declare const useCapxulPermissionChange: (orgId: OrgId) => UseMutationResult<SubmittedPermissionExecution, CapxulError, Input<"change">>;
476
+ export declare const useCapxulPermissionAssign: (orgId: OrgId) => UseMutationResult<SubmittedPermissionExecution, CapxulError, Input<"assign">>;
477
+ export declare const useCapxulPermissionRevoke: (orgId: OrgId) => UseMutationResult<SubmittedPermissionExecution, CapxulError, Input<"revoke">>;
478
+ export declare const useCapxulPermissionReplace: (orgId: OrgId) => UseMutationResult<SubmittedPermissionExecution, CapxulError, Input<"replace">>;
479
+ export declare function useCapxulPermissions(orgId: OrgId, options?: {
480
+ readonly enabled?: boolean;
481
+ }): UseQueryResult<PermissionReadResult, CapxulError>;
482
+ export declare function useCapxulPermission(orgId: OrgId, permissionId: string | undefined): UseQueryResult<Permission | null, CapxulError>;
483
+ //#endregion
484
+ //#region src/activity/activity-slices.d.ts
485
+ /** The settled transfer a row was built from. The app builds the explorer URL. */
486
+ interface ActivityReceipt {
487
+ readonly chainId: number;
488
+ readonly transactionHash: string;
489
+ }
490
+ /**
491
+ * One finished row. A DISCRIMINATED UNION on `kind`, because a Movement has no
492
+ * payment status: one flat shape carrying `status` for both kinds cannot
493
+ * compile. The two branches match the two branches every app mapper already
494
+ * writes.
495
+ */
496
+ type ActivityRow = {
497
+ readonly kind: "payment";
498
+ readonly execution?: Payment["execution"];
499
+ readonly reference: ActivityReference;
500
+ readonly direction: PaymentDirection;
501
+ readonly counterpartyLabel: string;
502
+ readonly amountDisplay: string;
503
+ readonly signedAmountDisplay: string;
504
+ readonly currency: string;
505
+ readonly createdAt: number;
506
+ readonly ledgerKind: "Payment" | "Payout" | "Deposit";
507
+ readonly paymentType: PaymentType;
508
+ readonly status: PaymentStatus;
509
+ readonly phase: ActivityPhase;
510
+ readonly receipt: ActivityReceipt | null;
511
+ } | {
512
+ readonly kind: "movement";
513
+ readonly reference: ActivityReference;
514
+ readonly direction: PaymentDirection;
515
+ readonly counterpartyLabel: string;
516
+ readonly amountDisplay: string;
517
+ readonly signedAmountDisplay: string;
518
+ readonly currency: string;
519
+ readonly createdAt: number;
520
+ readonly classification: Extract<ActivityItem, {
521
+ readonly kind: "movement";
522
+ }>["classification"];
523
+ readonly phase: ActivityPhase;
524
+ readonly receipt: ActivityReceipt;
525
+ };
526
+ /**
527
+ * `"last30days"` is the last 30 whole UTC days including today. Quantizing to
528
+ * the UTC day keeps the cache key stable for a whole day instead of changing
529
+ * on every render.
530
+ */
531
+ type SummaryWindow = "all" | "last30days" | ActivityRange;
532
+ /**
533
+ * Finished valuation strings in the display currency. Unrated assets remain
534
+ * separate. All four strings are `null` and `count` is `0`
535
+ * when the window holds no activity — we say there is nothing, the app says it
536
+ * in its own words.
537
+ */
538
+ interface ActivitySummarySlice {
539
+ readonly readWarning?: ActivityPage["readWarning"];
540
+ readonly currency: string | null;
541
+ readonly moneyIn: string | null;
542
+ readonly moneyOut: string | null;
543
+ readonly net: string | null;
544
+ readonly pending: string | null;
545
+ readonly unrated: readonly ActivitySummaryTotal[];
546
+ /** A count is not money, so it is not formatted. */
547
+ readonly count: number;
548
+ readonly isLoading: boolean;
549
+ readonly error: CapxulError | null;
550
+ }
551
+ interface ActivityFilterValues {
552
+ readonly kind?: ActivityKind;
553
+ readonly direction?: PaymentDirection;
554
+ readonly status?: readonly PaymentStatus[];
555
+ }
556
+ interface ActivityFiltersSlice {
557
+ readonly values: ActivityFilterValues;
558
+ readonly set: {
559
+ readonly kind: (value?: ActivityKind) => void;
560
+ readonly direction: (value?: PaymentDirection) => void;
561
+ /** REPLACES the array; it does not toggle one value. */
562
+ readonly status: (value: readonly PaymentStatus[]) => void;
563
+ readonly clear: () => void;
564
+ };
565
+ /** CODES, never labels. There is no `{value, label}` pair in this seam. */
566
+ readonly options: {
567
+ readonly kind: readonly ActivityKind[];
568
+ readonly direction: readonly PaymentDirection[];
569
+ readonly status: readonly PaymentStatus[];
570
+ };
571
+ }
572
+ interface ActivitySearchSlice {
573
+ readonly value: string;
574
+ readonly change: (text: string) => void;
575
+ }
576
+ interface ActivityRowsSlice {
577
+ readonly readWarning?: ActivityPage["readWarning"];
578
+ /** Already filtered and already searched. */
579
+ readonly rows: readonly ActivityRow[];
580
+ readonly isLoading: boolean;
581
+ readonly error: CapxulError | null;
582
+ /**
583
+ * #1960 R02: pass the options captured before the retry was selected and the
584
+ * re-read runs under the same attempt identity as the UI observation. Omit
585
+ * them and the read keeps its own invocation context.
586
+ */
587
+ readonly retry: (options?: InvocationOptions) => void;
588
+ /** Server read time of the newest page, so the app can say which read is older. */
589
+ readonly observedAt: number | null;
590
+ }
591
+ interface ActivityLoadMoreSlice {
592
+ readonly hasMore: boolean;
593
+ readonly loadMore: () => void;
594
+ readonly isLoadingMore: boolean;
595
+ /**
596
+ * Attach to whatever the screen renders at the bottom of the list. Where
597
+ * `IntersectionObserver` is undefined — server rendering, and the jsdom test
598
+ * environment — attaching is a no-op and `loadMore()` stays callable.
599
+ *
600
+ * A CALLBACK ref, not the wider `Ref<HTMLElement>`: `RefObject` is invariant,
601
+ * so `Ref<HTMLElement>` refuses to attach to a `<div>`, which is exactly what
602
+ * a screen renders at the bottom of its list.
603
+ */
604
+ readonly sentinelRef: RefCallback<HTMLElement>;
605
+ }
606
+ interface ActivityDetailSlice {
607
+ /** Current Payment state from the existing detail read; absent for Movements. */
608
+ readonly payment?: Pick<Payment, "status" | "execution">;
609
+ readonly documents: readonly PaymentDocumentRef[];
610
+ readonly selectedDocument: PaymentDocumentRef | null;
611
+ readonly selectDocument: (ref: PaymentDocumentReadRef) => void;
612
+ readonly renderDocument: () => Promise<PaymentDocumentRender>;
613
+ /** Return exact bytes on a deliberate action. The host owns the download URL. */
614
+ readonly downloadDocument: () => Promise<PaymentDocumentDownload>;
615
+ readonly isOpeningDocument: boolean;
616
+ readonly memo: string;
617
+ readonly setMemo: (text: string) => void;
618
+ /** Resolves after save. An unedited memo resolves successfully without a write. */
619
+ readonly saveMemo: () => Promise<{
620
+ readonly ok: true;
621
+ } | {
622
+ readonly ok: false;
623
+ readonly error: CapxulError;
624
+ }>;
625
+ readonly isSavingMemo: boolean;
626
+ readonly isLoading: boolean;
627
+ readonly error: CapxulError | null;
628
+ }
629
+ interface CsvExport {
630
+ readonly readWarning?: ActivityPage["readWarning"];
631
+ readonly text: string;
632
+ readonly rowCount: number;
633
+ /** The 5,000-row ceiling was reached and rows were left unread. */
634
+ readonly truncated: boolean;
635
+ }
636
+ interface ActivityExportSlice {
637
+ /** Same contract as `retry`: the export's pages run under the caller's attempt. */
638
+ readonly toCsv: (options?: InvocationOptions) => Promise<CsvExport>;
639
+ readonly isExporting: boolean;
640
+ }
641
+ //#endregion
642
+ //#region src/activity/activity.d.ts
643
+ interface CapxulActivityProps {
644
+ /** Omitted = the signed-in person. */
645
+ readonly actor?: ActorReference;
646
+ /**
647
+ * 1..100, default 25. The root CLAMPS an out-of-range value into that band
648
+ * and warns once in development; it never throws, because a bad prop must not
649
+ * blank a screen. The band is the backend's own.
650
+ */
651
+ readonly pageSize?: number;
652
+ readonly children: ReactNode;
653
+ }
654
+ declare function Root$4({ actor, pageSize, children }: CapxulActivityProps): import("react").JSX.Element;
655
+ /**
656
+ * The one part that holds a query rather than reading the engine's: it takes a
657
+ * `window` prop, and two placements can ask for different windows, so a single
658
+ * pre-fetched result cannot serve both. It still holds no logic and draws
659
+ * nothing.
660
+ */
661
+ declare function Summary$3({ window, children }: {
662
+ readonly window?: SummaryWindow;
663
+ readonly children: (slice: ActivitySummarySlice) => ReactNode;
664
+ }): import("react").JSX.Element;
665
+ declare function Filters({ children }: {
666
+ readonly children: (slice: ActivityFiltersSlice) => ReactNode;
667
+ }): import("react").JSX.Element;
668
+ declare function Search({ children }: {
669
+ readonly children: (slice: ActivitySearchSlice) => ReactNode;
670
+ }): import("react").JSX.Element;
671
+ declare function Rows({ children }: {
672
+ readonly children: (slice: ActivityRowsSlice) => ReactNode;
673
+ }): import("react").JSX.Element;
674
+ declare function LoadMore({ children }: {
675
+ readonly children: (slice: ActivityLoadMoreSlice) => ReactNode;
676
+ }): import("react").JSX.Element;
677
+ declare function Detail({ reference, children }: {
678
+ readonly reference?: ActivityReference;
679
+ readonly children: (slice: ActivityDetailSlice) => ReactNode;
680
+ }): import("react").JSX.Element;
681
+ declare function Export({ children }: {
682
+ readonly children: (slice: ActivityExportSlice) => ReactNode;
683
+ }): import("react").JSX.Element;
684
+ /** The compound shape the app's own design system already uses (`StatusTabs`). */
685
+ export declare const CapxulActivity: typeof Root$4 & {
686
+ Summary: typeof Summary$3;
687
+ Filters: typeof Filters;
688
+ Search: typeof Search;
689
+ Rows: typeof Rows;
690
+ LoadMore: typeof LoadMore;
691
+ Detail: typeof Detail;
692
+ Export: typeof Export;
693
+ };
694
+ //#endregion
695
+ //#region src/activity/use-capxul-activity.d.ts
696
+ export declare function useCapxulActivity(params?: ActivityListParams): UseQueryResult<ActivityPage, CapxulError>;
697
+ export declare function useCapxulActivityDetail(reference: ActivityReference | undefined, actor?: ActorReference): UseQueryResult<ActivityDetail | null, CapxulError>;
698
+ export declare function useCapxulAnnotateMovement(): UseMutationResult<ActivityAnnotation, CapxulError, ActivityAnnotationInput>;
699
+ //#endregion
700
+ //#region src/organizations/org-member.d.ts
701
+ /** The two enforcement facts, named the way a screen asks for them. */
702
+ type OrgMemberAction = "spend" | "managePeople";
703
+ /**
704
+ * Why an action is refused — a closed list of CODES (ruling R1). `null` exactly
705
+ * when the action is allowed. The app owns every sentence these map to.
706
+ */
707
+ type CanReason = "loading" | "no-permission" | "org-unavailable" | null;
708
+ interface OrgMemberCanSlice {
709
+ /** FAILS CLOSED: `false` until the read settles. */
710
+ readonly allowed: boolean;
711
+ readonly isLoading: boolean;
712
+ readonly reason: CanReason;
713
+ }
714
+ type OrgMemberStanding = "loading" | "unavailable" | "active" | "restricted";
715
+ interface OrgMemberStandingSlice {
716
+ readonly standing: OrgMemberStanding;
717
+ /** `standing === "active"` guarantees this is non-null — see the rule below. */
718
+ readonly roleLabel: string | null;
719
+ }
720
+ interface CapxulOrgMemberProps {
721
+ readonly orgId: OrgId | string | undefined;
722
+ readonly children: ReactNode;
723
+ }
724
+ declare function Root$3({ orgId, children }: CapxulOrgMemberProps): import("react").JSX.Element;
725
+ /**
726
+ * One part serves all four denial idioms the app already uses: disabled with no
727
+ * explanation, disabled plus a native `title`, a whole-surface swap, and
728
+ * buttons that vanish. The part branches on nothing — the root computes both
729
+ * slices and this picks the one the `do` prop names.
730
+ */
731
+ declare function Can({ do: action, children }: {
732
+ readonly do: OrgMemberAction;
733
+ readonly children: (slice: OrgMemberCanSlice) => ReactNode;
734
+ }): import("react").JSX.Element;
735
+ declare function Standing({ children }: {
736
+ readonly children: (slice: OrgMemberStandingSlice) => ReactNode;
737
+ }): import("react").JSX.Element;
738
+ /** The compound shape the app's own design system already uses (`StatusTabs`). */
739
+ export declare const CapxulOrgMember: typeof Root$3 & {
740
+ Can: typeof Can;
741
+ Standing: typeof Standing;
742
+ };
743
+ //#endregion
744
+ //#region src/organizations/use-capxul-create-org.d.ts
745
+ /**
746
+ * Create an Organization. Binds directly to the
747
+ * `onboarding.completeOrganization(input)` SDK method. On success, invalidates the org list.
748
+ */
749
+ type UseCapxulCreateOrgReturn = UseMutationResult<OrganizationOnboarding, CapxulError, OrganizationOnboardingInput>;
750
+ export declare function useCapxulCreateOrg(): UseCapxulCreateOrgReturn;
751
+ //#endregion
752
+ //#region src/organizations/use-capxul-org-members.d.ts
753
+ type UseCapxulOrgMembersOptions = {
754
+ readonly enabled?: boolean;
755
+ };
756
+ /**
757
+ * List the members of one Organization. Binds directly to
758
+ * `capxul.org(orgId).members()`. Gated by
759
+ * `orgId !== undefined`; callers may additionally gate on canonical identity
760
+ * readiness through `options.enabled`.
761
+ */
762
+ type UseCapxulOrgMembersReturn = UseQueryResult<Page<MemberView>, CapxulError>;
763
+ export declare function useCapxulOrgMembers(orgId: OrgId | undefined, options?: UseCapxulOrgMembersOptions): UseCapxulOrgMembersReturn;
764
+ //#endregion
765
+ //#region src/organizations/use-capxul-org-roles.d.ts
766
+ type UseCapxulOrgRolesOptions = {
767
+ readonly enabled?: boolean;
768
+ };
769
+ /**
770
+ * List the roles for one Organization. Binds directly
771
+ * to `capxul.org(orgId).roles()`. Gated by `orgId !== undefined`.
772
+ */
773
+ type UseCapxulOrgRolesReturn = UseQueryResult<Page<RoleView>, CapxulError>;
774
+ export declare function useCapxulOrgRoles(orgId: OrgId | undefined, options?: UseCapxulOrgRolesOptions): UseCapxulOrgRolesReturn;
775
+ //#endregion
776
+ //#region src/organizations/use-capxul-org-treasury.d.ts
777
+ type UseCapxulOrgTreasuryOptions = {
778
+ readonly enabled?: boolean;
779
+ };
780
+ /**
781
+ * Return the Organization treasury Account.
782
+ * NEVER `AccountStatus` (the deploy-readiness ladder, no balance). Binds
783
+ * Binds directly to `capxul.org(orgId).treasury()`. Gated by `orgId !== undefined`.
784
+ */
785
+ type UseCapxulOrgTreasuryReturn = UseQueryResult<Account, CapxulError>;
786
+ export declare function useCapxulOrgTreasury(orgId: OrgId | undefined, options?: UseCapxulOrgTreasuryOptions): UseCapxulOrgTreasuryReturn;
787
+ //#endregion
788
+ //#region src/organizations/use-capxul-orgs.d.ts
789
+ /**
790
+ * List the Organizations that the current user can access. Binds directly to
791
+ * the locked `capxul.orgs()` SDK method.
792
+ */
793
+ type UseCapxulOrgsReturn = UseQueryResult<Page<OrganizationAccess>, CapxulError>;
794
+ type UseCapxulOrgsOptions = {
795
+ /**
796
+ * Gate the query on auth readiness. `client.orgs()` is a session-scoped
797
+ * authenticated read; firing it before the session token settles surfaces a
798
+ * spurious `NOT_AUTHENTICATED`. Consumers pass `enabled: <auth-ready>`.
799
+ * Defaults to `true` to preserve the bare `useCapxulOrgs()` call shape.
800
+ */
801
+ readonly enabled?: boolean;
802
+ };
803
+ export declare function useCapxulOrgs(options?: UseCapxulOrgsOptions): UseCapxulOrgsReturn;
804
+ //#endregion
805
+ //#region src/media/use-capxul-image-upload.d.ts
806
+ type ImageUploadTarget = {
807
+ readonly kind: "profile";
808
+ } | {
809
+ readonly kind: "orgLogo";
810
+ readonly orgId: string;
811
+ };
812
+ type ImageUploadInput = {
813
+ readonly blob: Blob;
814
+ readonly target: ImageUploadTarget;
815
+ };
816
+ type UseCapxulImageUploadReturn = UseMutationResult<{
817
+ readonly url: string | null;
818
+ }, CapxulError, ImageUploadInput>;
819
+ /**
820
+ * #1061 / ADR-0014: the whole upload→record sequence as one mutation —
821
+ * upload the blob, then bind the returned storage id to the profile image or
822
+ * the org logo. The url is the resolved serving URL (re-read from queries,
823
+ * never persisted by consumers).
824
+ */
825
+ export declare function useCapxulImageUpload(): UseCapxulImageUploadReturn;
826
+ //#endregion
827
+ //#region src/media/use-capxul-upload-image.d.ts
828
+ type UseCapxulUploadImageReturn = UseMutationResult<{
829
+ readonly storageId: string;
830
+ }, CapxulError, Blob>;
831
+ /**
832
+ * #1955: upload only. Hands back the storage id for a CREATE call to carry
833
+ * (`ProfileDetails.imageStorageId`, `OrganizationDetails.logoStorageId`).
834
+ *
835
+ * `useCapxulImageUpload` is upload+bind and stays as it is for the settings
836
+ * pages. It cannot serve onboarding: the row it binds to does not exist yet.
837
+ * Nothing is bound here, so nothing is invalidated either — the create call
838
+ * that carries the id owns the cache change.
839
+ */
840
+ export declare function useCapxulUploadImage(): UseCapxulUploadImageReturn;
841
+ //#endregion
842
+ //#region src/parties/contact-slices.d.ts
843
+ type ContactsActor = {
844
+ readonly kind: "personal";
845
+ } | {
846
+ readonly kind: "organization";
847
+ readonly orgId: OrgId | undefined;
848
+ };
849
+ /**
850
+ * How a contact entered the book. Taken from the shipped surface rather than
851
+ * re-declared, so the component can never advertise a provenance the wire
852
+ * cannot carry (ADR-0022 R2; #1532 owns the definition site).
853
+ */
854
+ type ContactRelationship = AddressBookEntry["relationship"][number];
855
+ interface Contact {
856
+ /**
857
+ * The counterparty's `PartyId` — created once and claimed at signup, never
858
+ * re-keyed (ADR-0022 R1/R3). No email, no prefix, nothing to parse.
859
+ */
860
+ readonly id: PartyId;
861
+ /** The saved label when there is one, else the party's display name. */
862
+ readonly name: string;
863
+ readonly relationship: readonly ContactRelationship[];
864
+ readonly hidden: boolean;
865
+ /** Epoch milliseconds. The seam never formats a date; the app writes the words. */
866
+ readonly lastActivityAt: number;
867
+ }
868
+ interface ContactRow extends Contact {
869
+ /** Ours: one initials rule, not one copy per screen. */
870
+ readonly initials: string;
871
+ readonly rename: (name: string, options?: InvocationOptions) => void;
872
+ readonly hide: (options?: InvocationOptions) => void;
873
+ readonly unhide: (options?: InvocationOptions) => void;
874
+ }
875
+ /** ADR-0023 R1: refusal CODES, never sentences — the app owns the words. */
876
+ type ContactsRefusal = "loading" | "org-unavailable" | "unavailable";
877
+ /**
878
+ * The blocked facts, in the fixed order `.Add.blockedReason` names them.
879
+ * `"no-permission"` is absent by ruling, not by omission: the org screen places
880
+ * `CapxulOrgMember.Can do="managePeople"` around its own Add control.
881
+ */
882
+ type ContactsAddBlockedReason = "org-unavailable" | "empty";
883
+ /**
884
+ * Why an add did not land, as a code. ADR-0023 R1 supersedes the contract's
885
+ * field-message carve-out: `"unresolved"` is the backend refusing to resolve
886
+ * what was typed (`INVALID_INPUT`), and every other code — offline, signed
887
+ * out, refused — is `"failed"`. A person can fix only one of them.
888
+ */
889
+ type ContactsAddError = "unresolved" | "failed";
890
+ interface ContactsSummarySlice {
891
+ readonly total: number | null;
892
+ readonly activeCount: number | null;
893
+ readonly isLoading: boolean;
894
+ readonly reason: ContactsRefusal | null;
895
+ }
896
+ interface ContactsListSlice {
897
+ readonly rows: readonly ContactRow[];
898
+ readonly isLoading: boolean;
899
+ readonly reason: ContactsRefusal | null;
900
+ }
901
+ interface ContactsListOptions {
902
+ readonly limit?: number | undefined;
903
+ /** `"all"` forwards `includeHidden` to the backend, which already accepts it. */
904
+ readonly show?: "visible" | "all" | undefined;
905
+ }
906
+ interface ContactsAddSlice {
907
+ readonly value: string;
908
+ readonly change: (text: string) => void;
909
+ /**
910
+ * #1960 R02: hand it the options the screen captured BEFORE the click. The
911
+ * same snapshot reaches the SDK add call and comes back on `onAdded`/
912
+ * `onFailed`, so the UI observation and the operation share one identity even
913
+ * when the reply lands after an account switch. Omitted stays omitted.
914
+ */
915
+ readonly submit: (options?: InvocationOptions) => void;
916
+ readonly isSubmitting: boolean;
917
+ readonly blocked: boolean;
918
+ readonly blockedReason: ContactsAddBlockedReason | null;
919
+ readonly error: ContactsAddError | null;
920
+ }
921
+ //#endregion
922
+ //#region src/parties/contacts.d.ts
923
+ interface CapxulContactsProps {
924
+ readonly actor: ContactsActor;
925
+ /**
926
+ * `options` is exactly what the caller handed `.Add.submit` or a row verb, so
927
+ * the screen's own observation of the finished action can reuse the attempt
928
+ * identity the SDK operation ran under (#1960 R02).
929
+ */
930
+ readonly onAdded: (contact: Contact, options?: InvocationOptions) => void;
931
+ /** ADR-0023 R1: the app maps `error.code` to its own copy; no SDK sentence. */
932
+ readonly onFailed: (error: CapxulError, options?: InvocationOptions) => void;
933
+ readonly children: ReactNode;
934
+ }
935
+ declare function Root$2({ actor, onAdded, onFailed, children }: CapxulContactsProps): import("react").JSX.Element;
936
+ declare function Summary$2({ children }: {
937
+ readonly children: (slice: ContactsSummarySlice) => ReactNode;
938
+ }): import("react").JSX.Element;
939
+ declare function List({ limit, show, children }: ContactsListOptions & {
940
+ readonly children: (slice: ContactsListSlice) => ReactNode;
941
+ }): import("react").JSX.Element;
942
+ declare function Add({ children }: {
943
+ readonly children: (slice: ContactsAddSlice) => ReactNode;
944
+ }): import("react").JSX.Element;
945
+ /** The compound shape the app's own design system already uses (`StatusTabs`). */
946
+ export declare const CapxulContacts: typeof Root$2 & {
947
+ Summary: typeof Summary$2;
948
+ List: typeof List;
949
+ Add: typeof Add;
950
+ };
951
+ //#endregion
952
+ //#region src/platform/query-keys.d.ts
953
+ export declare const capxulKeys: {
954
+ root: readonly ["capxul"];
955
+ profile: readonly ["capxul", "profile"];
956
+ handleAvailability: (handle: string) => readonly ["capxul", "profile", "handle-availability", string];
957
+ account: readonly ["capxul", "account"];
958
+ provisioning: readonly ["capxul", "provisioning"];
959
+ binding: readonly ["capxul", "binding"];
960
+ accountBalance: readonly ["capxul", "accountBalance"];
961
+ orgs: readonly ["capxul", "orgs"];
962
+ org: (orgId: OrgId | undefined) => readonly ["capxul", "org", "pending" | OrgId];
963
+ orgMembers: (orgId: OrgId | undefined) => readonly ["capxul", "org", "pending" | OrgId, "members"];
964
+ orgRoles: (orgId: OrgId | undefined) => readonly ["capxul", "org", "pending" | OrgId, "roles"];
965
+ orgTreasury: (orgId: OrgId | undefined) => readonly ["capxul", "org", "pending" | OrgId, "treasury"];
966
+ orgPermissions: (orgId: OrgId | undefined) => readonly ["capxul", "org", "pending" | OrgId, "permissions"];
967
+ orgMe: (orgId: OrgId | undefined, account: string | undefined) => readonly ["capxul", "org", "pending" | OrgId, "me", string];
968
+ orgLifecycle: (orgId: OrgId | undefined) => readonly ["capxul", "org", "pending" | OrgId, "lifecycle"];
969
+ contacts: (scope: string) => readonly ["capxul", "contacts", string];
970
+ contactsList: (scope: string, includeHidden: boolean) => readonly ["capxul", "contacts", string, "all" | "visible"];
971
+ payrollRuns: (orgId: OrgId | undefined) => readonly ["capxul", "org", "pending" | OrgId, "payroll", "runs"];
972
+ payrollGroups: (orgId: OrgId | undefined) => readonly ["capxul", "org", "pending" | OrgId, "payroll", "groups"];
973
+ payrollTerms: (orgId: OrgId | undefined) => readonly ["capxul", "org", "pending" | OrgId, "payroll", "terms"];
974
+ activity: readonly ["capxul", "activity"];
975
+ activityDetail: (reference: ActivityReference | undefined, actor?: ActorReference) => readonly ["capxul", "activity", "self" | ActorReference, "pending" | ActivityReference];
976
+ activitySummary: (actor?: ActorReference, window?: ActivityRange) => readonly ["capxul", "activity", "summary", "self" | ActorReference, "all" | ActivityRange];
977
+ holdings: (actor?: ActorReference) => readonly ["capxul", "holdings", "self" | ActorReference];
978
+ payments: readonly ["capxul", "payments"];
979
+ payment: (paymentId: string | undefined) => readonly ["capxul", "payments", string];
980
+ };
981
+ //#endregion
982
+ //#region src/payroll/reads.d.ts
983
+ /**
984
+ * One payable person, as the run composer and the group sheet see them.
985
+ *
986
+ * `id` is the `PartyId` — the stable key ADR-0022 R1 exists to provide, and the
987
+ * end of the email-keyed recipient ids the deleted app hook minted.
988
+ */
989
+ interface PayrollRecipientOption {
990
+ readonly id: string;
991
+ /** The party's real display name, never an email local-part. */
992
+ readonly name: string;
993
+ readonly email: string | null;
994
+ }
995
+ //#endregion
996
+ //#region src/payroll/payroll-run-slices.d.ts
997
+ /**
998
+ * Refusal CODES, never sentences (ADR-0023 R1). `blockedReason` names the FIRST
999
+ * false fact in the fixed order below, so the same composer state always
1000
+ * yields the same code.
1001
+ */
1002
+ type CapxulPayrollRunBlockedReason = "signer-not-ready" | "no-source" | "ambiguous-source" | "no-asset" | "no-recipients" | "amount-invalid" | "insufficient-funds" | "asset-unnamed";
1003
+ interface PayrollRunGroupOption {
1004
+ readonly id: PayrollGroupId;
1005
+ readonly label: string;
1006
+ /** The member count as text — the app supplies any word beside it. */
1007
+ readonly badgeLabel: string;
1008
+ readonly recipientIds: readonly string[];
1009
+ }
1010
+ interface PayrollRunRecipientsSlice {
1011
+ readonly options: readonly PayrollRecipientOption[];
1012
+ readonly groups: readonly PayrollRunGroupOption[];
1013
+ readonly selected: readonly string[];
1014
+ readonly toggle: (id: string) => void;
1015
+ readonly remove: (id: string) => void;
1016
+ readonly isLoading: boolean;
1017
+ readonly error: CapxulError | null;
1018
+ }
1019
+ interface PayrollRunAmountEntry {
1020
+ readonly recipientId: string;
1021
+ readonly name: string;
1022
+ readonly value: string;
1023
+ readonly change: (text: string) => void;
1024
+ /** The `parseMoney` verdict as a closed code; the app maps it to copy. */
1025
+ readonly error: MoneyParseErrorReason | null;
1026
+ /** True while the value is one we seeded and the employer has not edited. */
1027
+ readonly prefilled: boolean;
1028
+ /** The treasury asset's currency. Rows stay absent until this value exists. */
1029
+ readonly currency: string;
1030
+ }
1031
+ interface PayrollRunAmountsSlice {
1032
+ readonly entries: readonly PayrollRunAmountEntry[];
1033
+ }
1034
+ /** The SAME slice shape as `CapxulSendMoney.Asset` — the cross-item rule. */
1035
+ type PayrollRunAssetSlice = SendMoneyAssetSlice;
1036
+ interface PayrollRunSummarySlice {
1037
+ readonly recipientCount: number;
1038
+ /** Null until every selected amount parses. */
1039
+ readonly totalDisplay: string | null;
1040
+ readonly balanceAfterDisplay: string | null;
1041
+ readonly funds: "available" | "insufficient" | "unknown";
1042
+ }
1043
+ interface PayrollRunActionsSlice {
1044
+ readonly recovery: "none" | "restoring" | "required" | "unavailable";
1045
+ readonly recoveryError: CapxulError | null;
1046
+ /**
1047
+ * R13 (#1968): `options` is the browser attempt captured before the employer
1048
+ * confirmed. It reaches `authorizeRun` unchanged, so the sheet's own
1049
+ * `ui_payroll_action_completed` and the durable `payroll_run_transitioned`
1050
+ * rows share one correlation. It is NEVER written into the persisted draft —
1051
+ * a restored run keeps its own identity, not a stale attempt's.
1052
+ */
1053
+ readonly submit: (options?: InvocationOptions) => void;
1054
+ readonly isSubmitting: boolean;
1055
+ readonly blocked: boolean;
1056
+ readonly blockedReason: CapxulPayrollRunBlockedReason | null;
1057
+ }
1058
+ interface PayrollRunPrefill {
1059
+ /** `partyId`s — how a group card opens pay-now pre-filled. */
1060
+ readonly recipientIds: readonly string[];
1061
+ readonly amounts?: readonly {
1062
+ readonly recipientId: string;
1063
+ readonly amount: string;
1064
+ }[];
1065
+ }
1066
+ interface SentPayrollRun {
1067
+ readonly id: PayrollRunId;
1068
+ readonly totalDisplay: string;
1069
+ readonly recipientCount: number;
1070
+ }
1071
+ //#endregion
1072
+ //#region src/payroll/payroll-run.d.ts
1073
+ interface CapxulPayrollRunProps {
1074
+ readonly orgId: OrgId | undefined;
1075
+ /** How a group card opens pay-now pre-filled — today's group-context merge. */
1076
+ readonly prefill?: PayrollRunPrefill;
1077
+ readonly onRun: (run: SentPayrollRun) => void;
1078
+ /** ADR-0023 R1: the app maps `error.code` to its own copy; no SDK sentence. */
1079
+ readonly onFailed: (error: CapxulError) => void;
1080
+ readonly children: ReactNode;
1081
+ }
1082
+ declare function Root$1({ orgId, prefill, onRun, onFailed, children }: CapxulPayrollRunProps): import("react").JSX.Element;
1083
+ declare function Recipients({ children }: {
1084
+ readonly children: (slice: PayrollRunRecipientsSlice) => ReactNode;
1085
+ }): import("react").JSX.Element;
1086
+ declare function Amounts({ children }: {
1087
+ readonly children: (slice: PayrollRunAmountsSlice) => ReactNode;
1088
+ }): import("react").JSX.Element;
1089
+ declare function Asset({ children }: {
1090
+ readonly children: (slice: PayrollRunAssetSlice) => ReactNode;
1091
+ }): import("react").JSX.Element;
1092
+ declare function Summary$1({ children }: {
1093
+ readonly children: (slice: PayrollRunSummarySlice) => ReactNode;
1094
+ }): import("react").JSX.Element;
1095
+ declare function Actions({ children }: {
1096
+ readonly children: (slice: PayrollRunActionsSlice) => ReactNode;
1097
+ }): import("react").JSX.Element;
1098
+ /** The compound shape the app's own design system already uses (`StatusTabs`). */
1099
+ export declare const CapxulPayrollRun: typeof Root$1 & {
1100
+ Recipients: typeof Recipients;
1101
+ Amounts: typeof Amounts;
1102
+ Asset: typeof Asset;
1103
+ Summary: typeof Summary$1;
1104
+ Actions: typeof Actions;
1105
+ };
1106
+ //#endregion
1107
+ //#region src/payroll/use-payroll.d.ts
1108
+ /** ADR-0022 R9: where a run stands on the shipped command lifecycle. */
1109
+ interface PayrollGroupRow {
1110
+ readonly id: PayrollGroupId;
1111
+ readonly name: string;
1112
+ /** A stored display preference; the app narrows it to its own DS union. */
1113
+ readonly tone: string;
1114
+ readonly memberCount: number;
1115
+ /** `formatMoney` over the amounts the employer typed on this group. */
1116
+ readonly totalDisplay: string;
1117
+ readonly members: readonly {
1118
+ /** The `partyId` — the stable id (ruling Q1), never an email. */
1119
+ readonly recipientId: string;
1120
+ readonly amount: string;
1121
+ readonly currency: Money["currency"];
1122
+ }[];
1123
+ }
1124
+ interface PayrollSummarySlice {
1125
+ readonly walletBalanceDisplay: string | null;
1126
+ readonly paidThisMonthDisplay: string | null;
1127
+ readonly isLoading: boolean;
1128
+ readonly error: CapxulError | null;
1129
+ }
1130
+ interface PayrollGroupsSlice {
1131
+ readonly groups: readonly PayrollGroupRow[];
1132
+ /**
1133
+ * R13 (#1968): `options` is the browser attempt the caller captured before the
1134
+ * employer pressed the button. It reaches the SDK operation unchanged, so the
1135
+ * group's `ui_payroll_action_completed` and the durable `payroll_group_changed`
1136
+ * share one correlation. Absent, the write keeps its own invocation context.
1137
+ */
1138
+ readonly save: (input: PayrollGroupInput, options?: InvocationOptions) => Promise<CapxulResult<PayrollGroupRow>>;
1139
+ readonly remove: (id: PayrollGroupId, options?: InvocationOptions) => Promise<CapxulResult<void>>;
1140
+ readonly isSaving: boolean;
1141
+ readonly isLoading: boolean;
1142
+ readonly error: CapxulError | null;
1143
+ }
1144
+ //#endregion
1145
+ //#region src/payroll/payroll.d.ts
1146
+ interface CapxulPayrollProps {
1147
+ readonly orgId: OrgId | undefined;
1148
+ readonly children: ReactNode;
1149
+ }
1150
+ declare function Root({ orgId, children }: CapxulPayrollProps): import("react").JSX.Element;
1151
+ declare function Summary({ children }: {
1152
+ readonly children: (slice: PayrollSummarySlice) => ReactNode;
1153
+ }): import("react").JSX.Element;
1154
+ declare function Groups({ children }: {
1155
+ readonly children: (slice: PayrollGroupsSlice) => ReactNode;
1156
+ }): import("react").JSX.Element;
1157
+ /**
1158
+ * The compound shape the app's own design system already uses (`StatusTabs`).
1159
+ * There is NO `.Runs` part (ruling Q6): no shipped region has the right shape
1160
+ * for a run list, and a part without a production caller may not ship.
1161
+ */
1162
+ export declare const CapxulPayroll: typeof Root & {
1163
+ Summary: typeof Summary;
1164
+ Groups: typeof Groups;
1165
+ };
1166
+ //#endregion
1167
+ export { type AccountFailure, type AccountProgress, type ActionResult, type ActivityDetailSlice, type ActivityExportSlice, type ActivityFilterValues, type ActivityFiltersSlice, type ActivityLoadMoreSlice, type ActivityReceipt, type ActivityRow, type ActivityRowsSlice, type ActivitySearchSlice, type ActivitySummarySlice, type AuthenticatedState, type AuthenticationSlots, type CanReason, type CapxulActivityProps, type CapxulAuth, CapxulAuthenticationController, type CapxulBootstrapState, type CapxulBootstrapStatus, type CapxulClientConnectionProps, type CapxulContactsProps, type CapxulDashboardAccessProps, CapxulOnboardingController, type CapxulOrgMemberProps, type CapxulPayrollProps, type CapxulPayrollRunBlockedReason, type CapxulPayrollRunProps, type CapxulProviderProps, type CapxulSend, type CapxulSendMoneyBlockedReason, type CapxulSendMoneyProps, type CompleteSlice as ClientConnectionCompleteSlice, type ConsentSlice as ClientConnectionConsentSlice, type FailureSlice as ClientConnectionFailureSlice, type OtpSlice as ClientConnectionOtpSlice, type Contact, type ContactRelationship, type ContactRow, type ContactsActor, type ContactsAddBlockedReason, type ContactsAddError, type ContactsAddSlice, type ContactsListOptions, type ContactsListSlice, type ContactsRefusal, type ContactsSummarySlice, type ControllerAction, type CreateOrganizationFailure, type CreateOrganizationSubmission, type CsvExport, type DashboardAccessErrorSlice, type DashboardAccessPhase, type DashboardAccessProbe, type DashboardAccessRedirectSlice, type DashboardScope, type Destination, type FaultedState, type HandleAvailability, type ImageUploadInput, type ImageUploadTarget, type InvocationOptions, type NavigationAction, type OnboardingControllerProps, type OnboardingIntent, type OnboardingJourney, type OnboardingJourneyPosition, type OnboardingOrigin, type OnboardingStep, type OrgFailure, type OrgMemberAction, type OrgMemberCanSlice, type OrgMemberStanding, type OrgMemberStandingSlice, type OrgProgress, type OrganizationDetails, type OrganizationDraft, type OtpPendingState, type PayoutDraftChain, type PayoutDraftEntry, type PayrollGroupRow, type PayrollGroupsSlice, type PayrollRecipientOption, type PayrollRunActionsSlice, type PayrollRunAmountEntry, type PayrollRunAmountsSlice, type PayrollRunAssetSlice, type PayrollRunGroupOption, type PayrollRunPrefill, type PayrollRunRecipientsSlice, type PayrollRunStatus, type PayrollRunSummarySlice, type PayrollSummarySlice, type PendingAuthState, type ProfileDetails, type ProfileDraft, type ProfileSlotProps, type ReadyDestination, type RetryAction, type SendActor, type SendMoneyActionsSlice, type SendMoneyAmountSlice, type SendMoneyAssetError, type SendMoneyAssetOption, type SendMoneyAssetSlice, type SendMoneyRecipientSlice, type SendMoneyRecipientStatus, type SendMoneySourceError, type SendMoneySourceOption, type SendMoneySourceSlice, type SendResult, type SentPayment, type SentPayrollRun, type SignedOutState, type Slot, type SummaryWindow, type UseCapxulAccountBalanceOptions, type UseCapxulAccountBalanceReturn, type UseCapxulAccountFundReturn, type UseCapxulCreateOrgReturn, type UseCapxulHandleAvailabilityReturn, type UseCapxulImageUploadReturn, type UseCapxulOrgMembersOptions, type UseCapxulOrgMembersReturn, type UseCapxulOrgRolesOptions, type UseCapxulOrgRolesReturn, type UseCapxulOrgTreasuryOptions, type UseCapxulOrgTreasuryReturn, type UseCapxulOrgsReturn, type UseCapxulPayReturn, type UseCapxulPaymentReturn, type UseCapxulPaymentsReturn, type UseCapxulProfileReturn, type UseCapxulUploadImageReturn, isClaimed, isRestoring };