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.
14 lines (11 loc) • 645 B
text/typescript
import { RequestCookies, RequestCookie } from 'next/dist/compiled/@edge-runtime/cookies/index.js';
import { Mock } from 'vitest';
declare class RequestCookiesMock extends RequestCookies {
get: Mock<(...args: [name: string] | [RequestCookie]) => RequestCookie | undefined>;
getAll: Mock<(...args: [name: string] | [RequestCookie] | []) => RequestCookie[]>;
has: Mock<(name: string) => boolean>;
set: Mock<(...args: [key: string, value: string] | [options: RequestCookie]) => this>;
delete: Mock<(names: string | string[]) => boolean | boolean[]>;
}
declare const cookies: Mock<() => RequestCookiesMock>;
export { cookies };