-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
roundly cleanup of types and docs (#3455)
* move Fallthrough to endpoint * remove Rec helper * update docs * sync changes from docs * expose polyfill function for adapters * simplify and fix 'module' imported multiple times * fix eslint forbidden for simple types * rename request to event * use mdn permalink * remove unused
- Loading branch information
1 parent
3da6b4e
commit 799f1bc
Showing
15 changed files
with
101 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
declare module 'APP' { | ||
import { App } from '@sveltejs/kit'; | ||
export { App }; | ||
export { App } from '@sveltejs/kit'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,18 @@ | ||
import { RequestEvent } from './hooks'; | ||
import { JSONString, MaybePromise, ResponseHeaders, Either, Fallthrough } from './helper'; | ||
import { Either, JSONString, MaybePromise, ResponseHeaders } from './helper'; | ||
|
||
type DefaultBody = JSONString | Uint8Array; | ||
type Body = JSONString | Uint8Array | ReadableStream | import('stream').Readable; | ||
|
||
export interface EndpointOutput<Body extends DefaultBody = DefaultBody> { | ||
export interface EndpointOutput { | ||
status?: number; | ||
headers?: Headers | Partial<ResponseHeaders>; | ||
body?: Body; | ||
} | ||
|
||
export interface RequestHandler< | ||
Locals = Record<string, any>, | ||
Output extends DefaultBody = DefaultBody | ||
> { | ||
(request: RequestEvent<Locals>): MaybePromise< | ||
Either<Response | EndpointOutput<Output>, Fallthrough> | ||
>; | ||
export interface Fallthrough { | ||
fallthrough: true; | ||
} | ||
|
||
export interface RequestHandler<Locals = Record<string, any>> { | ||
(event: RequestEvent<Locals>): MaybePromise<Either<Response | EndpointOutput, Fallthrough>>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters