@bndynet/vue-site 1.4.0 → 1.4.1
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/dist/create-app.d.ts +9 -0
- package/dist/index.d.ts +19 -1
- package/dist/index.es.js +492 -479
- package/package.json +1 -1
package/dist/create-app.d.ts
CHANGED
|
@@ -1,2 +1,11 @@
|
|
|
1
1
|
import { SiteConfig } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Returns the site config passed to `createSiteApp()`. Can be called from anywhere — plain
|
|
4
|
+
* modules, `bootstrap.ts` (after the app is created), utility functions, etc. — without a Vue
|
|
5
|
+
* injection context. Returns `undefined` if `createSiteApp` has not been called yet.
|
|
6
|
+
*
|
|
7
|
+
* For reactive, component-scoped access to the full `SiteContext` (config + nav + refreshAuthNav),
|
|
8
|
+
* use {@link useSiteConfig} inside a Vue component instead.
|
|
9
|
+
*/
|
|
10
|
+
export declare function getSiteConfig(): SiteConfig | undefined;
|
|
2
11
|
export declare function createSiteApp(config: SiteConfig): Promise<import('vue').App<Element>>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SiteConfig } from './types';
|
|
2
|
-
export { createSiteApp } from './create-app';
|
|
2
|
+
export { createSiteApp, getSiteConfig } from './create-app';
|
|
3
3
|
export { useTheme, themeRefKey } from './composables/useTheme';
|
|
4
4
|
export { useLocale, localeRefKey } from './composables/useLocale';
|
|
5
5
|
export { useLocalize } from './composables/useLocalize';
|
|
@@ -10,4 +10,22 @@ export { useSiteConfig } from './composables/useSiteConfig';
|
|
|
10
10
|
export { builtinThemePalettes } from './theme/presets';
|
|
11
11
|
export { ElMessage, ElMessageBox, ElNotification, } from 'element-plus';
|
|
12
12
|
export type { SiteConfig, SiteEnvConfig, SiteViteConfig, SiteCustomConfig, SiteExternalLink, ShellConfig, ShellAction, ShellActionLoader, NavItem, StandalonePage, PageLayout, AuthRule, AuthContext, AuthConfig, RouterConfig, ThemeConfig, ThemeOption, ThemePaletteVars, ResolvedNavItem, LocaleCode, LocalizedString, IconRegistry, MessageRef, MessageTree, LocaleOption, I18nConfig, PageLoader, } from './types';
|
|
13
|
+
/**
|
|
14
|
+
* Type-safe identity for a single config object. Use the single-argument form for a standalone
|
|
15
|
+
* config file.
|
|
16
|
+
*
|
|
17
|
+
* When composing multiple config files (e.g. `site.config.prod.ts` importing a shared
|
|
18
|
+
* `site.config.common.ts`), use the two-argument form so `custom` is deep-merged: properties
|
|
19
|
+
* from the base `custom` are preserved unless explicitly overridden.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* // site.config.common.ts
|
|
23
|
+
* export default defineConfig({ custom: { apiBaseUrl: '/api', appName: 'MyApp' }, ... })
|
|
24
|
+
*
|
|
25
|
+
* // site.config.prod.ts
|
|
26
|
+
* import common from './site.config.common'
|
|
27
|
+
* export default defineConfig(common, { custom: { apiBaseUrl: 'https://prod.example.com/api' } })
|
|
28
|
+
* // Result: custom.apiBaseUrl is overridden, custom.appName is preserved.
|
|
29
|
+
*/
|
|
13
30
|
export declare function defineConfig(config: SiteConfig): SiteConfig;
|
|
31
|
+
export declare function defineConfig(base: SiteConfig, overrides: Partial<SiteConfig>): SiteConfig;
|