2021-10-26 00:59:41 +02:00
|
|
|
import { DeprecationError } from '../error'
|
2021-10-20 19:52:11 +02:00
|
|
|
import { FetchEvent } from '../spec-compliant/fetch-event'
|
|
|
|
import { NextRequest } from './request'
|
|
|
|
|
|
|
|
export class NextFetchEvent extends FetchEvent {
|
2021-10-26 17:03:39 +02:00
|
|
|
sourcePage: string
|
|
|
|
|
|
|
|
constructor(params: { request: NextRequest; page: string }) {
|
|
|
|
super(params.request)
|
|
|
|
this.sourcePage = params.page
|
|
|
|
}
|
|
|
|
|
|
|
|
// @ts-ignore
|
|
|
|
get request() {
|
|
|
|
throw new DeprecationError({
|
|
|
|
page: this.sourcePage,
|
|
|
|
})
|
2021-10-20 19:52:11 +02:00
|
|
|
}
|
2021-10-26 00:59:41 +02:00
|
|
|
|
|
|
|
respondWith() {
|
2021-10-26 17:03:39 +02:00
|
|
|
throw new DeprecationError({
|
|
|
|
page: this.sourcePage,
|
|
|
|
})
|
2021-10-26 00:59:41 +02:00
|
|
|
}
|
2021-10-20 19:52:11 +02:00
|
|
|
}
|