export type { PageConfigRuntime }; export type { PageConfigRuntimeLoaded }; export type { PageConfigBuildTime }; export type { PageConfigCommon }; export type { PageConfigRoute }; export type { ConfigEnv }; export type { PageConfigGlobalRuntime }; export type { PageConfigGlobalBuildTime }; export type { ConfigValue }; export type { ConfigValueStandard }; export type { ConfigValueCumulative }; export type { ConfigValueComputed }; export type { ConfigValues }; export type { ConfigValueSource }; export type { ConfigValueSources }; export type { ConfigValuesComputed }; export type { DefinedAtData }; export type { DefinedAtFile }; export type { DefinedAt }; export type { DefinedBy }; export type { DefinedAtFilePath }; export type { VirtualFileExportsPageEntry }; import type { ConfigValueSerialized } from '../shared-server-client/page-configs/serialize/PageConfigSerialized.js'; import type { LocationId } from '../node/vite/shared/resolveVikeConfigInternal/filesystemRouting.js'; import type { FilePath } from './FilePath.js'; import type { ConfigDefinitionsInternal } from '../node/vite/shared/resolveVikeConfigInternal/metaBuiltIn.js'; import type { PlusFile } from '../node/vite/shared/resolveVikeConfigInternal/getPlusFiles.js'; import type { ApiOperation } from '../node/api/types.js'; type PageConfigCommon = { pageId: string; } & PageConfigRoute; type PageConfigRoute = { isErrorPage: true; routeFilesystem?: undefined; } | { isErrorPage?: undefined; routeFilesystem: { routeString: string; definedAtLocation: string; }; }; /** Page config, runtime data structure */ type PageConfigRuntime = PageConfigCommon & { configValues: ConfigValues; /** Load config values that are lazily loaded such as config.Page */ loadVirtualFilePageEntry: LoadVirtualFilePageEntry; }; /** Global config that applies to all pages, runtime data structure */ type PageConfigGlobalRuntime = { configValues: ConfigValues; }; /** Page config, build-time data structure */ type PageConfigBuildTime = PageConfigCommon & { configDefinitions: ConfigDefinitionsInternal; plusFiles: PlusFile[]; configValueSources: ConfigValueSources; configValuesComputed: ConfigValuesComputed; }; /** Global config that applies to all pages, build-time data structure */ type PageConfigGlobalBuildTime = { configValueSources: ConfigValueSources; configDefinitions: ConfigDefinitionsInternal; configValuesComputed?: undefined; }; /** Same as PageConfigRuntime but also contains all lazily loaded config values such as config.Page */ type PageConfigRuntimeLoaded = PageConfigRuntime & { /** Whether loadVirtualFilePageEntry() was called */ isPageEntryLoaded: true; }; type LoadVirtualFilePageEntry = () => { moduleId: string; moduleExportsPromise: Promise; }; type VirtualFileExportsPageEntry = { configValuesSerialized: Record; }; /** In what environment(s) the config value is loaded. * * https://vike.dev/meta */ type ConfigEnv = { /** Load value on the client-side */ client?: boolean; /** Load value on the server-side */ server?: boolean; /** Load value for config files */ config?: boolean; /** Load value only in production (`true`), or only in development (`false`), or always (`undefined`). */ production?: boolean; /** Load value on the client-side only if the page uses Client Routing * * @experimental */ clientRoutingOnly?: boolean; /** Load value in an additional Vike environment, e.g. `rsc` * * @experimental * * https://vike.dev/meta#vike-environments */ [environmentName: string]: boolean | undefined; }; type ConfigValueSources = Record; type ConfigValueSource = { configEnv: ConfigEnv; definedAt: DefinedAtFilePath | DefinedBy; plusFile: PlusFile | null; locationId: LocationId; /** Whether the config value is loaded at runtime, for example config.Page or config.onBeforeRender */ valueLoadedViaImport: boolean; /** Whether the config value is a file path, this is currently only true for +client */ valueIsFilePath?: true; /** Whether the config value is defined by a +{configName}.js file */ valueIsDefinedByPlusValueFile: boolean; } & ({ valueIsLoaded: false; } | { valueIsLoaded: true; value: unknown; }); type DefinedAtFilePath = DefinedAtFile & FilePath & { fileExportName?: string; }; type ConfigValuesComputed = Record; type ConfigValues = Record; type ConfigValue = ConfigValueStandard | ConfigValueCumulative | ConfigValueComputed; /** Defined by a unique source (thus unique file path). */ type ConfigValueStandard = { type: 'standard'; value: unknown; definedAtData: DefinedAt; }; /** Defined by multiple sources (thus multiple file paths). */ type ConfigValueCumulative = { type: 'cumulative'; value: unknown[]; definedAtData: DefinedAt[]; }; /** Defined by Vike. */ type ConfigValueComputed = { type: 'computed'; value: unknown; definedAtData: null; }; type DefinedAtData = DefinedAt | DefinedAt[] | null; type DefinedAt = DefinedAtFile | DefinedBy; type DefinedBy = { definedBy: 'cli' | 'env'; } | { definedBy: 'api'; operation: ApiOperation; }; type DefinedAtFile = { filePathToShowToUser: string; fileExportPathToShowToUser: null | string[]; definedBy?: undefined; };