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

feat: add flow types #43

Merged
merged 19 commits into from
Mar 3, 2020
Merged

feat: add flow types #43

merged 19 commits into from
Mar 3, 2020

Conversation

skeggse
Copy link
Member

@skeggse skeggse commented Feb 25, 2020

These are incomplete, but cover common surface area.

Also restricts published files:

@@ -2,26 +2,13 @@
 npm notice
 npm notice 📦  mongoist@2.4.0
 npm notice === Tarball Contents ===
-npm notice 112B   .babelrc
-npm notice 209B   .editorconfig
-npm notice 11B    .eslintignore
-npm notice 452B   .eslintrc
-npm notice 67B    .jsbeautifyrc
 npm notice 771B   LICENSE
 npm notice 16.5kB index.js.flow
 npm notice 3.5kB  lib/bulk.js
-npm notice 5.5kB  test/bulk.js
 npm notice 5.6kB  lib/collection.js
-npm notice 9.8kB  test/collection.js
 npm notice 3.3kB  lib/cursor.js
-npm notice 8.1kB  test/cursor.js
 npm notice 6.6kB  lib/database.js
-npm notice 9.2kB  test/database.js
 npm notice 1.7kB  index.js
-npm notice 823B   test/index.js
-npm notice 1.4kB  package.json
+npm notice 1.5kB  package.json
 npm notice 7.5kB  CHANGELOG.md
-npm notice 3.2kB  CODE_OF_CONDUCT.md
-npm notice 2.1kB  CONTRIBUTING.md
 npm notice 15.8kB README.md
-npm notice 715B   .travis.yml

Fixes #42

These are incomplete, but cover common surface area.
index.js.flow Outdated Show resolved Hide resolved
distinct<FieldType>(field: string, query: Query): Promise<FieldType[]>;
insert: typeof Collection.prototype.insertOne & typeof Collection.prototype.insertMany;
insertOne<Doc>(doc: Doc, options?: InsertOptions): Promise<$Call<AddObjectIDField, Doc>>;
insertMany<Docs>(docs: Docs, options?: InsertOptions): Promise<$TupleMap<Docs, AddObjectIDField>>;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@shils shils left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. It'd be good to test these definitions on some sample codebases, to identify any usability/adoption issues.

@skeggse skeggse requested a review from shils February 28, 2020 17:16
index.js.flow Outdated Show resolved Hide resolved
@@ -453,53 +451,66 @@ export type Projection = {
...
};

type AggregationUpdate = (
type AggregationUpdate = $ReadOnlyArray<
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

index.js.flow Outdated Show resolved Hide resolved
@skeggse skeggse merged commit 37a3c4c into master Mar 3, 2020
@skeggse skeggse deleted the add-flow-types branch March 3, 2020 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Export flow types
2 participants