/** * Runtime link service backed by Drizzle — executes raw SQL against the * dynamically-named pivot tables materialised from {@link LinkDefinition}s. */ import type { LinkDefinition, LinkService } from "@voyant-travel/core"; import type { DrizzleClient } from "./types.js"; /** * Prevalidate link definitions once, then build services against request-local * database clients without repeating startup validation on every request. */ export declare function createLinkServiceFactory(definitions: readonly LinkDefinition[]): (getDb: () => DrizzleClient) => LinkService; /** * Create a runtime {@link LinkService} for the given set of link definitions. * * The service supports both a positional API (`create(linkKey, leftId, rightId)`) * and a Medusa-style spec API (`create({ moduleA: { a_id }, moduleB: { b_id } })`). * * Prefer {@link createLinkServiceFactory} when multiple services share the * same definitions, such as one service per HTTP request. */ export declare function createLinkService(getDb: () => DrizzleClient, definitions: readonly LinkDefinition[]): LinkService; /** * Materialise every link definition's pivot table (CREATE TABLE + indexes). * Intended for use by a `db:sync-links` CLI command in templates. * * Runs each DDL statement individually against the provided Drizzle client. */ export declare function syncLinks(db: DrizzleClient, definitions: readonly LinkDefinition[]): Promise;