import { type ExtStyle } from "./render-context.js"; export type OutputLayout = "flat" | "package"; /** "a::b::c" → "a/b/c"; undefined / "" → "". */ export declare function packageToPath(pkg: string | undefined): string; /** Output path (relative to outDir) for an entity's generated file. */ export declare function entityOutputPath(layout: OutputLayout, pkg: string | undefined, filename: string): string; /** Module specifier to import `toEntity` (in `toPkg`) from a file in `fromPkg`. * Flat → always "./". */ export declare function crossEntitySpecifier(layout: OutputLayout, fromPkg: string | undefined, toPkg: string | undefined, toEntity: string, extStyle: ExtStyle): string; /** * Module specifier to import a value-object's emitted module (`.ts`) from a * file that lives in `fromPkg`. Value objects are emitted by the entity-file * generator into the SAME target as entities, so this is the same same-target, * package- + extStyle-aware resolution that FK references use. * * This is the SINGLE source of truth shared by the three places that reference a * VO — the field's TS type (inferred-types), its runtime Zod schema * (zod-validators), and its Drizzle `.$type<>()` (drizzle-schema). They MUST * resolve a given VO to the identical module or they would import two distinct * symbols; routing all three through this function makes divergence impossible. * * `voPkg` is looked up from `packageOf` (which includes `object.value` nodes — * `root.objects()` returns every `TYPE_OBJECT` child). An unknown VO falls back * to `fromPkg`, yielding a same-dir `./` specifier (correct for flat layout * and for a same-package reference). */ export declare function valueObjectModuleSpecifier(voName: string, packageOf: ReadonlyMap, fromPkg: string | undefined, layout: OutputLayout, extStyle: ExtStyle): string; /** Barrel (at outDir root) re-export specifier for an entity. * Equivalent to crossEntitySpecifier with fromPkg=undefined (barrel is always at root). */ export declare function barrelEntrySpecifier(layout: OutputLayout, pkg: string | undefined, entity: string, extStyle: ExtStyle): string; /** A `dbImport` (or any module specifier) adjusted for a file at the given * package depth AND the extension style. A non-relative specifier (alias / * package) is depth- and extension-invariant and returned unchanged; a relative * one gets extra "../" per package segment and, under extStyle "js", a `.js` * extension (so `../db` → `../db.js`, required by nodenext). Caller contract: a * relative moduleSpec must be relative to outDir root (as dbImport is). */ export declare function relativeModuleSpecifier(layout: OutputLayout, pkg: string | undefined, moduleSpec: string, extStyle: ExtStyle): string; /** A fully-resolved output destination. Import-identity belongs to the * destination, not the generator. */ export interface ResolvedTarget { name: string; outDir: string; /** Package-specifier prefix others use to import modules produced here. * Required only when another target imports from this one. */ importBase: string | undefined; outputLayout: OutputLayout; dbImport: string; /** * Whether this target emits server runtime bindings. `true` (the default for * the implicit "default" target) = a full server package: Drizzle tables/views, * `runtime-ts` filter/sort allowlists, the whole DB layer. `false` = a * contract-only target: Zod schemas + inferred TS types ONLY, with no * `drizzle-orm` / `runtime-ts` import — for a shared wire-contract package * consumed by a UI/web client that has no database. The axis is the target's * AUDIENCE (server vs client), not any one artifact: in a contract target an * entity drops its `pgTable`, a projection drops its `pgView`, every object * renders as its plain shape. Allowlists are off here too (contract ⇒ no * `runtime-ts`); the finer `allowlists` knob only applies within a runtime target. */ runtime: boolean; } /** Specifier to import entity `entityName` (in `entityPkg`, produced into * `entityTarget`) from a file emitted into `selfTarget`. Same target → relative * (extStyle honored); cross target → extension-less importBase path. */ export declare function entityModuleSpecifier(selfTarget: ResolvedTarget, entityTarget: ResolvedTarget, entityPkg: string | undefined, entityName: string, extStyle: ExtStyle): string; /** A same-target sibling module (e.g. ".columns"). Always relative, * package-layout aware, extStyle honored. */ export declare function siblingSpecifier(selfTarget: ResolvedTarget, entityPkg: string | undefined, basename: string, extStyle: ExtStyle): string; /** Barrel re-export specifier. Barrel sits at its target root, so same-target * uses fromPkg=undefined (barrelEntrySpecifier); cross-target is the * extension-less importBase path. */ export declare function barrelModuleSpecifier(selfTarget: ResolvedTarget, entityTarget: ResolvedTarget, entityPkg: string | undefined, entityName: string, extStyle: ExtStyle): string; //# sourceMappingURL=import-path.d.ts.map