Skip to content

Commit

Permalink
add docs for exported symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
jarvisjiang committed May 14, 2024
1 parent 58939f8 commit d486ee3
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,23 @@ export { None, Some, type Option } from './enum/option.ts';
export { Err, Ok, type Result } from './enum/result.ts';

// export some commonly used types

/**
* The shorthand of Promise<Option<T>>.
*/
export type AsyncOption<T> = Promise<Option<T>>;

/**
* The shorthand of Promise<Result<T, E>>.
*/
export type AsyncResult<T, E> = Promise<Result<T, E>>;

/**
* The shorthand of Result<T, Error>.
*/
export type IOResult<T> = Result<T, Error>;

/**
* The shorthand of Promise<Result<T, Error>>.
*/
export type AsyncIOResult<T> = Promise<IOResult<T>>;

0 comments on commit d486ee3

Please sign in to comment.