Skip to content

Commit

Permalink
fix: improve exposed API (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
andogq authored May 7, 2024
2 parents 2db938b + 7d01214 commit 741e3de
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/pink-vans-exercise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"windpipe": patch
---

Improve exported API and generated docs
29 changes: 27 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"lint": "tsc && eslint .",
"format": "eslint --fix .",
"build": "tsup ./src/index.ts",
"doc": "typedoc ./src --media ./media --plugin typedoc-plugin-extras --favicon ./media/favicon.ico --footerLastModified true --plugin typedoc-material-theme --themeColor '#03284e'",
"doc": "typedoc ./src --media ./media --plugin typedoc-plugin-extras --favicon ./media/favicon.ico --footerLastModified true --plugin typedoc-material-theme --themeColor '#03284e' --plugin typedoc-plugin-rename-defaults",
"test": "vitest",
"ci:release": "npm run build && changeset publish"
},
Expand Down Expand Up @@ -56,6 +56,7 @@
"typedoc": "^0.25.7",
"typedoc-material-theme": "^1.0.2",
"typedoc-plugin-extras": "^3.0.0",
"typedoc-plugin-rename-defaults": "^0.7.0",
"typescript": "^5.3.3",
"typescript-eslint": "^7.6.0",
"vitest": "^1.2.0"
Expand Down
15 changes: 12 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
import { Stream } from "./stream";

// Export all useful types for atoms
export type { Atom, AtomOk, AtomError, AtomUnknown } from "./atom";
export type {
Atom,
AtomOk,
AtomError,
AtomUnknown,
VALUE,
ERROR,
UNKNOWN,
MaybeAtom,
} from "./atom";

// Re-export all utility types
export type * from "./util";
// Re-export useful utility types
export type { MaybePromise, Truthy, CallbackOrStream } from "./util";

// Export the `StreamEnd` type
export type { StreamEnd } from "./stream";
Expand Down
4 changes: 4 additions & 0 deletions src/stream/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ import { HigherOrderStream } from "./higher-order";

export type { StreamEnd } from "./base";

/**
* @template T - Type of the 'values' on the stream.
* @template E - Type of the 'errors' on the stream.
*/
export class Stream<T, E> extends HigherOrderStream<T, E> {
// Re-export atom utilities for convenience
/**
Expand Down

0 comments on commit 741e3de

Please sign in to comment.