declare type Option = { /** Returns value if `Option` is `some`. Will throw if `Option` is `none`. */ unwrap(): DataType; /** Returns value of `Option` if it is `some`. If `Option` is `none` it will return the value of the `or` parameter. */ unwrapOr(or: DataType): DataType; /** Returns value of `Option` if it is `some`. If `Option` is `none` it will run the `orElse` function. */ unwrapOrElse(orElse: () => DataType): DataType; /** Returns value of `Option` if it is `some`. If `Option` is `none` it will run the `orElse` function. **Might be removed later** */ unwrapOrElseAsync(orElse: () => Promise): Promise; match(matchers: { some(data: DataType): MatchExpressionType; none(): MatchExpressionType; }): MatchExpressionType; /** Returns `true` if the `Option` is `some`. */ isSome(): boolean; /** Returns `true` if the `Option` is `none`. */ isNone(): boolean; /** Run a function that replaces the value of `some`. Will do nothing on `none` */ map(fn: (data: DataType) => FnReturnType): Option; /** Run a function that replaces the value of `some`. Will replace `none` with `some` holding `or`. */ mapOr(fn: (data: DataType) => FnReturnType, or: FnReturnType): FnReturnType; /** Run a function that replaces the value of `some`. Will replace `none` with `some` holding return value of `orElse` function. */ mapOrElse(fn: (data: DataType) => FnReturnType, orElse: () => FnReturnType): FnReturnType; /** Returns `none` if `Option` is `none`. Will return `some` with value if `predicate` is `true`, else it will return `none`. */ filter(predicate: (data: DataType) => boolean): Option; /** Returns `none` if `Option` is `none`. Will return `some` with value if `predicate` is `true`, else it will return `none`. **Might be removed later** */ filterAsync(predicate: (data: DataType) => Promise): Promise>; /** Returns a new `Option` with the original value and the value of provided option. If either option is `none` it will return `none`. */ zip(option: Option): Option<[DataType, SecondDataType]>; /** Returns none if any is `none`, else return second option */ and(option: Option): Option; /** Returns none if any is `none`, else returns result of provided function. Some languages call this function `flatMap`. **Might be removed later** */ andThen(fn: (data: DataType) => Option): Option; /** Returns none if any is `none`, else returns result of provided function. Some languages call this function `flatMap` */ andThenAsync(fn: (data: DataType) => Promise>): Promise>; /** Returns first `Option` if it is `some`, else provided `Option` */ or(option: Option): Option; /** Returns first `Option` if it is `some`, else returns result of provided function */ orElse(fn: () => Option): Option; /** Returns true if the `Option` is `some` and holds a value equal to the given value */ contains(data: DataType): boolean; /** Returns a string representation of the `Option`, mostly meant for debugging */ toString(): string; /** Opts out of option. Will give you the value typed as `T | null`. */ optOut(): DataType | null; }; export type { Option };