Skip to content

Commit

Permalink
style: union with unknown collapses to unknown
Browse files Browse the repository at this point in the history
  • Loading branch information
enisdenjo committed Nov 4, 2020
1 parent 19844d7 commit 351963b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
11 changes: 6 additions & 5 deletions docs/interfaces/_types_.sink.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,19 @@ ___

### error

**error**(`error`: Error \| readonly GraphQLError[] \| unknown): void
**error**(`error`: unknown): void

An error that has occured. Calling this function "closes" the sink.
The error can be also `CloseEvent`, but to avoid bundling DOM typings
because the client can run in Node env too, you should assert
the close event type during implementation.
Besides the errors being `Error` and `readonly GraphQLError[]`, it
can also be a `CloseEvent`, but to avoid bundling DOM typings because
the client can run in Node env too, you should assert the close event
type during implementation.

#### Parameters:

Name | Type |
------ | ------ |
`error` | Error \| readonly GraphQLError[] \| unknown |
`error` | unknown |

**Returns:** void

Expand Down
2 changes: 2 additions & 0 deletions docs/modules/_types_.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
# Module: "types"

types

## Index

### Interfaces
Expand Down
11 changes: 5 additions & 6 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
*
*/

import { GraphQLError } from 'graphql';

/**
* ID is a string type alias representing
* the globally unique ID used for identifying
Expand All @@ -26,11 +24,12 @@ export interface Sink<T = unknown> {
next(value: T): void;
/**
* An error that has occured. Calling this function "closes" the sink.
* The error can be also `CloseEvent`, but to avoid bundling DOM typings
* because the client can run in Node env too, you should assert
* the close event type during implementation.
* Besides the errors being `Error` and `readonly GraphQLError[]`, it
* can also be a `CloseEvent`, but to avoid bundling DOM typings because
* the client can run in Node env too, you should assert the close event
* type during implementation.
*/
error(error: Error | readonly GraphQLError[] | unknown): void;
error(error: unknown): void;
/** The sink has completed. This function "closes" the sink. */
complete(): void;
}

0 comments on commit 351963b

Please sign in to comment.