123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- declare module "@sapper/app" {
- import { PageData } from "src/utils/session";
- // from sapper/runtime/src/app/types.ts
- // sapper doesn't export its types yet
- interface Redirect {
- statusCode: number
- location: string
- }
- // end
- function goto(href: string, opts?: { replaceState: boolean }): Promise<unknown>
- function prefetch(href: string): Promise<{ redirect?: Redirect; data?: unknown }>
- function prefetchRoutes(pathnames: string[]): Promise<unknown>
- function start(opts: { target: Element | null }): Promise<unknown>
- const stores: () => {
- page: PageStore<PageData>,
- preloading: boolean,
- session: Writable<unknown>
- };
- export {
- goto, prefetch, prefetchRoutes, start, stores,
- };
- }
- declare module "@sapper/server" {
- import { RequestHandler } from "express";
- interface MiddlewareOptions {
- session?: (req: Express.Request, res: Express.Response) => unknown
- ignore?: unknown
- }
- function middleware(opts?: MiddlewareOptions): RequestHandler
- export { middleware };
- }
- declare module "@sapper/service-worker" {
- const timestamp: number;
- const files: string[];
- const shell: string[];
- const routes: { pattern: RegExp }[];
- export {
- timestamp, files, files as assets, shell, routes,
- };
- }
|