// Copyright (c) 2025 TerraByte Inc. // // Defines the public interface for a Promise, which represents the eventual // completion (or failure) of an asynchronous operation and its resulting value. // This decouples the consumer from the implementation. using System; namespace Terra.Arbitrator.Promises { public enum PromiseState { Pending, Resolved, Rejected } public interface IPromise { /// /// Attaches a callback that will execute when the promise is successfully resolved. /// IPromise Then(Action onResolved); /// /// Attaches a callback that will execute when the promise is rejected. /// IPromise Catch(Action onRejected); /// /// Attaches a callback that will execute when the promise is settled (either resolved or rejected). /// void Finally(Action onFinally); } }