import { i as ParseResult, t as Id } from "./types-hGBnCpJj.mjs"; //#region src/adapters/adapter-types.d.ts /** Discriminated failure value passed to `onError` and emitted to the framework's error handler. */ type IdParamFailure = { readonly reason: "brand_mismatch"; readonly status: number; } | { readonly reason: "malformed"; readonly status: number; }; /** Minimum structural type required by web and ORM adapters. Any codec variant satisfies this — all expose `safeParse`. Adapters only ever call `safeParse` — never key-dependent methods like `extractTimestamp`, `wrap`, or `unwrap`. */ type IdCodec = { safeParse(value: unknown): ParseResult; }; /** Extends {@link IdCodec} with an async `safeVerify` — satisfied by the **Signed Timestamp codec** (native `safeVerify`) and the **Wrapped key codec** (a `safeVerify` alias over `safeUnwrap`; see ADR-0036). HTTP adapters accept `verify: true` only when the codec satisfies this interface (structural type check at the call site). The `safeVerify` method structurally parses `input` first, then verifies the tag; it returns `{ ok: false }` on either failure without throwing. */ type IdVerifiableCodec = IdCodec & { safeVerify(input: unknown): Promise<{ ok: true; id: Id; } | { ok: false; error: unknown; }>; }; /** Re-exported from ORM adapter subpaths (`@smonn/ids/drizzle`, `@smonn/ids/prisma`, `@smonn/ids/kysely`) under the public name; structurally identical to {@link IdCodec}. */ type IdColumnCodec = IdCodec; /** Structural interface required by `idField()` (Prisma, MikroORM), the `generatedIdColumn` family (Drizzle), `insertId` (Kysely), and `beforeInsertHook` (TypeORM) — extends {@link IdColumnCodec} with a synchronous `generate()`. Only the **Timestamp codec** and **Reverse Timestamp codec** satisfy this; async-generate codecs (Opaque, Signed, Wrapped, Digest) do not. Re-exported from all five ORM adapter subpaths (`@smonn/ids/drizzle`, `@smonn/ids/kysely`, `@smonn/ids/mikro-orm`, `@smonn/ids/prisma`, `@smonn/ids/typeorm`) as a public type. */ type IdGeneratingCodec = IdColumnCodec & { generate(): Id; }; //#endregion export { IdVerifiableCodec as a, IdParamFailure as i, IdColumnCodec as n, IdGeneratingCodec as r, IdCodec as t }; //# sourceMappingURL=adapter-types-B-GLKPOm.d.mts.map