Skip to content

Commit

Permalink
documentation: types
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnaudBuchholz committed May 14, 2024
1 parent 41ab79a commit 90ae9c1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
20 changes: 17 additions & 3 deletions reserve/@types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ declare module 'reserve' {

// endregion use


// region helpers

function log (server: Server, verbose?: boolean): Server
Expand All @@ -151,8 +150,6 @@ declare module 'reserve' {

function body (request: IncomingMessage, options?: BodyOptions): BodyResult

function capture (response: ServerResponse, stream: WritableStream): Promise<void>

interface SendOptions {
statusCode?: number /* defaulted to 200 */
headers?: Headers
Expand All @@ -162,6 +159,23 @@ declare module 'reserve' {
function send (response: ServerResponse, data: ReadableStream, options?: SendOptions): Promise<void>
function send (response: ServerResponse, data?: string | object, options?: SendOptions): void

function capture (response: ServerResponse, stream: WritableStream): Promise<void>

interface PunycacheOptions {
ttl?: number
max?: number
policy?: 'lru' | 'lfu'
}

interface PunycacheCache {
set (key: string, value: any): void
get (key: string): any
del (key: string): void
keys (): string[]
}

function punycache (options?: PunycacheOptions): PunycacheCache

// endregion helpers

interface SSLSettings {
Expand Down
2 changes: 1 addition & 1 deletion reserve/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
||`static` option for performant `file` delivery ([`doc`](file.md))|
||Expose `send` helper ([doc](send.md))|
||Expose `punycache` helper ([doc](https://www.npmjs.com/package/punycache))|
||Fix types definition (`use` handler)|
||Fix types definitions|
|1.15.9|Documentation update|
|1.15.8|Fix types definition (UseMapping)|
|1.15.7|Fix types definition (UseMapping)|
Expand Down

0 comments on commit 90ae9c1

Please sign in to comment.