@ampless/runtime 0.2.0-alpha.2 → 0.2.0-alpha.3
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.
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
1
2
|
import { Metadata } from 'next';
|
|
2
3
|
import { Ampless } from '../index.js';
|
|
3
4
|
import 'ampless';
|
|
@@ -7,16 +8,12 @@ interface Props$2 {
|
|
|
7
8
|
siteId: string;
|
|
8
9
|
}>;
|
|
9
10
|
}
|
|
10
|
-
type ThemeHomeDispatcher = (props: Props$2) => Promise<
|
|
11
|
+
type ThemeHomeDispatcher = (props: Props$2) => Promise<ReactNode>;
|
|
11
12
|
type ThemeHomeMetadata = (props: Props$2) => Promise<Metadata>;
|
|
12
13
|
/**
|
|
13
14
|
* Home page dispatcher. Resolves the active theme for the request's
|
|
14
15
|
* siteId and renders the theme's `components.Home` server component
|
|
15
16
|
* with the same `params` Promise it was passed.
|
|
16
|
-
*
|
|
17
|
-
* The return type is `unknown` (cast at the route boundary) because
|
|
18
|
-
* Next.js page-component prop types vary by route shape and the
|
|
19
|
-
* underlying theme components are arbitrary server components.
|
|
20
17
|
*/
|
|
21
18
|
declare function createThemeHomeDispatcher(ampless: Ampless): ThemeHomeDispatcher;
|
|
22
19
|
/** generateMetadata factory for the home dispatcher. */
|
|
@@ -28,7 +25,7 @@ interface Props$1 {
|
|
|
28
25
|
slug: string;
|
|
29
26
|
}>;
|
|
30
27
|
}
|
|
31
|
-
type ThemePostDispatcher = (props: Props$1) => Promise<
|
|
28
|
+
type ThemePostDispatcher = (props: Props$1) => Promise<ReactNode>;
|
|
32
29
|
type ThemePostMetadata = (props: Props$1) => Promise<Metadata>;
|
|
33
30
|
/**
|
|
34
31
|
* Post page dispatcher. Resolves the active theme and renders the
|
|
@@ -45,7 +42,7 @@ interface Props {
|
|
|
45
42
|
tag: string;
|
|
46
43
|
}>;
|
|
47
44
|
}
|
|
48
|
-
type ThemeTagDispatcher = (props: Props) => Promise<
|
|
45
|
+
type ThemeTagDispatcher = (props: Props) => Promise<ReactNode>;
|
|
49
46
|
type ThemeTagMetadata = (props: Props) => Promise<Metadata>;
|
|
50
47
|
/**
|
|
51
48
|
* Tag page dispatcher. Resolves the active theme and renders the
|
package/package.json
CHANGED