File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import { hasFormComponents, slugSchema } from '@defra/forms-model'
66import Boom from '@hapi/boom'
77import {
88 type Plugin ,
9+ type PluginProperties ,
910 type ResponseObject ,
1011 type ResponseToolkit ,
1112 type RouteOptions ,
@@ -95,9 +96,7 @@ export interface PluginOptions {
9596 baseLayoutPath : string
9697 paths : string [ ]
9798 }
98- viewContext : (
99- request : FormRequest | FormRequestPayload | null
100- ) => Promise < Record < string , unknown > >
99+ viewContext : PluginProperties [ 'forms-engine-plugin' ] [ 'viewContext' ]
101100}
102101
103102export const plugin = {
Original file line number Diff line number Diff line change @@ -5,7 +5,6 @@ import { type ServerYar, type Yar } from '@hapi/yar'
55import { type Logger } from 'pino'
66
77import { type FormModel } from '~/src/server/plugins/engine/models/index.js'
8- import { type context } from '~/src/server/plugins/engine/nunjucks.js'
98import {
109 type FormRequest ,
1110 type FormRequestPayload
@@ -22,7 +21,9 @@ declare module '@hapi/hapi' {
2221 'forms-engine-plugin' : {
2322 baseLayoutPath : string
2423 cacheService : CacheService
25- viewContext : context
24+ viewContext ?: (
25+ request : FormRequest | FormRequestPayload | null
26+ ) => Record < string , unknown > | Promise < Record < string , unknown > >
2627 }
2728 }
2829
You can’t perform that action at this time.
0 commit comments