Functions by entry point
The functions each of the package's four entry points exports.
@fairgarden/indicators
For lib/indicators.ts:
createIndicators— declare the locales, preferences and flags
On the object createIndicators returns, for layouts and pages:
generateStaticParams— the variants to prerender, all at once or per levelread— the locale, preferences and flags a route's params namelayoutandpage— the same, as a wrapperencodeanddecode— a segment from values, and backhref,splitLocale,negotiate— locale-aware paths, server sidestylesheets()and theStylesheetscomponent — the links for indicators expressed through a stylesheet: the global ones in the layout, and withonly, the ones a page links itself
Standalone, for tests and tooling:
- Helpers —
negotiateLocale,localizeHref,mountHref,indicatorsRewritesand friends
@fairgarden/indicators/withFairGardenIndicators
For next.config.ts:
withFairGardenIndicators— add the rewrites, redirects and headersdetectExclusions— what a look at the app keeps out of the locale rewrite
@fairgarden/indicators/link
For a client module such as lib/link.ts:
createNavigation—Link,useHref,useIndicators,useLocaleandusePref, bound to the app's config
@fairgarden/indicators/proxy
For proxy.ts:
createLocaleProxy— language negotiation at the site root