@vuepress/core 2.0.0-rc.2 → 2.0.0-rc.21
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/README.md +1 -1
- package/dist/index.d.ts +170 -312
- package/dist/index.js +276 -293
- package/package.json +6 -6
package/README.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { MarkdownLink, MarkdownSfcBlocks, MarkdownOptions, Markdown
|
|
2
|
-
import { PageBase, PageData,
|
|
1
|
+
import { MarkdownLink, MarkdownSfcBlocks, MarkdownOptions, Markdown } from '@vuepress/markdown';
|
|
2
|
+
import { PageFrontmatter, PageBase, PageData, PageHeader, SiteData } from '@vuepress/shared';
|
|
3
3
|
export { HeadAttrsConfig, HeadConfig, HeadTag, HeadTagEmpty, HeadTagNonEmpty, LocaleConfig, LocaleData, PageData, PageFrontmatter, PageHeader, SiteData, SiteLocaleConfig } from '@vuepress/shared';
|
|
4
4
|
import { TemplateRenderer } from '@vuepress/utils';
|
|
5
5
|
|
|
@@ -11,15 +11,25 @@ import { TemplateRenderer } from '@vuepress/utils';
|
|
|
11
11
|
* - build: bundle assets for deployment
|
|
12
12
|
*/
|
|
13
13
|
interface Bundler {
|
|
14
|
+
/**
|
|
15
|
+
* Name of the bundler
|
|
16
|
+
*/
|
|
14
17
|
name: string;
|
|
18
|
+
/**
|
|
19
|
+
* Method to run vuepress app in dev mode, starting dev server
|
|
20
|
+
*/
|
|
15
21
|
dev: (app: App) => Promise<() => Promise<void>>;
|
|
22
|
+
/**
|
|
23
|
+
* Method to run vuepress app in build mode, generating static pages and assets
|
|
24
|
+
*/
|
|
16
25
|
build: (app: App) => Promise<void>;
|
|
17
26
|
}
|
|
27
|
+
type BundlerOptions = Record<string, unknown>;
|
|
18
28
|
|
|
19
29
|
/**
|
|
20
30
|
* Vuepress Page
|
|
21
31
|
*/
|
|
22
|
-
type Page<ExtraPageData extends Record<
|
|
32
|
+
type Page<ExtraPageData extends Record<string, unknown> = Record<string, unknown>, ExtraPageFrontmatter extends Record<string, unknown> = Record<string, unknown>, ExtraPageFields extends Record<string, unknown> = Record<string, unknown>> = ExtraPageFields & PageBase<ExtraPageFrontmatter> & {
|
|
23
33
|
/**
|
|
24
34
|
* Data of the page, which will be available in client code
|
|
25
35
|
*/
|
|
@@ -42,6 +52,10 @@ type Page<ExtraPageData extends Record<any, any> = Record<never, never>, ExtraPa
|
|
|
42
52
|
* Dependencies of the page
|
|
43
53
|
*/
|
|
44
54
|
deps: string[];
|
|
55
|
+
/**
|
|
56
|
+
* Headers of the page
|
|
57
|
+
*/
|
|
58
|
+
headers: PageHeader[];
|
|
45
59
|
/**
|
|
46
60
|
* Links of the page
|
|
47
61
|
*/
|
|
@@ -73,9 +87,7 @@ type Page<ExtraPageData extends Record<any, any> = Record<never, never>, ExtraPa
|
|
|
73
87
|
*/
|
|
74
88
|
permalink: string | null;
|
|
75
89
|
/**
|
|
76
|
-
* Custom data to be attached to
|
|
77
|
-
*
|
|
78
|
-
* @see https://router.vuejs.org/api/#meta
|
|
90
|
+
* Custom data to be attached to route record
|
|
79
91
|
*/
|
|
80
92
|
routeMeta: Record<string, unknown>;
|
|
81
93
|
/**
|
|
@@ -107,25 +119,19 @@ type Page<ExtraPageData extends Record<any, any> = Record<never, never>, ExtraPa
|
|
|
107
119
|
*/
|
|
108
120
|
componentFilePathRelative: string;
|
|
109
121
|
/**
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
* Only take effect in webpack
|
|
113
|
-
*/
|
|
114
|
-
componentFileChunkName: string;
|
|
115
|
-
/**
|
|
116
|
-
* Page data file path
|
|
122
|
+
* Chunk file path
|
|
117
123
|
*/
|
|
118
|
-
|
|
124
|
+
chunkFilePath: string;
|
|
119
125
|
/**
|
|
120
|
-
*
|
|
126
|
+
* Chunk file path relative to temp directory
|
|
121
127
|
*/
|
|
122
|
-
|
|
128
|
+
chunkFilePathRelative: string;
|
|
123
129
|
/**
|
|
124
|
-
*
|
|
130
|
+
* Chunk name
|
|
125
131
|
*
|
|
126
|
-
*
|
|
132
|
+
* This will only take effect in webpack
|
|
127
133
|
*/
|
|
128
|
-
|
|
134
|
+
chunkName: string;
|
|
129
135
|
/**
|
|
130
136
|
* Rendered html file path
|
|
131
137
|
*/
|
|
@@ -140,11 +146,10 @@ type Page<ExtraPageData extends Record<any, any> = Record<never, never>, ExtraPa
|
|
|
140
146
|
*/
|
|
141
147
|
interface PageOptions {
|
|
142
148
|
/**
|
|
143
|
-
*
|
|
144
|
-
* markdown content of the page.
|
|
149
|
+
* The raw markdown content of the page.
|
|
145
150
|
*
|
|
146
|
-
* If `
|
|
147
|
-
*
|
|
151
|
+
* If `content` is not provided, the file content of the `filePath`
|
|
152
|
+
* will be used.
|
|
148
153
|
*/
|
|
149
154
|
content?: string;
|
|
150
155
|
/**
|
|
@@ -167,7 +172,7 @@ type PromiseOrNot<T> = Promise<T> | T;
|
|
|
167
172
|
interface Closable {
|
|
168
173
|
close(): void;
|
|
169
174
|
}
|
|
170
|
-
interface Hook<Exposed, Normalized = Exposed, Result = Normalized extends (...args: any) => infer U ? U extends Promise<infer V> ? V : U :
|
|
175
|
+
interface Hook<Exposed, Normalized = Exposed, Result = Normalized extends (...args: any) => infer U ? U extends Promise<infer V> ? V : U : never> {
|
|
171
176
|
exposed: Exposed;
|
|
172
177
|
normalized: Normalized;
|
|
173
178
|
result: Result;
|
|
@@ -175,7 +180,7 @@ interface Hook<Exposed, Normalized = Exposed, Result = Normalized extends (...ar
|
|
|
175
180
|
type LifeCycleHook<T extends unknown[] = []> = Hook<(app: App, ...args: T) => PromiseOrNot<void>>;
|
|
176
181
|
type ExtendsHook<T> = Hook<(extendable: T, app: App) => PromiseOrNot<void>>;
|
|
177
182
|
type ClientConfigFileHook = Hook<string | ((app: App) => PromiseOrNot<string>), (app: App) => Promise<string>>;
|
|
178
|
-
type AliasDefineHook = Hook<Record<string,
|
|
183
|
+
type AliasDefineHook = Hook<Record<string, unknown> | ((app: App, isServer: boolean) => PromiseOrNot<Record<string, unknown>>), (app: App, isServer: boolean) => Promise<Record<string, unknown>>>;
|
|
179
184
|
/**
|
|
180
185
|
* List of hooks
|
|
181
186
|
*/
|
|
@@ -188,7 +193,7 @@ interface Hooks {
|
|
|
188
193
|
extendsMarkdown: ExtendsHook<Markdown>;
|
|
189
194
|
extendsPageOptions: ExtendsHook<PageOptions>;
|
|
190
195
|
extendsPage: ExtendsHook<Page>;
|
|
191
|
-
extendsBundlerOptions: ExtendsHook<
|
|
196
|
+
extendsBundlerOptions: ExtendsHook<BundlerOptions>;
|
|
192
197
|
clientConfigFile: ClientConfigFileHook;
|
|
193
198
|
alias: AliasDefineHook;
|
|
194
199
|
define: AliasDefineHook;
|
|
@@ -263,7 +268,7 @@ interface PluginApi {
|
|
|
263
268
|
*
|
|
264
269
|
* A plugin package should have a `Plugin` as the default export
|
|
265
270
|
*/
|
|
266
|
-
type Plugin<T extends PluginObject = PluginObject> = T |
|
|
271
|
+
type Plugin<T extends PluginObject = PluginObject> = PluginFunction<T> | T;
|
|
267
272
|
/**
|
|
268
273
|
* Vuepress plugin function
|
|
269
274
|
*
|
|
@@ -274,7 +279,13 @@ type PluginFunction<T extends PluginObject = PluginObject> = (app: App) => T;
|
|
|
274
279
|
* Vuepress plugin object
|
|
275
280
|
*/
|
|
276
281
|
interface PluginObject extends Partial<HooksExposed> {
|
|
282
|
+
/**
|
|
283
|
+
* Name of the plugin
|
|
284
|
+
*/
|
|
277
285
|
name: string;
|
|
286
|
+
/**
|
|
287
|
+
* Allow the plugin to be used multiple times or not
|
|
288
|
+
*/
|
|
278
289
|
multiple?: boolean;
|
|
279
290
|
}
|
|
280
291
|
/**
|
|
@@ -347,17 +358,87 @@ interface ThemeInfo {
|
|
|
347
358
|
* Vuepress app common config that shared between dev and build
|
|
348
359
|
*/
|
|
349
360
|
interface AppConfigCommon extends Partial<SiteData> {
|
|
361
|
+
/**
|
|
362
|
+
* Source directory of the markdown files.
|
|
363
|
+
*
|
|
364
|
+
* Vuepress will load markdown files from this directory.
|
|
365
|
+
*
|
|
366
|
+
* @required
|
|
367
|
+
*/
|
|
350
368
|
source: string;
|
|
369
|
+
/**
|
|
370
|
+
* Destination directory of the output files.
|
|
371
|
+
*
|
|
372
|
+
* Vuepress will output the static site files to this directory.
|
|
373
|
+
*
|
|
374
|
+
* @default `${source}/.vuepress/dist`
|
|
375
|
+
*/
|
|
351
376
|
dest?: string;
|
|
377
|
+
/**
|
|
378
|
+
* Temp files directory.
|
|
379
|
+
*
|
|
380
|
+
* Vuepress will write temp files to this directory.
|
|
381
|
+
*
|
|
382
|
+
* @default `${source}/.vuepress/.temp`
|
|
383
|
+
*/
|
|
352
384
|
temp?: string;
|
|
385
|
+
/**
|
|
386
|
+
* Cache files directory.
|
|
387
|
+
*
|
|
388
|
+
* Vuepress will write cache files to this directory.
|
|
389
|
+
*
|
|
390
|
+
* @default `${source}/.vuepress/.cache`
|
|
391
|
+
*/
|
|
353
392
|
cache?: string;
|
|
393
|
+
/**
|
|
394
|
+
* Public files directory.
|
|
395
|
+
*
|
|
396
|
+
* Vuepress will copy the files from public directory to the output directory.
|
|
397
|
+
*
|
|
398
|
+
* @default `${source}/.vuepress/public`
|
|
399
|
+
*/
|
|
354
400
|
public?: string;
|
|
401
|
+
/**
|
|
402
|
+
* Whether to enable debug mode
|
|
403
|
+
*
|
|
404
|
+
* @default false
|
|
405
|
+
*/
|
|
355
406
|
debug?: boolean;
|
|
407
|
+
/**
|
|
408
|
+
* Markdown options
|
|
409
|
+
*
|
|
410
|
+
* @default {}
|
|
411
|
+
*/
|
|
356
412
|
markdown?: MarkdownOptions;
|
|
413
|
+
/**
|
|
414
|
+
* Patterns to match the markdown files as pages
|
|
415
|
+
*
|
|
416
|
+
* @default ['**\/*.md', '!.vuepress', '!node_modules']
|
|
417
|
+
*/
|
|
357
418
|
pagePatterns?: string[];
|
|
419
|
+
/**
|
|
420
|
+
* Pattern to generate permalink for pages
|
|
421
|
+
*
|
|
422
|
+
* @default null
|
|
423
|
+
*/
|
|
358
424
|
permalinkPattern?: string | null;
|
|
425
|
+
/**
|
|
426
|
+
* Vuepress bundler
|
|
427
|
+
*
|
|
428
|
+
* @required
|
|
429
|
+
*/
|
|
359
430
|
bundler: Bundler;
|
|
431
|
+
/**
|
|
432
|
+
* Vuepress theme
|
|
433
|
+
*
|
|
434
|
+
* @required
|
|
435
|
+
*/
|
|
360
436
|
theme: Theme;
|
|
437
|
+
/**
|
|
438
|
+
* Vuepress plugins
|
|
439
|
+
*
|
|
440
|
+
* @default []
|
|
441
|
+
*/
|
|
361
442
|
plugins?: PluginConfig;
|
|
362
443
|
}
|
|
363
444
|
/**
|
|
@@ -399,14 +480,14 @@ interface AppConfigBuild {
|
|
|
399
480
|
*
|
|
400
481
|
* @default true
|
|
401
482
|
*/
|
|
402
|
-
shouldPreload?: ((file: string, type: string) => boolean)
|
|
483
|
+
shouldPreload?: boolean | ((file: string, type: string) => boolean);
|
|
403
484
|
/**
|
|
404
485
|
* Determine what resource files should be prefetched. Use boolean value to
|
|
405
486
|
* totally enable / disable.
|
|
406
487
|
*
|
|
407
488
|
* @default true
|
|
408
489
|
*/
|
|
409
|
-
shouldPrefetch?: ((file: string, type: string) => boolean)
|
|
490
|
+
shouldPrefetch?: boolean | ((file: string, type: string) => boolean);
|
|
410
491
|
/**
|
|
411
492
|
* Specify the path of the HTML template to be used for build
|
|
412
493
|
*
|
|
@@ -416,16 +497,20 @@ interface AppConfigBuild {
|
|
|
416
497
|
/**
|
|
417
498
|
* Specify the HTML template renderer to be used for build
|
|
418
499
|
*
|
|
419
|
-
* @default templateRenderer from '@vuepress/utils'
|
|
500
|
+
* @default `import { templateRenderer } from '@vuepress/utils'`
|
|
420
501
|
*/
|
|
421
502
|
templateBuildRenderer?: TemplateRenderer;
|
|
422
503
|
}
|
|
423
504
|
/**
|
|
424
|
-
* Vuepress app config
|
|
505
|
+
* Vuepress app user config.
|
|
506
|
+
*
|
|
507
|
+
* It would be provided by user, typically via a config file.
|
|
425
508
|
*/
|
|
426
|
-
type AppConfig =
|
|
509
|
+
type AppConfig = AppConfigBuild & AppConfigCommon & AppConfigDev;
|
|
427
510
|
/**
|
|
428
|
-
* Vuepress app options
|
|
511
|
+
* Vuepress app options that resolved from user config.
|
|
512
|
+
*
|
|
513
|
+
* It fills all optional fields with a default value.
|
|
429
514
|
*/
|
|
430
515
|
type AppOptions = Required<AppConfig>;
|
|
431
516
|
|
|
@@ -437,11 +522,29 @@ type AppDirFunction = (...args: string[]) => string;
|
|
|
437
522
|
* Directory utils
|
|
438
523
|
*/
|
|
439
524
|
interface AppDir {
|
|
525
|
+
/**
|
|
526
|
+
* Resolve file path in cache directory
|
|
527
|
+
*/
|
|
440
528
|
cache: AppDirFunction;
|
|
529
|
+
/**
|
|
530
|
+
* Resolve file path in temp directory
|
|
531
|
+
*/
|
|
441
532
|
temp: AppDirFunction;
|
|
533
|
+
/**
|
|
534
|
+
* Resolve file path in source directory
|
|
535
|
+
*/
|
|
442
536
|
source: AppDirFunction;
|
|
537
|
+
/**
|
|
538
|
+
* Resolve file path in dest directory
|
|
539
|
+
*/
|
|
443
540
|
dest: AppDirFunction;
|
|
541
|
+
/**
|
|
542
|
+
* Resolve file path in public directory
|
|
543
|
+
*/
|
|
444
544
|
public: AppDirFunction;
|
|
545
|
+
/**
|
|
546
|
+
* Resolve file path in client directory
|
|
547
|
+
*/
|
|
445
548
|
client: AppDirFunction;
|
|
446
549
|
}
|
|
447
550
|
/**
|
|
@@ -467,41 +570,33 @@ interface AppEnv {
|
|
|
467
570
|
type AppWriteTemp = (file: string, content: string) => Promise<string>;
|
|
468
571
|
|
|
469
572
|
/**
|
|
470
|
-
*
|
|
573
|
+
* App base properties, will be available after creation, even before initialization
|
|
471
574
|
*/
|
|
472
|
-
interface
|
|
575
|
+
interface AppPropertiesBase {
|
|
473
576
|
/**
|
|
474
|
-
* Directory utils
|
|
577
|
+
* Directory utils.
|
|
475
578
|
*/
|
|
476
579
|
dir: AppDir;
|
|
477
580
|
/**
|
|
478
|
-
* Environment flags
|
|
581
|
+
* Environment flags.
|
|
479
582
|
*/
|
|
480
583
|
env: AppEnv;
|
|
481
584
|
/**
|
|
482
|
-
* Options that filled all optional fields with a default value
|
|
585
|
+
* Options that filled all optional fields with a default value.
|
|
483
586
|
*/
|
|
484
587
|
options: AppOptions;
|
|
485
588
|
/**
|
|
486
|
-
* Plugin system
|
|
589
|
+
* Plugin system.
|
|
487
590
|
*/
|
|
488
591
|
pluginApi: PluginApi;
|
|
489
592
|
/**
|
|
490
|
-
* Site data, which will be used in client side
|
|
593
|
+
* Site data, which will be used in client side.
|
|
491
594
|
*/
|
|
492
595
|
siteData: SiteData;
|
|
493
596
|
/**
|
|
494
|
-
* Version of vuepress core
|
|
597
|
+
* Version of vuepress core.
|
|
495
598
|
*/
|
|
496
599
|
version: string;
|
|
497
|
-
/**
|
|
498
|
-
* Write temp file
|
|
499
|
-
*/
|
|
500
|
-
writeTemp: AppWriteTemp;
|
|
501
|
-
/**
|
|
502
|
-
* Use a plugin
|
|
503
|
-
*/
|
|
504
|
-
use: (plugin: Plugin) => this;
|
|
505
600
|
/**
|
|
506
601
|
* Initialize app.
|
|
507
602
|
*
|
|
@@ -515,6 +610,21 @@ interface App {
|
|
|
515
610
|
* Should be called after `app.init()`.
|
|
516
611
|
*/
|
|
517
612
|
prepare: () => Promise<void>;
|
|
613
|
+
/**
|
|
614
|
+
* Use a plugin.
|
|
615
|
+
*
|
|
616
|
+
* Should be called before `app.init()`.
|
|
617
|
+
*/
|
|
618
|
+
use: (plugin: Plugin) => this;
|
|
619
|
+
/**
|
|
620
|
+
* Util to write temp file
|
|
621
|
+
*/
|
|
622
|
+
writeTemp: AppWriteTemp;
|
|
623
|
+
}
|
|
624
|
+
/**
|
|
625
|
+
* App initialized properties, will only be available after initialization
|
|
626
|
+
*/
|
|
627
|
+
interface AppPropertiesInitialized {
|
|
518
628
|
/**
|
|
519
629
|
* Markdown-it instance.
|
|
520
630
|
*
|
|
@@ -528,6 +638,10 @@ interface App {
|
|
|
528
638
|
*/
|
|
529
639
|
pages: Page[];
|
|
530
640
|
}
|
|
641
|
+
/**
|
|
642
|
+
* Vuepress app instance
|
|
643
|
+
*/
|
|
644
|
+
type App = AppPropertiesBase & AppPropertiesInitialized;
|
|
531
645
|
/**
|
|
532
646
|
* Vuepress dev app
|
|
533
647
|
*/
|
|
@@ -552,294 +666,38 @@ interface BuildApp extends App {
|
|
|
552
666
|
}
|
|
553
667
|
|
|
554
668
|
/**
|
|
555
|
-
* Generate
|
|
669
|
+
* Generate page chunk temp file of a single page
|
|
556
670
|
*/
|
|
557
|
-
declare const
|
|
671
|
+
declare const preparePageChunk: (app: App, page: Page) => Promise<void>;
|
|
558
672
|
|
|
559
673
|
/**
|
|
560
674
|
* Generate page component temp file of a single page
|
|
561
675
|
*/
|
|
562
676
|
declare const preparePageComponent: (app: App, page: Page) => Promise<void>;
|
|
563
677
|
|
|
564
|
-
/**
|
|
565
|
-
* Generate page data temp file of a single page
|
|
566
|
-
*/
|
|
567
|
-
declare const preparePageData: (app: App, page: Page) => Promise<void>;
|
|
568
|
-
|
|
569
|
-
/**
|
|
570
|
-
* Generate page key to page component map temp file
|
|
571
|
-
*/
|
|
572
|
-
declare const preparePagesComponents: (app: App) => Promise<void>;
|
|
573
|
-
|
|
574
|
-
/**
|
|
575
|
-
* Generate page path to page data map temp file
|
|
576
|
-
*/
|
|
577
|
-
declare const preparePagesData: (app: App) => Promise<void>;
|
|
578
|
-
|
|
579
678
|
/**
|
|
580
679
|
* Generate routes temp file
|
|
581
680
|
*/
|
|
582
|
-
declare const
|
|
583
|
-
|
|
584
|
-
/**
|
|
585
|
-
* Generate site data temp file
|
|
586
|
-
*/
|
|
587
|
-
declare const prepareSiteData: (app: App) => Promise<void>;
|
|
588
|
-
|
|
589
|
-
/**
|
|
590
|
-
* Initialize a vuepress app
|
|
591
|
-
*
|
|
592
|
-
* Plugins should be used before initialization.
|
|
593
|
-
*/
|
|
594
|
-
declare const appInit: (app: App) => Promise<void>;
|
|
595
|
-
|
|
596
|
-
/**
|
|
597
|
-
* Prepare files for development or build
|
|
598
|
-
*
|
|
599
|
-
* - page components
|
|
600
|
-
* - routes
|
|
601
|
-
* - site data
|
|
602
|
-
* - other files that generated by plugins
|
|
603
|
-
*/
|
|
604
|
-
declare const appPrepare: (app: App) => Promise<void>;
|
|
605
|
-
|
|
606
|
-
declare const appUse: (app: App, rawPlugin: Plugin) => App;
|
|
607
|
-
|
|
608
|
-
/**
|
|
609
|
-
* Create vuepress app
|
|
610
|
-
*/
|
|
611
|
-
declare const createBaseApp: (config: AppConfig, isBuild?: boolean) => App;
|
|
681
|
+
declare const prepareRoutes: (app: App) => Promise<void>;
|
|
612
682
|
|
|
613
683
|
/**
|
|
614
|
-
* Create vuepress build app
|
|
684
|
+
* Create vuepress build app.
|
|
615
685
|
*/
|
|
616
686
|
declare const createBuildApp: (config: AppConfig) => BuildApp;
|
|
617
687
|
|
|
618
688
|
/**
|
|
619
|
-
* Create vuepress dev app
|
|
689
|
+
* Create vuepress dev app.
|
|
620
690
|
*/
|
|
621
691
|
declare const createDevApp: (config: AppConfig) => DevApp;
|
|
622
692
|
|
|
623
|
-
/**
|
|
624
|
-
* Create directory util function
|
|
625
|
-
*/
|
|
626
|
-
declare const createAppDirFunction: (baseDir: string) => AppDirFunction;
|
|
627
693
|
/**
|
|
628
694
|
* Resolve directory utils for vuepress app
|
|
629
695
|
*/
|
|
630
696
|
declare const resolveAppDir: (options: AppOptions) => AppDir;
|
|
631
697
|
|
|
632
698
|
/**
|
|
633
|
-
*
|
|
634
|
-
*/
|
|
635
|
-
declare const resolveAppEnv: (options: AppOptions, isBuild: boolean) => AppEnv;
|
|
636
|
-
|
|
637
|
-
/**
|
|
638
|
-
* Create app options with default values
|
|
639
|
-
*/
|
|
640
|
-
declare const resolveAppOptions: ({ base, lang, title, description, head, locales, source, dest, temp, cache, public: publicDir, host, port, open, templateDev, shouldPreload, shouldPrefetch, templateBuild, bundler, debug, markdown, pagePatterns, permalinkPattern, plugins, theme, }: AppConfig) => AppOptions;
|
|
641
|
-
|
|
642
|
-
/**
|
|
643
|
-
* Resolve pages for vuepress app
|
|
644
|
-
*/
|
|
645
|
-
declare const resolveAppPages: (app: App) => Promise<Page[]>;
|
|
646
|
-
|
|
647
|
-
/**
|
|
648
|
-
* Resolve site data for vuepress app
|
|
649
|
-
*
|
|
650
|
-
* Site data will also be used in client
|
|
651
|
-
*/
|
|
652
|
-
declare const resolveAppSiteData: (options: AppOptions) => SiteData;
|
|
653
|
-
|
|
654
|
-
/**
|
|
655
|
-
* Resolve version of vuepress app
|
|
699
|
+
* Create vuepress page object
|
|
656
700
|
*/
|
|
657
|
-
declare const resolveAppVersion: () => string;
|
|
658
|
-
|
|
659
|
-
/**
|
|
660
|
-
* Resolve write temp file util for vuepress app
|
|
661
|
-
*/
|
|
662
|
-
declare const resolveAppWriteTemp: (dir: AppDir) => AppWriteTemp;
|
|
663
|
-
|
|
664
|
-
/**
|
|
665
|
-
* Resolve a plugin object according to name / path / module and config
|
|
666
|
-
*/
|
|
667
|
-
declare const resolvePluginObject: <T extends PluginObject = PluginObject>(app: App, plugin: Plugin<T>) => T;
|
|
668
|
-
|
|
669
|
-
/**
|
|
670
|
-
* Resolve theme info and its parent theme info
|
|
671
|
-
*/
|
|
672
|
-
declare const resolveThemeInfo: (app: App, theme: Theme) => ThemeInfo;
|
|
673
|
-
|
|
674
701
|
declare const createPage: (app: App, options: PageOptions) => Promise<Page>;
|
|
675
702
|
|
|
676
|
-
|
|
677
|
-
* Infer page path according to file path
|
|
678
|
-
*/
|
|
679
|
-
declare const inferPagePath: ({ app, filePathRelative, }: {
|
|
680
|
-
app: App;
|
|
681
|
-
filePathRelative: string | null;
|
|
682
|
-
}) => {
|
|
683
|
-
pathInferred: string | null;
|
|
684
|
-
pathLocale: string;
|
|
685
|
-
};
|
|
686
|
-
|
|
687
|
-
/**
|
|
688
|
-
* Render page content and extract related info
|
|
689
|
-
*/
|
|
690
|
-
declare const renderPageContent: ({ app, content, filePath, filePathRelative, options, }: {
|
|
691
|
-
app: App;
|
|
692
|
-
content: string;
|
|
693
|
-
filePath: string | null;
|
|
694
|
-
filePathRelative: string | null;
|
|
695
|
-
options: PageOptions;
|
|
696
|
-
}) => {
|
|
697
|
-
contentRendered: string;
|
|
698
|
-
deps: string[];
|
|
699
|
-
markdownEnv: Record<string, unknown>;
|
|
700
|
-
frontmatter: PageFrontmatter;
|
|
701
|
-
headers: MarkdownHeader[];
|
|
702
|
-
links: MarkdownLink[];
|
|
703
|
-
sfcBlocks: MarkdownSfcBlocks;
|
|
704
|
-
title: string;
|
|
705
|
-
};
|
|
706
|
-
|
|
707
|
-
/**
|
|
708
|
-
* Resolve page component and related info
|
|
709
|
-
*/
|
|
710
|
-
declare const resolvePageComponentInfo: ({ app, htmlFilePathRelative, key, }: {
|
|
711
|
-
app: App;
|
|
712
|
-
htmlFilePathRelative: string;
|
|
713
|
-
key: string;
|
|
714
|
-
}) => Promise<{
|
|
715
|
-
componentFilePath: string;
|
|
716
|
-
componentFilePathRelative: string;
|
|
717
|
-
componentFileChunkName: string;
|
|
718
|
-
}>;
|
|
719
|
-
|
|
720
|
-
/**
|
|
721
|
-
* Resolve page data file path
|
|
722
|
-
*/
|
|
723
|
-
declare const resolvePageDataInfo: ({ app, htmlFilePathRelative, key, }: {
|
|
724
|
-
app: App;
|
|
725
|
-
htmlFilePathRelative: string;
|
|
726
|
-
key: string;
|
|
727
|
-
}) => {
|
|
728
|
-
dataFilePath: string;
|
|
729
|
-
dataFilePathRelative: string;
|
|
730
|
-
dataFileChunkName: string;
|
|
731
|
-
};
|
|
732
|
-
|
|
733
|
-
/**
|
|
734
|
-
* Resolve page date according to frontmatter or file path
|
|
735
|
-
*
|
|
736
|
-
* It will be resolved as 'yyyy-MM-dd' format
|
|
737
|
-
*/
|
|
738
|
-
declare const resolvePageDate: ({ frontmatter, filePathRelative, }: {
|
|
739
|
-
frontmatter: PageFrontmatter;
|
|
740
|
-
filePathRelative: string | null;
|
|
741
|
-
}) => string;
|
|
742
|
-
|
|
743
|
-
/**
|
|
744
|
-
* Resolve page file content according to filePath or options content
|
|
745
|
-
*/
|
|
746
|
-
declare const resolvePageFileContent: ({ filePath, options, }: {
|
|
747
|
-
filePath: string | null;
|
|
748
|
-
options: PageOptions;
|
|
749
|
-
}) => Promise<string>;
|
|
750
|
-
|
|
751
|
-
/**
|
|
752
|
-
* Resolve absolute and relative path of page file
|
|
753
|
-
*/
|
|
754
|
-
declare const resolvePageFilePath: ({ app, options, }: {
|
|
755
|
-
app: App;
|
|
756
|
-
options: PageOptions;
|
|
757
|
-
}) => {
|
|
758
|
-
filePath: string | null;
|
|
759
|
-
filePathRelative: string | null;
|
|
760
|
-
};
|
|
761
|
-
|
|
762
|
-
/**
|
|
763
|
-
* Resolve page rendered html file path
|
|
764
|
-
*/
|
|
765
|
-
declare const resolvePageHtmlInfo: ({ app, path: pagePath, }: {
|
|
766
|
-
app: App;
|
|
767
|
-
path: string;
|
|
768
|
-
}) => {
|
|
769
|
-
htmlFilePath: string;
|
|
770
|
-
htmlFilePathRelative: string;
|
|
771
|
-
};
|
|
772
|
-
|
|
773
|
-
/**
|
|
774
|
-
* Resolve page key to identify the page
|
|
775
|
-
*/
|
|
776
|
-
declare const resolvePageKey: ({ path }: {
|
|
777
|
-
path: string;
|
|
778
|
-
}) => string;
|
|
779
|
-
|
|
780
|
-
/**
|
|
781
|
-
* Resolve language of page
|
|
782
|
-
*/
|
|
783
|
-
declare const resolvePageLang: ({ app, frontmatter, pathLocale, }: {
|
|
784
|
-
app: App;
|
|
785
|
-
frontmatter: PageFrontmatter;
|
|
786
|
-
pathLocale: string;
|
|
787
|
-
}) => string;
|
|
788
|
-
|
|
789
|
-
/**
|
|
790
|
-
* Resolve the final route path of a page
|
|
791
|
-
*/
|
|
792
|
-
declare const resolvePagePath: ({ permalink, pathInferred, options, }: {
|
|
793
|
-
permalink: string | null;
|
|
794
|
-
pathInferred: string | null;
|
|
795
|
-
options: PageOptions;
|
|
796
|
-
}) => string;
|
|
797
|
-
|
|
798
|
-
/**
|
|
799
|
-
* Resolve page permalink from frontmatter / options / pattern
|
|
800
|
-
*/
|
|
801
|
-
declare const resolvePagePermalink: ({ app, frontmatter, slug, date, pathInferred, pathLocale, }: {
|
|
802
|
-
app: App;
|
|
803
|
-
frontmatter: PageFrontmatter;
|
|
804
|
-
slug: string;
|
|
805
|
-
date: string;
|
|
806
|
-
pathInferred: string | null;
|
|
807
|
-
pathLocale: string;
|
|
808
|
-
}) => string | null;
|
|
809
|
-
|
|
810
|
-
/**
|
|
811
|
-
* Resolve page route meta
|
|
812
|
-
*/
|
|
813
|
-
declare const resolvePageRouteMeta: ({ frontmatter, }: {
|
|
814
|
-
frontmatter: PageFrontmatter;
|
|
815
|
-
}) => Record<string, unknown>;
|
|
816
|
-
|
|
817
|
-
/**
|
|
818
|
-
* Resolve page slug from filename
|
|
819
|
-
*/
|
|
820
|
-
declare const resolvePageSlug: ({ filePathRelative, }: {
|
|
821
|
-
filePathRelative: string | null;
|
|
822
|
-
}) => string;
|
|
823
|
-
|
|
824
|
-
/**
|
|
825
|
-
* Create hook queue for plugin system
|
|
826
|
-
*/
|
|
827
|
-
declare const createHookQueue: <T extends keyof Hooks>(name: T) => HookQueue<T>;
|
|
828
|
-
|
|
829
|
-
declare const createPluginApi: () => PluginApi;
|
|
830
|
-
|
|
831
|
-
declare const createPluginApiHooks: () => PluginApi['hooks'];
|
|
832
|
-
|
|
833
|
-
declare const createPluginApiRegisterHooks: (plugins: PluginApi['plugins'], hooks: PluginApi['hooks']) => PluginApi['registerHooks'];
|
|
834
|
-
|
|
835
|
-
/**
|
|
836
|
-
* Normalize alias and define hook
|
|
837
|
-
*/
|
|
838
|
-
declare const normalizeAliasDefineHook: (hook: AliasDefineHook['exposed']) => AliasDefineHook['normalized'];
|
|
839
|
-
|
|
840
|
-
/**
|
|
841
|
-
* Normalize hook for client config file
|
|
842
|
-
*/
|
|
843
|
-
declare const normalizeClientConfigFileHook: (hook: ClientConfigFileHook['exposed']) => ClientConfigFileHook['normalized'];
|
|
844
|
-
|
|
845
|
-
export { type AliasDefineHook, type App, type AppConfig, type AppConfigBuild, type AppConfigCommon, type AppConfigDev, type AppDir, type AppDirFunction, type AppEnv, type AppOptions, type AppWriteTemp, type BuildApp, type Bundler, type ClientConfigFileHook, type DevApp, type ExtendsHook, type Hook, type HookItem, type HookQueue, type Hooks, type HooksExposed, type HooksName, type HooksNormalized, type HooksResult, type LifeCycleHook, type Page, type PageOptions, type Plugin, type PluginApi, type PluginConfig, type PluginFunction, type PluginObject, type Theme, type ThemeFunction, type ThemeInfo, type ThemeObject, appInit, appPrepare, appUse, createAppDirFunction, createBaseApp, createBuildApp, createDevApp, createHookQueue, createPage, createPluginApi, createPluginApiHooks, createPluginApiRegisterHooks, inferPagePath, normalizeAliasDefineHook, normalizeClientConfigFileHook, prepareClientConfigs, preparePageComponent, preparePageData, preparePagesComponents, preparePagesData, preparePagesRoutes, prepareSiteData, renderPageContent, resolveAppDir, resolveAppEnv, resolveAppOptions, resolveAppPages, resolveAppSiteData, resolveAppVersion, resolveAppWriteTemp, resolvePageComponentInfo, resolvePageDataInfo, resolvePageDate, resolvePageFileContent, resolvePageFilePath, resolvePageHtmlInfo, resolvePageKey, resolvePageLang, resolvePagePath, resolvePagePermalink, resolvePageRouteMeta, resolvePageSlug, resolvePluginObject, resolveThemeInfo };
|
|
703
|
+
export { type AliasDefineHook, type App, type AppConfig, type AppConfigBuild, type AppConfigCommon, type AppConfigDev, type AppDir, type AppDirFunction, type AppEnv, type AppOptions, type AppPropertiesBase, type AppPropertiesInitialized, type AppWriteTemp, type BuildApp, type Bundler, type BundlerOptions, type ClientConfigFileHook, type DevApp, type ExtendsHook, type Hook, type HookItem, type HookQueue, type Hooks, type HooksExposed, type HooksName, type HooksNormalized, type HooksResult, type LifeCycleHook, type Page, type PageOptions, type Plugin, type PluginApi, type PluginConfig, type PluginFunction, type PluginObject, type Theme, type ThemeFunction, type ThemeInfo, type ThemeObject, createBuildApp, createDevApp, createPage, preparePageChunk, preparePageComponent, prepareRoutes, resolveAppDir };
|