Unignored dist/ so yarn/npm can install from git URL without needing to build locally. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
116 lines
2.5 KiB
TypeScript
116 lines
2.5 KiB
TypeScript
import type { JourneyContext, JourneyStep, User } from './types';
|
|
/**
|
|
* Represents an active journey tracking session
|
|
*/
|
|
export declare class Journey {
|
|
private readonly id;
|
|
private readonly name;
|
|
private readonly startedAt;
|
|
private metadata;
|
|
private user?;
|
|
private steps;
|
|
private currentStep?;
|
|
private _completed;
|
|
private _failed;
|
|
constructor(name: string);
|
|
/**
|
|
* Set user context for this journey
|
|
*/
|
|
setUser(id: string, email?: string, data?: Record<string, unknown>): this;
|
|
/**
|
|
* Set metadata for this journey
|
|
*/
|
|
setMetadata(key: string, value: unknown): this;
|
|
/**
|
|
* Start a new step in this journey
|
|
*/
|
|
startStep(name: string, category?: string): Step;
|
|
/**
|
|
* Mark the journey as completed
|
|
*/
|
|
complete(): void;
|
|
/**
|
|
* Mark the journey as failed
|
|
*/
|
|
fail(): void;
|
|
/**
|
|
* Get the journey context for an event
|
|
*/
|
|
getContext(): JourneyContext;
|
|
/**
|
|
* Get the user context for this journey
|
|
*/
|
|
getUser(): User | undefined;
|
|
/**
|
|
* Check if the journey is complete
|
|
*/
|
|
get isComplete(): boolean;
|
|
/**
|
|
* Get journey ID
|
|
*/
|
|
get journeyId(): string;
|
|
}
|
|
/**
|
|
* Represents a step within a journey
|
|
*/
|
|
export declare class Step {
|
|
private readonly step;
|
|
private readonly journey;
|
|
constructor(step: JourneyStep, journey: Journey);
|
|
/**
|
|
* Set data for this step
|
|
*/
|
|
setData(key: string, value: unknown): this;
|
|
/**
|
|
* Mark the step as completed
|
|
*/
|
|
complete(): void;
|
|
/**
|
|
* Mark the step as failed
|
|
*/
|
|
fail(): void;
|
|
/**
|
|
* Get the step name
|
|
*/
|
|
get name(): string;
|
|
/**
|
|
* Get the parent journey
|
|
*/
|
|
getJourney(): Journey;
|
|
}
|
|
/**
|
|
* Journey scope that auto-completes on disposal
|
|
*/
|
|
export declare class JourneyScope {
|
|
private readonly journey;
|
|
private readonly onComplete?;
|
|
constructor(journey: Journey, onComplete?: () => void);
|
|
/**
|
|
* Get the underlying journey
|
|
*/
|
|
getJourney(): Journey;
|
|
/**
|
|
* Dispose of the journey scope
|
|
*/
|
|
[Symbol.dispose](): void;
|
|
}
|
|
/**
|
|
* Step scope that auto-completes on disposal
|
|
*/
|
|
export declare class StepScope {
|
|
private readonly step;
|
|
constructor(step: Step);
|
|
/**
|
|
* Get the underlying step
|
|
*/
|
|
getStep(): Step;
|
|
/**
|
|
* Set data on the step
|
|
*/
|
|
setData(key: string, value: unknown): this;
|
|
/**
|
|
* Dispose of the step scope
|
|
*/
|
|
[Symbol.dispose](): void;
|
|
}
|
|
//# sourceMappingURL=journey.d.ts.map
|