0.1.4Updated 6 months ago
declare namespace Supply {
  type Events = {
    /**
     * Event for adding an entry to the ledger.
     * 
     * @param entry_values All values passed to the creation of the new entry
     */
    'item_created': [Ledger.Ledger<any>]
  
    /**
     * Event for adding an entry to the ledger.
     * 
     * @param entry_values All values passed to the creation of the new entry
     */
    'item_allotted': [entry: Omit<Ledger.Entry, 'id' | 'timestamp'>]
  
    /**
     * Event for adding an entry to the ledger.
     * 
     * @param reason Why this entry could not be created
     */
    'item_allotment_failed': [reason: string, entry: Omit<Ledger.Entry, 'id' | 'timestamp'>]
  }

  namespace Events {
    type FailMethod = (reason?: string) => void
  }
}