import { Objective, OpenChannel, CloseChannel, SharedObjective, SubmitChallenge, DefundChannel } from '@statechannels/wallet-core'; import { Model, TransactionOrKnex } from 'objection'; import { WaitingFor } from '../objectives/objective-manager'; export declare type ObjectiveStatus = 'pending' | 'approved' | 'rejected' | 'failed' | 'succeeded'; /** * A WalletObjective is a wire objective with a status, waitingFor state-string, timestamps and an objectiveId * * Limited to 'OpenChannel', 'CloseChannel', 'SubmitChallenge' and 'DefundChannel' which are the only objectives * that are currently supported by the server wallet * */ declare type ExtraProperties = { objectiveId: string; status: ObjectiveStatus; waitingFor: WaitingFor; createdAt: Date; progressLastMadeAt: Date; }; export declare type WalletObjective = O & ExtraProperties; export declare function isSharedObjective(objective: WalletObjective): objective is WalletObjective | WalletObjective; declare type SupportedObjective = OpenChannel | CloseChannel | SubmitChallenge | DefundChannel; export declare function isSupportedObjective(o: Objective): o is SupportedObjective; export declare const toWireObjective: (dbObj: WalletObjective) => SharedObjective; export declare class ObjectiveChannelModel extends Model { readonly objectiveId: string; readonly channelId: string; static tableName: string; static get idColumn(): string[]; } export declare class ObjectiveModel extends Model { readonly objectiveId: ExtraProperties['objectiveId']; readonly status: ExtraProperties['status']; readonly type: SupportedObjective['type']; readonly data: SupportedObjective['data']; readonly waitingFor: ExtraProperties['waitingFor']; createdAt: Date; progressLastMadeAt: Date; static tableName: string; static get idColumn(): string[]; static get relationMappings(): { objectivesChannels: { relation: import("objection").RelationType; modelClass: any; join: { from: string; through: { from: string; to: string; }; to: string; }; }; }; static insert(objectiveToBeStored: O, tx: TransactionOrKnex, approvalStatus?: 'approved' | 'pending', waitingFor?: WaitingFor): Promise>; static forId(objectiveId: string, tx: TransactionOrKnex): Promise>; static forIds(objectiveIds: string[], tx: TransactionOrKnex): Promise; static approve(objectiveId: string, tx: TransactionOrKnex): Promise>; static succeed(objectiveId: string, tx: TransactionOrKnex): Promise; static failed(objectiveId: string, tx: TransactionOrKnex): Promise; static updateProgressDate(objectiveId: string, tx: TransactionOrKnex): Promise>; static updateWaitingFor(objectiveId: string, waitingFor: WaitingFor, tx: TransactionOrKnex): Promise>; static approvedObjectiveIds(targetChannelIds: string[], tx: TransactionOrKnex): Promise; static forChannelIds(targetChannelIds: string[], tx: TransactionOrKnex): Promise; toObjective(): WalletObjective; } export {}; //# sourceMappingURL=objective.d.ts.map