Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 20 additions & 6 deletions types/hapi__hapi/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ export interface Request extends Podium {
* Application-specific state. Provides a safe place to store application data without potential conflicts with the framework. Should not be used by plugins which should use plugins[name].
* [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-requestapp)
*/
app: ApplicationState;
app: RequestApplicationState;

/**
* Authentication information:
Expand Down Expand Up @@ -671,7 +671,7 @@ export interface ResponseObject extends Podium {
* Application-specific state. Provides a safe place to store application data without potential conflicts with the framework. Should not be used by plugins which should use plugins[name].
* [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-responseapp)
*/
app: ApplicationState;
app: ResponseApplicationState;

/**
* Access: read only and the public podium interface.
Expand Down Expand Up @@ -2703,7 +2703,7 @@ export interface ServerInjectOptions extends Shot.RequestOptions {
/**
* sets the initial value of request.app, defaults to {}.
*/
app?: ApplicationState;
app?: RequestApplicationState;
/**
* sets the initial value of request.plugins, defaults to {}.
*/
Expand Down Expand Up @@ -3405,7 +3405,7 @@ export class Server {
* Initialized with an empty object.
* [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-serverapp)
*/
app: ApplicationState;
app: ServerApplicationState;

/**
* Server Auth: properties and methods
Expand Down Expand Up @@ -3969,10 +3969,24 @@ export class Server {
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */

/**
* User-extensible type for application specific state.
* User-extensible type for application specific state (`server.app`).
*/
/* tslint:disable-next-line:no-empty-interface */
export interface ApplicationState {
export interface ServerApplicationState {
}

/**
* User-extensible type for application specific state on requests (`request.app`).
*/
/* tslint:disable-next-line:no-empty-interface */
export interface RequestApplicationState {
}

/**
* User-extensible type for application specific state on responses (`response.app`).
*/
/* tslint:disable-next-line:no-empty-interface */
export interface ResponseApplicationState {
}

export type PeekListener = (chunk: string, encoding: string) => void;
Expand Down
2 changes: 1 addition & 1 deletion types/hapi__hapi/test/server/server-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const options: ServerOptions = {

declare module "@hapi/hapi" {
// Demonstrate augmenting the application state.
interface ApplicationState {
interface ServerApplicationState {
key?: string;
}
}
Expand Down