@uniformdev/context-next 19.35.2 → 19.36.0

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.
Files changed (2) hide show
  1. package/dist/index.d.mts +29 -0
  2. package/package.json +3 -3
@@ -0,0 +1,29 @@
1
+ import { Context, CookieTransitionDataStoreOptions, CookieTransitionDataStore } from '@uniformdev/context';
2
+ import { AppProps } from 'next/app';
3
+ import { DocumentContext } from 'next/document';
4
+ import { NextPageContext } from 'next';
5
+
6
+ /**
7
+ * Enables request-data tracking during server-side rendering passes,
8
+ * and sending that data back up to the client.
9
+ *
10
+ * This function must be called in a custom Next _document's `getInitialProps`
11
+ * function to work properly.
12
+ */
13
+ declare function enableNextSsr(ctx: DocumentContext, context: Context): void;
14
+ /** Type of <App> props if enableNextSsr() is setup in _document. */
15
+ type UniformAppProps<P = {}> = AppProps<P> & {
16
+ serverUniformContext?: Context;
17
+ };
18
+
19
+ type NextCookieTransitionDataStoreOptions = Omit<CookieTransitionDataStoreOptions, 'serverCookieValue'> & {
20
+ serverContext: NextPageContext | undefined;
21
+ };
22
+ /**
23
+ * Provides client-to-server score transition using cookies for Next.js SSR
24
+ */
25
+ declare class NextCookieTransitionDataStore extends CookieTransitionDataStore {
26
+ constructor({ serverContext, ...options }: NextCookieTransitionDataStoreOptions);
27
+ }
28
+
29
+ export { NextCookieTransitionDataStore, NextCookieTransitionDataStoreOptions, UniformAppProps, enableNextSsr };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/context-next",
3
- "version": "19.35.2",
3
+ "version": "19.36.0",
4
4
  "description": "Uniform Context Next.js integration package",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -31,7 +31,7 @@
31
31
  "react-dom": "18.2.0"
32
32
  },
33
33
  "dependencies": {
34
- "@uniformdev/context": "19.35.2",
34
+ "@uniformdev/context": "19.36.0",
35
35
  "cookie": "^0.5.0"
36
36
  },
37
37
  "peerDependencies": {
@@ -45,5 +45,5 @@
45
45
  "publishConfig": {
46
46
  "access": "public"
47
47
  },
48
- "gitHead": "64d3270175087c87cfaa29a283aa4a7b0a98fd2c"
48
+ "gitHead": "3ae246a7f0f39adeaf04ecba4c7e48c478c019ad"
49
49
  }