/* tslint:disable */
/* eslint-disable */
/**
* The type of option to be priced (call or put).
*/
export enum OptionType {
  Call = 0,
  Put = 1,
}
/**
* The inputs to the Black76 model.
*/
export class Inputs {
/**
** Return copy of self without private attributes.
*/
  toJSON(): Object;
/**
* Return stringified version of self.
*/
  toString(): string;
  free(): void;
/**
* Calculates the delta of the option.
* # Requires
* f, k, r, t, sigma
* # Returns
* f32 of the delta of the option.
* # Example
* ```
* use black76::{Inputs, OptionType, Greeks};
* let inputs = Inputs::new(OptionType::Call, 100.0, 100.0, None, 0.05, 20.0/365.25, Some(0.2));
* let delta = inputs.calc_delta().unwrap();
* ```
* @returns {number}
*/
  calc_delta(): number;
/**
* Calculates the gamma of the option.
* # Requires
* f, k, r, t, sigma
* # Returns
* f32 of the gamma of the option.
* # Example
* ```
* use black76::{Inputs, OptionType, Greeks};
* let inputs = Inputs::new(OptionType::Call, 100.0, 100.0, None, 0.05, 20.0/365.25, Some(0.2));
* let gamma = inputs.calc_gamma().unwrap();
* ```
* @returns {number}
*/
  calc_gamma(): number;
/**
* Calculates the theta of the option.
* Uses 365.25 days in a year for calculations.
* # Requires
* f, k, r, t, sigma
* # Returns
* f32 of theta per day (not per year).
* # Example
* ```
* use black76::{Inputs, OptionType, Greeks};
* let inputs = Inputs::new(OptionType::Call, 100.0, 100.0, None, 0.05, 20.0/365.25, Some(0.2));
* let theta = inputs.calc_theta().unwrap();
* ```
* @returns {number}
*/
  calc_theta(): number;
/**
* Calculates the vega of the option.
* # Requires
* f, k, r, t, sigma
* # Returns
* f32 of the vega of the option.
* # Example
* ```
* use black76::{Inputs, OptionType, Greeks};
* let inputs = Inputs::new(OptionType::Call, 100.0, 100.0, None, 0.05, 20.0/365.25, Some(0.2));
* let vega = inputs.calc_vega().unwrap();
* ```
* @returns {number}
*/
  calc_vega(): number;
/**
* Calculates the rho of the option.
* # Requires
* f, k, r, t, sigma
* # Returns
* f32 of the rho of the option.
* # Example
* ```
* use black76::{Inputs, OptionType, Greeks};
* let inputs = Inputs::new(OptionType::Call, 100.0, 100.0, None, 0.05, 20.0/365.25, Some(0.2));
* let rho = inputs.calc_rho().unwrap();
* ```
* @returns {number}
*/
  calc_rho(): number;
/**
* Calculates the epsilon of the option.
* # Requires
* f, k, r, t, sigma
* # Returns
* f32 of the epsilon of the option.
* # Example
* ```
* use black76::{Inputs, OptionType, Greeks};
* let inputs = Inputs::new(OptionType::Call, 100.0, 100.0, None, 0.05, 20.0/365.25, Some(0.2));
* let epsilon = inputs.calc_epsilon().unwrap();
* ```
* @returns {number}
*/
  calc_epsilon(): number;
/**
* Calculates the lambda of the option.
* # Requires
* s, k, r, t, sigma
* # Returns
* f32 of the lambda of the option.
* # Example
* ```
* use black76::{Inputs, OptionType, Greeks, Pricing};
* let inputs = Inputs::new(OptionType::Call, 100.0, 100.0, None, 0.05, 20.0/365.25, Some(0.2));
* let lambda = inputs.calc_lambda().unwrap();
* ```
* @returns {number}
*/
  calc_lambda(): number;
/**
* Calculates the vanna of the option.
* # Requires
* f, k, r, t, sigma
* # Returns
* f32 of the vanna of the option.
* # Example
* ```
* use black76::{Inputs, OptionType, Greeks};
* let inputs = Inputs::new(OptionType::Call, 100.0, 100.0, None, 0.05, 20.0/365.25, Some(0.2));
* let vanna = inputs.calc_vanna().unwrap();
* ```
* @returns {number}
*/
  calc_vanna(): number;
/**
* ```
* use black76::{Inputs, OptionType, Greeks};
* let inputs = Inputs::new(OptionType::Call, 100.0, 100.0, None, 0.05, 20.0/365.25, Some(0.2));
* let charm = inputs.calc_charm().unwrap();
* ```
* @returns {number}
*/
  calc_charm(): number;
/**
* Calculates the veta of the option.
* # Requires
* f, k, r, t, sigma
* # Returns
* f32 of the veta of the option.
* # Example
* ```
* use black76::{Inputs, OptionType, Greeks};
* let inputs = Inputs::new(OptionType::Call, 100.0, 100.0, None, 0.05, 20.0/365.25, Some(0.2));
* let veta = inputs.calc_veta().unwrap();
* ```
* @returns {number}
*/
  calc_veta(): number;
/**
* Calculates the vomma of the option.
* # Requires
* f, k, r, t, sigma
* # Returns
* f32 of the vomma of the option.
* # Example
* ```
* use black76::{Inputs, OptionType, Greeks};
* let inputs = Inputs::new(OptionType::Call, 100.0, 100.0, None, 0.05, 20.0/365.25, Some(0.2));
* let vomma = inputs.calc_vomma().unwrap();
* ```
* @returns {number}
*/
  calc_vomma(): number;
/**
* Calculates the speed of the option.
* # Requires
* f, k, r, t, sigma
* # Returns
* f32 of the speed of the option.
* # Example
* ```
* use black76::{Inputs, OptionType, Greeks};
* let inputs = Inputs::new(OptionType::Call, 100.0, 100.0, None, 0.05, 20.0/365.25, Some(0.2));
* let speed = inputs.calc_speed().unwrap();
* ```
* @returns {number}
*/
  calc_speed(): number;
/**
* Calculates the zomma of the option.
* # Requires
* f, k, r, t, sigma
* # Returns
* f32 of the zomma of the option.
* # Example
* ```
* use black76::{Inputs, OptionType, Greeks};
* let inputs = Inputs::new(OptionType::Call, 100.0, 100.0, None, 0.05, 20.0/365.25, Some(0.2));
* let zomma = inputs.calc_zomma().unwrap();
* ```
* @returns {number}
*/
  calc_zomma(): number;
/**
* Calculates the color of the option.
* # Requires
* f, k, r, t, sigma
* # Returns
* f32 of the color of the option.
* # Example
* ```
* use black76::{Inputs, OptionType, Greeks};
* let inputs = Inputs::new(OptionType::Call, 100.0, 100.0, None, 0.05, 20.0/365.25, Some(0.2));
* let color = inputs.calc_color().unwrap();
* ```
* @returns {number}
*/
  calc_color(): number;
/**
* Calculates the ultima of the option.
* # Requires
* f, k, r, t, sigma
* # Returns
* f32 of the ultima of the option.
* # Example
* ```
* use black76::{Inputs, OptionType, Greeks};
* let inputs = Inputs::new(OptionType::Call, 100.0, 100.0, None, 0.05, 20.0/365.25, Some(0.2));
* let ultima = inputs.calc_ultima().unwrap();
* ```
* @returns {number}
*/
  calc_ultima(): number;
/**
* Calculates the dual delta of the option.
* # Requires
* f, k, r, t, sigma
* # Returns
* f32 of the dual delta of the option.
* # Example
* ```
* use black76::{Inputs, OptionType, Greeks};
* let inputs = Inputs::new(OptionType::Call, 100.0, 100.0, None, 0.05, 20.0/365.25, Some(0.2));
* let dual_delta = inputs.calc_dual_delta().unwrap();
* ```
* @returns {number}
*/
  calc_dual_delta(): number;
/**
* Calculates the dual gamma of the option.
* # Requires
* f, k, r, t, sigma
* # Returns
* f32 of the dual gamma of the option.
* # Example
* ```
* use black76::{Inputs, OptionType, Greeks};
* let inputs = Inputs::new(OptionType::Call, 100.0, 100.0, None, 0.05, 20.0/365.25, Some(0.2));
* let dual_gamma = inputs.calc_dual_gamma().unwrap();
* ```
* @returns {number}
*/
  calc_dual_gamma(): number;
/**
* Calculates all Greeks of the option.
* # Requires
* f, k, r, t, sigma
* # Returns
* HashMap of type <String, f32> of all Greeks of the option.
* # Example
* ```
* use black76::{Inputs, OptionType, Greeks};
* let inputs = Inputs::new(OptionType::Call, 100.0, 100.0, None, 0.05, 20.0/365.25, Some(0.2));
* let greeks = inputs.calc_all_greeks().unwrap();
* ```
* @returns {string}
*/
  calc_all_greeks(): string;
/**
* Calculates the implied volatility of the option.
* Tolerance is the max error allowed for the implied volatility,
* the lower the tolerance the more iterations will be required.
* Recommended to be a value between 0.001 - 0.0001 for highest efficiency/accuracy.
* Initializes estimation of sigma using Brenn and Subrahmanyam (1998) method of calculating initial iv estimation.
* Uses Newton Raphson algorithm to calculate implied volatility.
* # Requires
* f, k, r, t, p
* # Returns
* f32 of the implied volatility of the option.
* # Example:
* ```
* use black76_wasm::{Inputs, OptionType, ImpliedVolatility};
* let inputs = Inputs::new(OptionType::Call, 100.0, 100.0, Some(0.2), 0.05, 20.0/365.25, None);
* let iv = inputs.calc_iv(0.0001).unwrap();
* ```
* Initial estimation of sigma using Modified Corrado-Miller from ["A MODIFIED CORRADO-MILLER IMPLIED VOLATILITY ESTIMATOR" (2007) by Piotr P√luciennik](https://sin.put.poznan.pl/files/download/37938) method of calculating initial iv estimation.
* Note: While this method is more accurate than Brenn and Subrahmanyam (1998) it will still sometimes fail to converge.
* An example of failure to converge:
* ```
* use black76_wasm::{Inputs, OptionType, ImpliedVolatility};
* let inputs = Inputs::new(OptionType::Call, 105.0, 100.0, Some(30.0), 0.05, 30.0 / 365.25, None).calc_iv(0.0001).unwrap();
* // This will fail to converge, the NaN sigma value is checked in the function and will return an error.
* assert(inputs.calc_iv(0.0001).is_err(), true);
* ```
* @param {number} tolerance
* @returns {number}
*/
  calc_iv(tolerance: number): number;
/**
* Creates instance ot the `Inputs` struct.
* # Arguments
* * `option_type` - The type of option to be priced.
* * `f` - The current price of the underlying asset.
* * `k` - The strike price of the option.
* * `p` - The dividend yield of the underlying asset.
* * `r` - The risk-free interest rate.
* * `t` - The time to maturity of the option in years.
* * `sigma` - The volatility of the underlying asset.
* # Example
* ```
* use black76::{Inputs, OptionType};
* let inputs = Inputs::new(OptionType::Call, 100.0, 100.0, None, 0.05, 20.0/365.25, Some(0.2));
* ```
* # Returns
* An instance of the `Inputs` struct.
* @param {number} option_type
* @param {number} f
* @param {number} k
* @param {number | undefined} p
* @param {number} r
* @param {number} t
* @param {number | undefined} sigma
*/
  constructor(option_type: number, f: number, k: number, p: number | undefined, r: number, t: number, sigma?: number);
/**
* Calculates the price of the option.
* # Requires
* f, k, r, q, t, sigma.
* # Returns
* f32 of the price of the option.
* # Example
* ```
* use black76::{Inputs, OptionType, Pricing};
* let inputs = Inputs::new(OptionType::Call, 100.0, 100.0, None, 0.05, 20.0/365.25, Some(0.2));
* let price = inputs.calc_price().unwrap();
* ```
* @returns {number}
*/
  calc_price(): number;
/**
* Futures price
*/
  f: number;
/**
* Strike price
*/
  k: number;
/**
* The type of the option (call or put)
*/
  option_type: number;
/**
* Option price
*/
  p?: number;
/**
* Risk-free rate
*/
  r: number;
/**
* Volatility
*/
  sigma?: number;
/**
* Time to maturity in years
*/
  t: number;
}
