-
Notifications
You must be signed in to change notification settings - Fork 74
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(daemon): Strengthen type checks #1832
Changes from all commits
10c82b3
163bd88
89f6554
6d0bb32
29a9f5c
a470ce6
83b3be4
2f8aa51
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
// @ts-check | ||
|
||
const { quote: q } = assert; | ||
|
||
const validNamePattern = /^[a-z][a-z0-9-]{0,127}$/; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
// @ts-check | ||
|
||
import { makeNetstringCapTP } from './connection.js'; | ||
|
||
const { quote: q } = assert; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
// @ts-check | ||
|
||
import { E } from '@endo/far'; | ||
import { mapReader, mapWriter } from '@endo/stream'; | ||
import { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,15 @@ | ||
export interface AsyncQueue<TValue> { | ||
export interface AsyncSink<TValue> { | ||
put(value: TValue | Promise<TValue>): void; | ||
} | ||
|
||
export interface AsyncSpring<TValue> { | ||
get(): Promise<TValue>; | ||
} | ||
|
||
export interface AsyncQueue<TSpringValue, TSinkValue = TSpringValue> | ||
extends AsyncSpring<TSpringValue>, | ||
AsyncSink<TSinkValue> {} | ||
|
||
// Stream is nearly identical to AsyncGenerator and AsyncGenerator should | ||
// probably be identical to this definition of Stream. | ||
// Stream does not make the mistake of conflating the read and write return | ||
|
@@ -40,8 +47,8 @@ export declare function makeStream< | |
TReadReturn = undefined, | ||
TWriteReturn = undefined, | ||
>( | ||
acks: AsyncQueue<IteratorResult<TRead, TReadReturn>>, | ||
data: AsyncQueue<IteratorResult<TWrite, TWriteReturn>>, | ||
acks: AsyncSpring<IteratorResult<TRead, TReadReturn>>, | ||
data: AsyncSink<IteratorResult<TWrite, TWriteReturn>>, | ||
Comment on lines
+50
to
+51
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I imagine @mhofman will be interested in this relaxation of the signature of |
||
): Stream<TRead, TWrite, TReadReturn, TWriteReturn>; | ||
|
||
export declare function makePipe< | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inconsistent types (see comment below)
here
Promise<never>