···106106 this.package = props.context.package;
107107 }
108108109109+ external(
110110+ resource: Required<SymbolMeta>['resource'],
111111+ meta?: Omit<SymbolMeta, 'category' | 'resource'>,
112112+ ): Symbol {
113113+ return this.gen.symbols.reference({
114114+ ...meta,
115115+ category: 'external',
116116+ resource,
117117+ });
118118+ }
119119+109120 /**
110121 * Iterates over various input elements as specified by the event types, in
111122 * a specific order: servers, schemas, parameters, request bodies, then
···376387 hook({ plugin: this, symbol: symbolOut });
377388 }
378389 return symbolOut;
390390+ }
391391+392392+ /**
393393+ * Registers a symbol only if it does not already exist based on the provided
394394+ * metadata. This prevents duplicate symbols from being created in the project.
395395+ */
396396+ symbolOnce(name: SymbolIn['name'], symbol?: Omit<SymbolIn, 'name'>): Symbol {
397397+ const existing = symbol?.meta ? this.querySymbol(symbol.meta) : undefined;
398398+ if (existing) return existing;
399399+ return this.symbol(name, symbol);
379400 }
380401381402 private buildEventHooks(): EventHooks {
···22import type ts from 'typescript';
3344import type { IR } from '~/ir/types';
55-import type { $ } from '~/ts-dsl';
6576import type { ValibotPlugin } from '../types';
77+import type { Pipes } from './pipes';
8899export type Ast = {
1010 hasLazyExpression?: boolean;
1111- pipes: Array<ReturnType<typeof $.call | typeof $.expr>>;
1111+ pipes: Pipes;
1212 typeName?: string | ts.Identifier;
1313};
1414