@enonic/nextjs-adapter 1.0.0-RC1 → 1.0.0-RC2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enonic/nextjs-adapter",
3
- "version": "1.0.0-RC1",
3
+ "version": "1.0.0-RC2",
4
4
  "license": "Apache-2.0",
5
5
  "main": "index.js",
6
6
  "publishConfig": {
@@ -0,0 +1,26 @@
1
+ import { CacheHandler, CacheHandlerContext, CacheHandlerValue } from 'next/dist/server/lib/incremental-cache';
2
+ import { CacheFs } from 'next/dist/shared/lib/utils';
3
+ type FileSystemCacheContext = Omit<CacheHandlerContext, 'fs' | 'serverDistDir'> & {
4
+ fs: CacheFs;
5
+ serverDistDir: string;
6
+ };
7
+ export default class ClearableFileCache implements CacheHandler {
8
+ private fs;
9
+ private flushToDisk?;
10
+ private serverDistDir;
11
+ private appDir;
12
+ constructor(ctx: FileSystemCacheContext);
13
+ clear(): void;
14
+ delete(path: string): boolean | undefined;
15
+ get(key: string, fetchCache?: boolean): Promise<CacheHandlerValue | null>;
16
+ set(key: string, data: CacheHandlerValue['value']): Promise<void>;
17
+ getFsPath({ pathname, appDir, fetchCache, }: {
18
+ pathname: string;
19
+ appDir?: boolean;
20
+ fetchCache?: boolean;
21
+ }): Promise<{
22
+ filePath: string;
23
+ isAppPath: boolean;
24
+ }>;
25
+ }
26
+ export {};
@@ -0,0 +1,2 @@
1
+ import { IncrementalCache } from 'next/dist/server/lib/incremental-cache';
2
+ export declare const purgeCache: (cache: IncrementalCache, pathname?: string) => Promise<void>;
@@ -0,0 +1,5 @@
1
+ import { NextServer } from 'next/dist/server/next';
2
+ export declare const PURGE_CACHE_URL = "/_/enonic/cache/purge";
3
+ export declare const withEnonicCache: (config: any) => any;
4
+ declare const _default: (next: (options: any) => any) => Promise<NextServer>;
5
+ export default _default;