/** * @pwngh/economy-lab * * Copyright (c) Preston Neal * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */ import { topUp } from './topUp.js'; import { spend } from './spend.js'; import { refund } from './refund.js'; import { clawback } from './clawback.js'; import { requestPayout } from './requestPayout.js'; import { subscribe } from './subscribe.js'; import { cancelSubscription } from './cancelSubscription.js'; import { grantEntitlement, revokeEntitlement } from './entitlements.js'; import { grantPromo } from './promo.js'; import { adjust } from './adjust.js'; import { reverse } from './reverse.js'; import { reversePayout } from './reversePayout.js'; import { settlePayout } from './settlePayout.js'; import type { Operation, Outcome } from '../contract.js'; import type { Unit } from '../ports.js'; /** A kind's early duplicate probe: a non-null outcome ends the request before locks or screens. */ export type PreClaim = (operation: Operation, unit: Unit) => Promise; /** * Kinds whose domain-level duplicate is decidable before any lock (the deciding row is final once * written). The submit path runs the probe right after the idempotency claim, so a replay costs * two reads instead of the full lock-and-screen prologue. */ export declare const PRE_CLAIMS: Partial>; /** * Maps each operation's `kind` to its handler. * * The `satisfies Record` clause forces exactly one entry per kind. Add a * kind to `Operation` without registering a handler and the file fails to compile, rather than * throwing at runtime on the first submit of that kind. * * @see {@link https://economy-lab-docs.pages.dev/economy/reference/the-economy/ The Economy} for the * submit entry point that dispatches through this registry. */ export declare const REGISTRY: { topUp: typeof topUp; spend: typeof spend; refund: typeof refund; clawback: typeof clawback; requestPayout: typeof requestPayout; subscribe: typeof subscribe; cancelSubscription: typeof cancelSubscription; grantEntitlement: typeof grantEntitlement; revokeEntitlement: typeof revokeEntitlement; grantPromo: typeof grantPromo; adjust: typeof adjust; reverse: typeof reverse; reversePayout: typeof reversePayout; settlePayout: typeof settlePayout; };