Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: improve exposed API #19

Merged
merged 5 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
13 changes: 11 additions & 2 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
andogq marked this conversation as resolved.
Show resolved Hide resolved
export type * from "./util";
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
Loading