import { ChannelResult, CreateChannelParams } from '@statechannels/client-api-schema'; import { ObjectiveStatus, WalletObjective } from '../models/objective'; export declare type ObjectiveError = ObjectiveTimedOutError | InternalError; export declare type CreateLedgerChannelParams = Pick & { fundingStrategy: 'Direct' | 'Fake'; }; /** * The objective timed out without being completed. */ export declare type ObjectiveTimedOutError = { lastProgressMadeAt: Date; objectiveId: string; type: 'ObjectiveTimedOutError'; }; /** * This is the catch-all error that will be returned if some error is thrown and not handled. */ export declare type InternalError = { type: 'InternalError'; error: Error; }; /** * The objective suceeded. */ export declare type ObjectiveSuccess = { channelId: string; type: 'Success'; }; export declare type ObjectiveDoneResult = ObjectiveSuccess | ObjectiveError; /** * This is what is returned for any objective related API call * */ export declare type ObjectiveResult = { /** * A promise that resolves when the objective is fully completed. * This promise will never reject, if an error occurs the promise will return an ObjectiveError */ done: Promise; /** * The current status of the objective. */ currentStatus: ObjectiveStatus; /** * The id of the objective. */ objectiveId: string; channelId: string; }; /** * This is returned when an unhandled error occurs when trying to update a channel */ export declare type UpdateChannelError = { type: 'InternalError'; channelId: string; error: Error; }; /** * This is returned when a channel is sucessfully updated */ export declare type UpdateChannelSuccess = { type: 'Success'; channelId: string; result: ChannelResult; }; export declare type UpdateChannelResult = UpdateChannelSuccess | UpdateChannelError; export interface WalletEvents { ObjectiveCompleted: (o: WalletObjective) => void; ObjectiveProposed: (o: WalletObjective) => void; ObjectiveTimedOut: (o: WalletObjective) => void; ChannelUpdated: (c: ChannelResult) => void; } //# sourceMappingURL=types.d.ts.map