/** * FeatureBuilder - Fluent API for building feature schemas * * Provides a chainable interface for constructing feature definitions * that compile to IProductFeature JSON schema. * * @example * ```ts * import { FeatureBuilder } from '@ductape/sdk'; * * const feature = new FeatureBuilder('order-fulfillment') * .name('Order Fulfillment') * .description('Process orders end-to-end') * .input({ order_id: { type: 'string', required: true } }) * .options({ timeout: 86400000, rollback_strategy: 'reverse_all' }) * .step('validate-order') * .action('inventory-service', 'validate-order') * .input({ body: { order_id: '$Input{order_id}' } }) * .done() * .step('reserve-inventory') * .database('inventory-db', 'reserve-items') * .dependsOn(['validate-order']) * .critical() * .rollback() * .database('inventory-db', 'release-items') * .input({ data: { id: '$Step{reserve-inventory}{id}' } }) * .done() * .done() * .build(); * ``` */ import { IProductFeature, IProductFeatureStep, IFeatureOptions } from '../types'; import { IFeatureBuilder, IStepBuilder } from './types'; /** * Main feature builder class */ export declare class FeatureBuilder implements IFeatureBuilder { private featureConfig; private stepsArray; private signalsMap; private queriesMap; private envsArray; /** * Create a new FeatureBuilder * @param tag - Unique feature tag */ constructor(tag: string); name(name: string): IFeatureBuilder; description(description: string): IFeatureBuilder; input(input: Record): IFeatureBuilder; output(output: Record): IFeatureBuilder; options(options: IFeatureOptions): IFeatureBuilder; env(slug: string, active?: boolean): IFeatureBuilder; signal(name: string, input?: Record): IFeatureBuilder; query(name: string, handler?: string): IFeatureBuilder; step(tag: string): IStepBuilder; /** * Add a step to the feature (called by StepBuilder.done()) * @internal */ addStep(step: IProductFeatureStep): void; build(): IProductFeature; toSchema(): IProductFeature; } /** * Factory function to create a new FeatureBuilder * @param tag - Unique feature tag */ export declare function createFeature(tag: string): FeatureBuilder; export default FeatureBuilder;