vite-plugin-storybook-nextjs
Version:
This is a Vite plugin that allows you to use Next.js features in Vite. It is the basis for `@storybook/experimental-nextjs-vite` and should be used when running portable stories in Vitest.
22 lines (19 loc) • 817 B
TypeScript
import { HeadersAdapter } from 'next/dist/server/web/spec-extension/adapters/headers.js';
import { Mock } from 'vitest';
declare class HeadersAdapterMock extends HeadersAdapter {
constructor();
append: Mock<(name: string, value: string) => void>;
delete: Mock<(name: string) => void>;
get: Mock<(name: string) => string | null>;
has: Mock<(name: string) => boolean>;
set: Mock<(name: string, value: string) => void>;
forEach: Mock<(callbackfn: (value: string, name: string, parent: Headers) => void, thisArg?: any) => void>;
entries: Mock<() => IterableIterator<[string, string]>>;
keys: Mock<() => IterableIterator<string>>;
values: Mock<() => IterableIterator<string>>;
}
declare const headers: {
(): HeadersAdapterMock;
mockRestore(): void;
};
export { headers };