@vuepress/core 2.0.0-beta.6 → 2.0.0-beta.60

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 (152) hide show
  1. package/dist/index.d.ts +825 -0
  2. package/dist/index.js +1006 -0
  3. package/package.json +34 -17
  4. package/CHANGELOG.md +0 -279
  5. package/lib/app/appInit.d.ts +0 -7
  6. package/lib/app/appInit.js +0 -37
  7. package/lib/app/appPrepare.d.ts +0 -10
  8. package/lib/app/appPrepare.js +0 -46
  9. package/lib/app/appUse.d.ts +0 -2
  10. package/lib/app/appUse.js +0 -26
  11. package/lib/app/appUseByConfig.d.ts +0 -2
  12. package/lib/app/appUseByConfig.js +0 -14
  13. package/lib/app/createApp.d.ts +0 -5
  14. package/lib/app/createApp.js +0 -44
  15. package/lib/app/createAppDir.d.ts +0 -9
  16. package/lib/app/createAppDir.js +0 -32
  17. package/lib/app/createAppEnv.d.ts +0 -5
  18. package/lib/app/createAppEnv.js +0 -14
  19. package/lib/app/createAppOptions.d.ts +0 -5
  20. package/lib/app/createAppOptions.js +0 -48
  21. package/lib/app/createAppPages.d.ts +0 -5
  22. package/lib/app/createAppPages.js +0 -36
  23. package/lib/app/createAppSiteData.d.ts +0 -7
  24. package/lib/app/createAppSiteData.js +0 -19
  25. package/lib/app/createAppVersion.d.ts +0 -4
  26. package/lib/app/createAppVersion.js +0 -11
  27. package/lib/app/createAppWriteTemp.d.ts +0 -5
  28. package/lib/app/createAppWriteTemp.js +0 -21
  29. package/lib/app/index.d.ts +0 -16
  30. package/lib/app/index.js +0 -28
  31. package/lib/app/normalizePlugin.d.ts +0 -2
  32. package/lib/app/normalizePlugin.js +0 -19
  33. package/lib/app/normalizePluginConfig.d.ts +0 -2
  34. package/lib/app/normalizePluginConfig.js +0 -18
  35. package/lib/app/prepare/index.d.ts +0 -12
  36. package/lib/app/prepare/index.js +0 -24
  37. package/lib/app/prepare/prepareClientAppEnhances.d.ts +0 -5
  38. package/lib/app/prepare/prepareClientAppEnhances.js +0 -24
  39. package/lib/app/prepare/prepareClientAppRootComponents.d.ts +0 -5
  40. package/lib/app/prepare/prepareClientAppRootComponents.js +0 -24
  41. package/lib/app/prepare/prepareClientAppSetups.d.ts +0 -5
  42. package/lib/app/prepare/prepareClientAppSetups.js +0 -24
  43. package/lib/app/prepare/prepareLayoutComponents.d.ts +0 -5
  44. package/lib/app/prepare/prepareLayoutComponents.js +0 -20
  45. package/lib/app/prepare/preparePageComponent.d.ts +0 -5
  46. package/lib/app/prepare/preparePageComponent.js +0 -10
  47. package/lib/app/prepare/preparePageData.d.ts +0 -5
  48. package/lib/app/prepare/preparePageData.js +0 -37
  49. package/lib/app/prepare/preparePageRoutes.d.ts +0 -5
  50. package/lib/app/prepare/preparePageRoutes.js +0 -57
  51. package/lib/app/prepare/preparePagesComponent.d.ts +0 -5
  52. package/lib/app/prepare/preparePagesComponent.js +0 -23
  53. package/lib/app/prepare/preparePagesData.d.ts +0 -5
  54. package/lib/app/prepare/preparePagesData.js +0 -19
  55. package/lib/app/prepare/preparePagesRoutes.d.ts +0 -5
  56. package/lib/app/prepare/preparePagesRoutes.js +0 -25
  57. package/lib/app/prepare/prepareSiteData.d.ts +0 -5
  58. package/lib/app/prepare/prepareSiteData.js +0 -31
  59. package/lib/app/prepare/resolvePageData.d.ts +0 -5
  60. package/lib/app/prepare/resolvePageData.js +0 -18
  61. package/lib/app/resolveBundler.d.ts +0 -2
  62. package/lib/app/resolveBundler.js +0 -10
  63. package/lib/app/resolvePlugin.d.ts +0 -5
  64. package/lib/app/resolvePlugin.js +0 -20
  65. package/lib/index.d.ts +0 -5
  66. package/lib/index.js +0 -17
  67. package/lib/page/createPage.d.ts +0 -2
  68. package/lib/page/createPage.js +0 -98
  69. package/lib/page/index.d.ts +0 -17
  70. package/lib/page/index.js +0 -29
  71. package/lib/page/inferPagePath.d.ts +0 -11
  72. package/lib/page/inferPagePath.js +0 -27
  73. package/lib/page/resolvePageComponentInfo.d.ts +0 -20
  74. package/lib/page/resolvePageComponentInfo.js +0 -41
  75. package/lib/page/resolvePageContent.d.ts +0 -11
  76. package/lib/page/resolvePageContent.js +0 -31
  77. package/lib/page/resolvePageDataInfo.d.ts +0 -12
  78. package/lib/page/resolvePageDataInfo.js +0 -18
  79. package/lib/page/resolvePageDate.d.ts +0 -10
  80. package/lib/page/resolvePageDate.js +0 -46
  81. package/lib/page/resolvePageExcerpt.d.ts +0 -9
  82. package/lib/page/resolvePageExcerpt.js +0 -15
  83. package/lib/page/resolvePageFileContent.d.ts +0 -8
  84. package/lib/page/resolvePageFileContent.js +0 -24
  85. package/lib/page/resolvePageFilePath.d.ts +0 -11
  86. package/lib/page/resolvePageFilePath.js +0 -29
  87. package/lib/page/resolvePageFrontmatter.d.ts +0 -8
  88. package/lib/page/resolvePageFrontmatter.js +0 -12
  89. package/lib/page/resolvePageKey.d.ts +0 -6
  90. package/lib/page/resolvePageKey.js +0 -9
  91. package/lib/page/resolvePageLang.d.ts +0 -9
  92. package/lib/page/resolvePageLang.js +0 -15
  93. package/lib/page/resolvePagePath.d.ts +0 -9
  94. package/lib/page/resolvePagePath.js +0 -8
  95. package/lib/page/resolvePagePermalink.d.ts +0 -11
  96. package/lib/page/resolvePagePermalink.js +0 -32
  97. package/lib/page/resolvePageRoutesInfo.d.ts +0 -11
  98. package/lib/page/resolvePageRoutesInfo.js +0 -16
  99. package/lib/page/resolvePageSlug.d.ts +0 -6
  100. package/lib/page/resolvePageSlug.js +0 -17
  101. package/lib/page/resolvePageTitle.d.ts +0 -9
  102. package/lib/page/resolvePageTitle.js +0 -26
  103. package/lib/pluginApi/createHookQueue.d.ts +0 -5
  104. package/lib/pluginApi/createHookQueue.js +0 -81
  105. package/lib/pluginApi/createPluginApi.d.ts +0 -2
  106. package/lib/pluginApi/createPluginApi.js +0 -16
  107. package/lib/pluginApi/createPluginApiHooks.d.ts +0 -2
  108. package/lib/pluginApi/createPluginApiHooks.js +0 -24
  109. package/lib/pluginApi/createPluginApiRegisterHooks.d.ts +0 -2
  110. package/lib/pluginApi/createPluginApiRegisterHooks.js +0 -54
  111. package/lib/pluginApi/index.d.ts +0 -6
  112. package/lib/pluginApi/index.js +0 -18
  113. package/lib/pluginApi/normalizeClientFilesHook.d.ts +0 -5
  114. package/lib/pluginApi/normalizeClientFilesHook.js +0 -25
  115. package/lib/pluginApi/normalizeReturnObjectHook.d.ts +0 -5
  116. package/lib/pluginApi/normalizeReturnObjectHook.js +0 -9
  117. package/lib/themeApi/createThemeApi.d.ts +0 -7
  118. package/lib/themeApi/createThemeApi.js +0 -30
  119. package/lib/themeApi/index.d.ts +0 -1
  120. package/lib/themeApi/index.js +0 -13
  121. package/lib/themeApi/resolveThemeInfo.d.ts +0 -2
  122. package/lib/themeApi/resolveThemeInfo.js +0 -34
  123. package/lib/themeApi/resolveThemeLayouts.d.ts +0 -5
  124. package/lib/themeApi/resolveThemeLayouts.js +0 -33
  125. package/lib/types/app/app.d.ts +0 -30
  126. package/lib/types/app/app.js +0 -2
  127. package/lib/types/app/index.d.ts +0 -3
  128. package/lib/types/app/index.js +0 -15
  129. package/lib/types/app/options.d.ts +0 -32
  130. package/lib/types/app/options.js +0 -2
  131. package/lib/types/app/utils.d.ts +0 -29
  132. package/lib/types/app/utils.js +0 -2
  133. package/lib/types/bundler.d.ts +0 -34
  134. package/lib/types/bundler.js +0 -2
  135. package/lib/types/index.d.ts +0 -9
  136. package/lib/types/index.js +0 -19
  137. package/lib/types/page.d.ts +0 -98
  138. package/lib/types/page.js +0 -2
  139. package/lib/types/plugin-api/hooks.d.ts +0 -75
  140. package/lib/types/plugin-api/hooks.js +0 -2
  141. package/lib/types/plugin-api/index.d.ts +0 -2
  142. package/lib/types/plugin-api/index.js +0 -14
  143. package/lib/types/plugin-api/pluginApi.d.ts +0 -23
  144. package/lib/types/plugin-api/pluginApi.js +0 -2
  145. package/lib/types/plugin.d.ts +0 -48
  146. package/lib/types/plugin.js +0 -2
  147. package/lib/types/theme-api/index.d.ts +0 -1
  148. package/lib/types/theme-api/index.js +0 -13
  149. package/lib/types/theme-api/themeApi.d.ts +0 -44
  150. package/lib/types/theme-api/themeApi.js +0 -2
  151. package/lib/types/theme.d.ts +0 -33
  152. package/lib/types/theme.js +0 -2
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +0,0 @@
1
- export * from './app';
2
- export * from './options';
3
- export * from './utils';
@@ -1,15 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
- };
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- __exportStar(require("./app"), exports);
14
- __exportStar(require("./options"), exports);
15
- __exportStar(require("./utils"), exports);
@@ -1,32 +0,0 @@
1
- import type { MarkdownOptions } from '@vuepress/markdown';
2
- import type { SiteLocaleConfig, SiteLocaleData } from '@vuepress/shared';
3
- import type { BundlerConfig } from '../bundler';
4
- import type { ThemeConfig } from '../theme';
5
- /**
6
- * Vuepress app options
7
- */
8
- export interface AppOptions<T extends ThemeConfig = ThemeConfig, U extends BundlerConfig = BundlerConfig> extends SiteLocaleData {
9
- base: string;
10
- locales: SiteLocaleConfig;
11
- theme: string;
12
- themeConfig: Partial<T>;
13
- bundler: string;
14
- bundlerConfig: Partial<U>;
15
- source: string;
16
- dest: string;
17
- temp: string;
18
- cache: string;
19
- public: string;
20
- markdown: MarkdownOptions;
21
- debug: boolean;
22
- host: string;
23
- port: number;
24
- open: boolean;
25
- evergreen: boolean;
26
- pagePatterns: string[];
27
- templateDev: string;
28
- templateSSR: string;
29
- shouldPreload: ((file: string, type: string) => boolean) | boolean;
30
- shouldPrefetch: ((file: string, type: string) => boolean) | boolean;
31
- }
32
- export declare type AppConfig = Partial<AppOptions> & Pick<AppOptions, 'source'>;
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,29 +0,0 @@
1
- /**
2
- * Directory util function
3
- */
4
- export declare type AppDirFunction = (...args: string[]) => string;
5
- /**
6
- * Directory utils
7
- */
8
- export interface AppDir {
9
- cache: AppDirFunction;
10
- temp: AppDirFunction;
11
- source: AppDirFunction;
12
- dest: AppDirFunction;
13
- public: AppDirFunction;
14
- client: AppDirFunction;
15
- }
16
- /**
17
- * Environment flags
18
- */
19
- export interface AppEnv {
20
- isProd: boolean;
21
- isTest: boolean;
22
- isDev: boolean;
23
- isDebug: boolean;
24
- nodeEnv: string | undefined;
25
- }
26
- /**
27
- * Write temp file util
28
- */
29
- export declare type AppWriteTemp = (file: string, content: string) => Promise<string>;
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,34 +0,0 @@
1
- import type { App } from './app';
2
- /**
3
- * Vuepress bundler
4
- *
5
- * It provides abilities to:
6
- * - dev: run dev server for development
7
- * - build: bundle assets for deployment
8
- */
9
- export interface Bundler {
10
- dev: BundlerDev;
11
- build: BundlerBuild;
12
- }
13
- export declare type BundlerDev = (app: App) => Promise<() => Promise<void>>;
14
- export declare type BundlerBuild = (app: App) => Promise<void>;
15
- /**
16
- * A function that returns a bundler instance
17
- *
18
- * A bundler package should have a `CreateBundlerFunction` as the default export
19
- */
20
- export declare type CreateBundlerFunction<BundlerOptions extends BundlerConfig = Partial<BundlerConfig>> = (options: BundlerOptions) => Bundler;
21
- /**
22
- * Bundler entry type
23
- */
24
- export interface BundlerEntry {
25
- createBundler: CreateBundlerFunction;
26
- }
27
- /**
28
- * User config type of bundler
29
- *
30
- * @remark suffix `Config` means this is for user config
31
- */
32
- export interface BundlerConfig {
33
- [key: string]: any;
34
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,9 +0,0 @@
1
- import type { HeadConfig, HeadTag, HeadTagEmpty, HeadTagNonEmpty, HeadAttrsConfig, LocaleConfig, LocaleData, PageData, PageFrontmatter, PageHeader, SiteData, SiteLocaleConfig } from '@vuepress/shared';
2
- export type { HeadConfig, HeadTag, HeadTagEmpty, HeadTagNonEmpty, HeadAttrsConfig, LocaleConfig, LocaleData, PageData, PageFrontmatter, PageHeader, SiteData, SiteLocaleConfig, };
3
- export * from './app';
4
- export * from './bundler';
5
- export * from './page';
6
- export * from './plugin';
7
- export * from './plugin-api';
8
- export * from './theme';
9
- export * from './theme-api';
@@ -1,19 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
- };
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- __exportStar(require("./app"), exports);
14
- __exportStar(require("./bundler"), exports);
15
- __exportStar(require("./page"), exports);
16
- __exportStar(require("./plugin"), exports);
17
- __exportStar(require("./plugin-api"), exports);
18
- __exportStar(require("./theme"), exports);
19
- __exportStar(require("./theme-api"), exports);
@@ -1,98 +0,0 @@
1
- import type { MarkdownLink } from '@vuepress/markdown';
2
- import type { PageData, PageFrontmatter } from '@vuepress/shared';
3
- /**
4
- * Vuepress Page
5
- */
6
- export interface Page extends PageData {
7
- /**
8
- * Path of the page that inferred from file path
9
- *
10
- * If the page does not come from a file, it would be `null`
11
- *
12
- * @example '/guide/index.html'
13
- */
14
- pathInferred: string | null;
15
- /**
16
- * Locale path prefix of the page
17
- *
18
- * @example '/getting-started.html' -> '/'
19
- * @example '/en/getting-started.html' -> '/en/'
20
- * @example '/zh/getting-started.html' -> '/zh/'
21
- */
22
- pathLocale: string;
23
- /**
24
- * Absolute path of the source file
25
- *
26
- * If the page does not come from a file, it would be `null`
27
- */
28
- filePath: string | null;
29
- /**
30
- * Relative path of the source file
31
- *
32
- * If the page does not come from a file, it would be `null`
33
- */
34
- filePathRelative: string | null;
35
- /**
36
- * Component file path
37
- */
38
- componentFilePath: string;
39
- /**
40
- * Component relative file path
41
- */
42
- componentFilePathRelative: string;
43
- /**
44
- * Component file content that generated from the source file
45
- */
46
- componentFileContent: string;
47
- /**
48
- * Component file chunk name
49
- */
50
- componentFileChunkName: string;
51
- /**
52
- * Page data file path
53
- */
54
- dataFilePath: string;
55
- /**
56
- * Page data relative file path
57
- */
58
- dataFilePathRelative: string;
59
- /**
60
- * Page data file chunk name
61
- */
62
- dataFileChunkName: string;
63
- /**
64
- * Page routes file path
65
- */
66
- routesFilePath: string;
67
- /**
68
- * Page routes relative file path
69
- */
70
- routesFilePathRelative: string;
71
- /**
72
- * Content of the page
73
- */
74
- content: string;
75
- /**
76
- * Links of the page
77
- */
78
- links: MarkdownLink[];
79
- /**
80
- * Slug of the page
81
- */
82
- slug: string;
83
- /**
84
- * Date of the page, in 'yyyy-MM-dd' format
85
- *
86
- * @example '2020-09-09'
87
- */
88
- date: string;
89
- }
90
- /**
91
- * Options to create vuepress page
92
- */
93
- export interface PageOptions {
94
- path?: string;
95
- filePath?: string;
96
- frontmatter?: PageFrontmatter;
97
- content?: string;
98
- }
package/lib/types/page.js DELETED
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,75 +0,0 @@
1
- import type { Markdown } from '@vuepress/markdown';
2
- import type { App } from '../app';
3
- import type { Page, PageOptions } from '../page';
4
- declare type PromiseOrNot<T> = Promise<T> | T;
5
- declare type Closable = {
6
- close(): void;
7
- };
8
- export declare type Hook<Exposed, Normalized = Exposed, Result = Normalized extends (...args: any) => infer U ? U extends Promise<infer V> ? V : U : void> = {
9
- exposed: Exposed;
10
- normalized: Normalized;
11
- result: Result;
12
- };
13
- export declare type LifeCycleHook<T extends unknown[] = []> = Hook<(app: App, ...args: T) => PromiseOrNot<void>>;
14
- export declare type ClientFilesHook = Hook<string | string[] | ((app: App) => PromiseOrNot<string | string[]>), (app: App) => Promise<string[]>>;
15
- export declare type ReturnObjectHook = Hook<Record<string, any> | ((app: App) => Record<string, any>), (app: App) => Record<string, any>>;
16
- export declare type ExtendsMarkdownHook = Hook<(md: Markdown, app: App) => void>;
17
- export declare type ExtendsPageOptionsHook = Hook<(filePath: string, app: App) => PromiseOrNot<PageOptions>>;
18
- export declare type ExtendsPageDataHook = Hook<(page: Page, app: App) => PromiseOrNot<Record<string, any>>>;
19
- /**
20
- * List of hooks
21
- */
22
- export interface Hooks {
23
- onInitialized: LifeCycleHook;
24
- onPrepared: LifeCycleHook;
25
- onWatched: LifeCycleHook<[watchers: Closable[], restart: () => Promise<void>]>;
26
- onGenerated: LifeCycleHook;
27
- extendsMarkdown: ExtendsMarkdownHook;
28
- extendsPageOptions: ExtendsPageOptionsHook;
29
- extendsPageData: ExtendsPageDataHook;
30
- clientAppEnhanceFiles: ClientFilesHook;
31
- clientAppRootComponentFiles: ClientFilesHook;
32
- clientAppSetupFiles: ClientFilesHook;
33
- alias: ReturnObjectHook;
34
- define: ReturnObjectHook;
35
- }
36
- /**
37
- * Name of hooks
38
- */
39
- export declare type HooksName = keyof Hooks;
40
- /**
41
- * Exposed hooks API that can be accessed by a plugin
42
- */
43
- export declare type HooksExposed = {
44
- [K in HooksName]: Hooks[K]['exposed'];
45
- };
46
- /**
47
- * Normalized hooks
48
- */
49
- export declare type HooksNormalized = {
50
- [K in HooksName]: Hooks[K]['normalized'];
51
- };
52
- /**
53
- * Result of hooks
54
- */
55
- export declare type HooksResult = {
56
- [K in HooksName]: Hooks[K]['result'];
57
- };
58
- /**
59
- * Hook item
60
- */
61
- export interface HookItem<T extends HooksName> {
62
- pluginName: string;
63
- hook: HooksNormalized[T];
64
- }
65
- /**
66
- * Hook items queue
67
- */
68
- export interface HookQueue<T extends HooksName> {
69
- name: T;
70
- items: HookItem<T>[];
71
- add: (item: HookItem<T>) => void;
72
- process: (...args: Parameters<HooksNormalized[T]>) => Promise<HooksResult[T][]>;
73
- processSync: (...args: Parameters<HooksNormalized[T]>) => HooksResult[T][];
74
- }
75
- export {};
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +0,0 @@
1
- export * from './hooks';
2
- export * from './pluginApi';
@@ -1,14 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
- };
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- __exportStar(require("./hooks"), exports);
14
- __exportStar(require("./pluginApi"), exports);
@@ -1,23 +0,0 @@
1
- import type { PluginObject } from '../plugin';
2
- import type { HookQueue, HooksName } from './hooks';
3
- /**
4
- * Vuepress plugin system
5
- */
6
- export interface PluginApi {
7
- /**
8
- * Plugins that have been used
9
- */
10
- plugins: PluginObject[];
11
- /**
12
- * All available hooks
13
- */
14
- hooks: {
15
- [K in HooksName]: HookQueue<K>;
16
- };
17
- /**
18
- * Register hooks of plugins
19
- *
20
- * Should be invoked before applying a hook
21
- */
22
- registerHooks: () => void;
23
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,48 +0,0 @@
1
- import type { App } from './app';
2
- import type { HooksExposed } from './plugin-api';
3
- /**
4
- * Vuepress plugin
5
- *
6
- * A plugin should be rather:
7
- * - an object (`PluginObject`)
8
- * - a function that returns an object (`PluginFunction`)
9
- *
10
- * A plugin package should have a `Plugin` as the default export
11
- */
12
- export declare type Plugin<T extends PluginOptions = PluginOptions, U extends PluginObject = PluginObject> = U | PluginFunction<T, U>;
13
- /**
14
- * Vuepress plugin function
15
- *
16
- * It accepts plugin options and vuepress app, returns plugin object
17
- */
18
- export declare type PluginFunction<T extends PluginOptions = PluginOptions, U extends PluginObject = PluginObject> = (pluginConfig: Partial<T>, app: App) => U;
19
- /**
20
- * Vuepress plugin object
21
- */
22
- export interface PluginObject extends Partial<HooksExposed> {
23
- name: string;
24
- multiple?: boolean;
25
- plugins?: PluginConfig[];
26
- }
27
- /**
28
- * Vuepress plugin options
29
- *
30
- * It can be set by user in user config, and will be passed to plugin function
31
- */
32
- export declare type PluginOptions = Record<string, any>;
33
- /**
34
- * Plugin config to be used in user config file
35
- *
36
- * Users can use this config to control which plugins to be used,
37
- * and set the plugin options
38
- *
39
- * @remark suffix `Config` means this is for user config
40
- */
41
- export declare type PluginConfig<T extends PluginOptions = PluginOptions> = string | Plugin<T> | [string | Plugin<T>] | [string | Plugin<T>, Partial<T> | boolean];
42
- /**
43
- * Normalized plugin config
44
- */
45
- export declare type PluginConfigNormalized<T extends PluginOptions = PluginOptions> = [
46
- Plugin<T> | string,
47
- Partial<T> | boolean
48
- ];
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1 +0,0 @@
1
- export * from './themeApi';
@@ -1,13 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
- };
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- __exportStar(require("./themeApi"), exports);
@@ -1,44 +0,0 @@
1
- import type { ThemeObject } from '../theme';
2
- /**
3
- * Vuepress theme system
4
- */
5
- export interface ThemeApi {
6
- /**
7
- * Current theme
8
- */
9
- theme: ThemeInfo;
10
- /**
11
- * Parent theme
12
- */
13
- parentTheme: ThemeInfo | null;
14
- /**
15
- * Layouts
16
- */
17
- layouts: ThemeLayout[];
18
- }
19
- /**
20
- * Vuepress theme info
21
- */
22
- export interface ThemeInfo {
23
- /**
24
- * Theme plugin object
25
- */
26
- plugin: ThemeObject;
27
- /**
28
- * Theme layouts
29
- */
30
- layouts: ThemeLayout[];
31
- }
32
- /**
33
- * Vuepress theme layout
34
- */
35
- export interface ThemeLayout {
36
- /**
37
- * Path of layout
38
- */
39
- path: string;
40
- /**
41
- * Name of layout
42
- */
43
- name: string;
44
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,33 +0,0 @@
1
- import type { Plugin, PluginFunction, PluginObject } from './plugin';
2
- /**
3
- * Vuepress theme
4
- *
5
- * Theme is a special type of plugin, it should be rather:
6
- * - an object (`ThemeObject`)
7
- * - a function that returns an object (`ThemeFunction`)
8
- *
9
- * A theme package should have a `Theme` as the default export
10
- */
11
- export declare type Theme<T extends ThemeConfig = ThemeConfig> = Plugin<T, ThemeObject>;
12
- /**
13
- * Vuepress theme function
14
- */
15
- export declare type ThemeFunction<T extends ThemeConfig = ThemeConfig> = PluginFunction<T, ThemeObject>;
16
- /**
17
- * Vuepress theme object
18
- */
19
- export interface ThemeObject extends PluginObject {
20
- multiple?: false;
21
- extends?: string;
22
- layouts?: string | Record<string, string>;
23
- }
24
- /**
25
- * Theme config to be used in user config file
26
- *
27
- * It will be used by a theme itself, but not by vuepress.
28
- *
29
- * Vuepress will only transfer this config to theme
30
- *
31
- * @remark suffix `Config` means this is for user config
32
- */
33
- export declare type ThemeConfig = Record<string, any>;
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });