vuepress-plugin-md-power 1.0.0-rc.80 → 1.0.0-rc.82

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 (93) hide show
  1. package/lib/client/components/CodeEditor.vue +4 -3
  2. package/lib/client/components/CodeSandbox.vue +1 -1
  3. package/lib/client/components/PDFViewer.vue +1 -1
  4. package/lib/client/components/Plot.vue +1 -1
  5. package/lib/client/components/Replit.vue +1 -1
  6. package/lib/client/composables/codeRepl.d.ts +7 -5
  7. package/lib/client/composables/codeRepl.js +253 -145
  8. package/lib/client/composables/pdf.d.ts +7 -3
  9. package/lib/client/composables/pdf.js +55 -81
  10. package/lib/client/composables/rustRepl.d.ts +3 -2
  11. package/lib/client/composables/rustRepl.js +96 -94
  12. package/lib/client/composables/size.d.ts +9 -5
  13. package/lib/client/composables/size.js +36 -44
  14. package/lib/client/index.js +2 -1
  15. package/lib/client/options.d.ts +5 -2
  16. package/lib/client/options.js +5 -1
  17. package/lib/client/utils/http.d.ts +3 -1
  18. package/lib/client/utils/http.js +24 -20
  19. package/lib/client/utils/is.d.ts +5 -3
  20. package/lib/client/utils/is.js +16 -10
  21. package/lib/client/utils/link.d.ts +3 -1
  22. package/lib/client/utils/link.js +8 -4
  23. package/lib/client/utils/sleep.d.ts +3 -1
  24. package/lib/client/utils/sleep.js +8 -4
  25. package/lib/node/index.d.ts +188 -2
  26. package/lib/node/index.js +847 -2
  27. package/lib/shared/index.d.ts +185 -10
  28. package/lib/shared/index.js +0 -10
  29. package/package.json +9 -9
  30. package/lib/node/features/caniuse.d.ts +0 -25
  31. package/lib/node/features/caniuse.js +0 -87
  32. package/lib/node/features/codeSandbox.d.ts +0 -7
  33. package/lib/node/features/codeSandbox.js +0 -29
  34. package/lib/node/features/codepen.d.ts +0 -7
  35. package/lib/node/features/codepen.js +0 -42
  36. package/lib/node/features/icons/index.d.ts +0 -2
  37. package/lib/node/features/icons/index.js +0 -2
  38. package/lib/node/features/icons/plugin.d.ts +0 -10
  39. package/lib/node/features/icons/plugin.js +0 -61
  40. package/lib/node/features/icons/writer.d.ts +0 -11
  41. package/lib/node/features/icons/writer.js +0 -126
  42. package/lib/node/features/jsfiddle.d.ts +0 -6
  43. package/lib/node/features/jsfiddle.js +0 -28
  44. package/lib/node/features/langRepl.d.ts +0 -4
  45. package/lib/node/features/langRepl.js +0 -59
  46. package/lib/node/features/pdf.d.ts +0 -2
  47. package/lib/node/features/pdf.js +0 -31
  48. package/lib/node/features/plot.d.ts +0 -5
  49. package/lib/node/features/plot.js +0 -48
  50. package/lib/node/features/replit.d.ts +0 -7
  51. package/lib/node/features/replit.js +0 -22
  52. package/lib/node/features/video/bilibili.d.ts +0 -2
  53. package/lib/node/features/video/bilibili.js +0 -58
  54. package/lib/node/features/video/youtube.d.ts +0 -2
  55. package/lib/node/features/video/youtube.js +0 -47
  56. package/lib/node/plugin.d.ts +0 -3
  57. package/lib/node/plugin.js +0 -80
  58. package/lib/node/prepareConfigFile.d.ts +0 -3
  59. package/lib/node/prepareConfigFile.js +0 -59
  60. package/lib/node/utils/createRuleBlock.d.ts +0 -18
  61. package/lib/node/utils/createRuleBlock.js +0 -34
  62. package/lib/node/utils/package.d.ts +0 -4
  63. package/lib/node/utils/package.js +0 -4
  64. package/lib/node/utils/parseRect.d.ts +0 -1
  65. package/lib/node/utils/parseRect.js +0 -5
  66. package/lib/node/utils/resolveAttrs.d.ts +0 -4
  67. package/lib/node/utils/resolveAttrs.js +0 -29
  68. package/lib/node/utils/timeToSeconds.d.ts +0 -1
  69. package/lib/node/utils/timeToSeconds.js +0 -8
  70. package/lib/shared/caniuse.d.ts +0 -18
  71. package/lib/shared/caniuse.js +0 -1
  72. package/lib/shared/codeSandbox.d.ts +0 -11
  73. package/lib/shared/codeSandbox.js +0 -1
  74. package/lib/shared/codepen.d.ts +0 -10
  75. package/lib/shared/codepen.js +0 -1
  76. package/lib/shared/icons.d.ts +0 -17
  77. package/lib/shared/icons.js +0 -1
  78. package/lib/shared/jsfiddle.d.ts +0 -8
  79. package/lib/shared/jsfiddle.js +0 -1
  80. package/lib/shared/pdf.d.ts +0 -15
  81. package/lib/shared/pdf.js +0 -1
  82. package/lib/shared/plot.d.ts +0 -27
  83. package/lib/shared/plot.js +0 -1
  84. package/lib/shared/plugin.d.ts +0 -21
  85. package/lib/shared/plugin.js +0 -1
  86. package/lib/shared/repl.d.ts +0 -22
  87. package/lib/shared/repl.js +0 -1
  88. package/lib/shared/replit.d.ts +0 -6
  89. package/lib/shared/replit.js +0 -1
  90. package/lib/shared/size.d.ts +0 -5
  91. package/lib/shared/size.js +0 -1
  92. package/lib/shared/video.d.ts +0 -22
  93. package/lib/shared/video.js +0 -1
@@ -1,4 +1,4 @@
1
- export declare function rustExecute(code: string, { onEnd, onError, onStderr, onStdout, onBegin }: RustExecuteOptions): Promise<void>;
1
+ declare function rustExecute(code: string, { onEnd, onError, onStderr, onStdout, onBegin }: RustExecuteOptions): Promise<void>;
2
2
  interface RustExecuteOptions {
3
3
  onBegin?: () => void;
4
4
  onStdout?: (message: string) => void;
@@ -6,4 +6,5 @@ interface RustExecuteOptions {
6
6
  onEnd?: () => void;
7
7
  onError?: (message: string) => void;
8
8
  }
9
- export {};
9
+
10
+ export { rustExecute };
@@ -1,102 +1,104 @@
1
- /**
2
- * 相比于 golang kotlin 可以比较简单的实现,
3
- * rust 需要通过 websocket 建立连接在实现交互,因此,将其进行一些包装,
4
- * 方便在 codeRepl 中使用
5
- */
6
- import { tryOnScopeDispose } from '@vueuse/core';
7
- const wsUrl = 'wss://play.rust-lang.org/websocket';
8
- const payloadType = {
9
- connected: 'websocket/connected',
10
- request: 'output/execute/wsExecuteRequest',
11
- execute: {
12
- begin: 'output/execute/wsExecuteBegin',
13
- // status: 'output/execute/wsExecuteStatus',
14
- stderr: 'output/execute/wsExecuteStderr',
15
- stdout: 'output/execute/wsExecuteStdout',
16
- end: 'output/execute/wsExecuteEnd',
17
- },
1
+ // src/client/composables/rustRepl.ts
2
+ import { tryOnScopeDispose } from "@vueuse/core";
3
+ var wsUrl = "wss://play.rust-lang.org/websocket";
4
+ var payloadType = {
5
+ connected: "websocket/connected",
6
+ request: "output/execute/wsExecuteRequest",
7
+ execute: {
8
+ begin: "output/execute/wsExecuteBegin",
9
+ // status: 'output/execute/wsExecuteStatus',
10
+ stderr: "output/execute/wsExecuteStderr",
11
+ stdout: "output/execute/wsExecuteStdout",
12
+ end: "output/execute/wsExecuteEnd"
13
+ }
18
14
  };
19
- let ws = null;
20
- let isOpen = false;
21
- let uuid = 0;
15
+ var ws = null;
16
+ var isOpen = false;
17
+ var uuid = 0;
22
18
  function connect() {
23
- if (isOpen)
24
- return Promise.resolve();
25
- ws = new WebSocket(wsUrl);
26
- uuid = 0;
27
- ws.addEventListener('open', () => {
28
- isOpen = true;
29
- send(payloadType.connected, { iAcceptThisIsAnUnsupportedApi: true }, { websocket: true, sequenceNumber: uuid });
30
- });
31
- ws.addEventListener('close', () => {
32
- isOpen = false;
33
- ws = null;
34
- });
35
- tryOnScopeDispose(() => ws?.close());
36
- return new Promise((resolve) => {
37
- function connected(e) {
38
- const data = JSON.parse(e.data);
39
- if (data.type === payloadType.connected) {
40
- ws?.removeEventListener('message', connected);
41
- resolve();
42
- }
43
- }
44
- ws?.addEventListener('message', connected);
45
- });
19
+ if (isOpen)
20
+ return Promise.resolve();
21
+ ws = new WebSocket(wsUrl);
22
+ uuid = 0;
23
+ ws.addEventListener("open", () => {
24
+ isOpen = true;
25
+ send(
26
+ payloadType.connected,
27
+ { iAcceptThisIsAnUnsupportedApi: true },
28
+ { websocket: true, sequenceNumber: uuid }
29
+ );
30
+ });
31
+ ws.addEventListener("close", () => {
32
+ isOpen = false;
33
+ ws = null;
34
+ });
35
+ tryOnScopeDispose(() => ws?.close());
36
+ return new Promise((resolve) => {
37
+ function connected(e) {
38
+ const data = JSON.parse(e.data);
39
+ if (data.type === payloadType.connected) {
40
+ ws?.removeEventListener("message", connected);
41
+ resolve();
42
+ }
43
+ }
44
+ ws?.addEventListener("message", connected);
45
+ });
46
46
  }
47
47
  function send(type, payload, meta) {
48
- const msg = { type, meta, payload };
49
- ws?.send(JSON.stringify(msg));
48
+ const msg = { type, meta, payload };
49
+ ws?.send(JSON.stringify(msg));
50
50
  }
51
- export async function rustExecute(code, { onEnd, onError, onStderr, onStdout, onBegin }) {
52
- await connect();
53
- const meta = { sequenceNumber: uuid++ };
54
- const payload = {
55
- backtrace: false,
56
- channel: 'stable',
57
- crateType: 'bin',
58
- edition: '2021',
59
- mode: 'release',
60
- tests: false,
61
- code,
62
- };
63
- send(payloadType.request, payload, meta);
64
- let stdout = '';
65
- let stderr = '';
66
- function onMessage(e) {
67
- const data = JSON.parse(e.data);
68
- const { type, payload, meta: _meta = {} } = data;
69
- if (_meta.sequenceNumber !== meta.sequenceNumber)
70
- return;
71
- if (type === payloadType.execute.begin)
72
- onBegin?.();
73
- if (type === payloadType.execute.stdout) {
74
- stdout += payload;
75
- if (stdout.endsWith('\n')) {
76
- onStdout?.(stdout);
77
- stdout = '';
78
- }
79
- }
80
- if (type === payloadType.execute.stderr) {
81
- stderr += payload;
82
- if (stderr.endsWith('\n')) {
83
- if (stderr.startsWith('error:')) {
84
- const index = stderr.indexOf('\n');
85
- onStderr?.(stderr.slice(0, index));
86
- onStderr?.(stderr.slice(index + 1));
87
- }
88
- else {
89
- onStderr?.(stderr);
90
- }
91
- stderr = '';
92
- }
93
- }
94
- if (type === payloadType.execute.end) {
95
- if (payload.success === false)
96
- onError?.(payload.exitDetail);
97
- ws?.removeEventListener('message', onMessage);
98
- onEnd?.();
51
+ async function rustExecute(code, { onEnd, onError, onStderr, onStdout, onBegin }) {
52
+ await connect();
53
+ const meta = { sequenceNumber: uuid++ };
54
+ const payload = {
55
+ backtrace: false,
56
+ channel: "stable",
57
+ crateType: "bin",
58
+ edition: "2021",
59
+ mode: "release",
60
+ tests: false,
61
+ code
62
+ };
63
+ send(payloadType.request, payload, meta);
64
+ let stdout = "";
65
+ let stderr = "";
66
+ function onMessage(e) {
67
+ const data = JSON.parse(e.data);
68
+ const { type, payload: payload2, meta: _meta = {} } = data;
69
+ if (_meta.sequenceNumber !== meta.sequenceNumber)
70
+ return;
71
+ if (type === payloadType.execute.begin)
72
+ onBegin?.();
73
+ if (type === payloadType.execute.stdout) {
74
+ stdout += payload2;
75
+ if (stdout.endsWith("\n")) {
76
+ onStdout?.(stdout);
77
+ stdout = "";
78
+ }
79
+ }
80
+ if (type === payloadType.execute.stderr) {
81
+ stderr += payload2;
82
+ if (stderr.endsWith("\n")) {
83
+ if (stderr.startsWith("error:")) {
84
+ const index = stderr.indexOf("\n");
85
+ onStderr?.(stderr.slice(0, index));
86
+ onStderr?.(stderr.slice(index + 1));
87
+ } else {
88
+ onStderr?.(stderr);
99
89
  }
90
+ stderr = "";
91
+ }
92
+ }
93
+ if (type === payloadType.execute.end) {
94
+ if (payload2.success === false)
95
+ onError?.(payload2.exitDetail);
96
+ ws?.removeEventListener("message", onMessage);
97
+ onEnd?.();
100
98
  }
101
- ws?.addEventListener('message', onMessage);
99
+ }
100
+ ws?.addEventListener("message", onMessage);
102
101
  }
102
+ export {
103
+ rustExecute
104
+ };
@@ -1,3 +1,7 @@
1
+ import { MaybeRef } from '@vueuse/core';
2
+ import { ShallowRef, Ref, ToRefs } from 'vue';
3
+ import { SizeOptions } from '../../shared/index.js';
4
+
1
5
  /**
2
6
  * Fork for https://github.com/vuepress-theme-hope/vuepress-theme-hope/blob/main/packages/components/src/client/composables/useSize.ts
3
7
  *
@@ -10,13 +14,13 @@
10
14
  *
11
15
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
12
16
  */
13
- import type { MaybeRef } from '@vueuse/core';
14
- import type { Ref, ShallowRef, ToRefs } from 'vue';
15
- import type { SizeOptions } from '../../shared/size.js';
16
- export interface SizeInfo<T extends HTMLElement> {
17
+
18
+ interface SizeInfo<T extends HTMLElement> {
17
19
  el: ShallowRef<T | undefined>;
18
20
  width: Ref<string>;
19
21
  height: Ref<string>;
20
22
  resize: () => void;
21
23
  }
22
- export declare function useSize<T extends HTMLElement>(options: ToRefs<SizeOptions>, extraHeight?: MaybeRef<number>): SizeInfo<T>;
24
+ declare function useSize<T extends HTMLElement>(options: ToRefs<SizeOptions>, extraHeight?: MaybeRef<number>): SizeInfo<T>;
25
+
26
+ export { type SizeInfo, useSize };
@@ -1,45 +1,37 @@
1
- /**
2
- * Fork for https://github.com/vuepress-theme-hope/vuepress-theme-hope/blob/main/packages/components/src/client/composables/useSize.ts
3
- *
4
- * The MIT License (MIT)
5
- * Copyright (C) 2021 - PRESENT by Mr.Hope<mister-hope@outlook.com>
6
- *
7
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
8
- *
9
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
10
- *
11
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
12
- */
13
- import { useEventListener } from '@vueuse/core';
14
- import { computed, isRef, onMounted, ref, shallowRef, toValue, watch } from 'vue';
15
- export function useSize(options, extraHeight = 0) {
16
- const el = shallowRef();
17
- const width = computed(() => toValue(options.width) || '100%');
18
- const height = ref('auto');
19
- const getRadio = (ratio) => {
20
- if (typeof ratio === 'string') {
21
- const [width, height] = ratio.split(':');
22
- const parsedRadio = Number(width) / Number(height);
23
- if (!Number.isNaN(parsedRadio))
24
- return parsedRadio;
25
- }
26
- return typeof ratio === 'number' ? ratio : 16 / 9;
27
- };
28
- const getHeight = (width) => {
29
- const height = toValue(options.height);
30
- const ratio = getRadio(toValue(options.ratio));
31
- return height || `${Number(width) / ratio + toValue(extraHeight)}px`;
32
- };
33
- const resize = () => {
34
- if (el.value)
35
- height.value = getHeight(el.value.offsetWidth);
36
- };
37
- onMounted(() => {
38
- resize();
39
- if (isRef(extraHeight))
40
- watch(extraHeight, resize);
41
- useEventListener('orientationchange', resize);
42
- useEventListener('resize', resize);
43
- });
44
- return { el, width, height, resize };
1
+ // src/client/composables/size.ts
2
+ import { useEventListener } from "@vueuse/core";
3
+ import { computed, isRef, onMounted, ref, shallowRef, toValue, watch } from "vue";
4
+ function useSize(options, extraHeight = 0) {
5
+ const el = shallowRef();
6
+ const width = computed(() => toValue(options.width) || "100%");
7
+ const height = ref("auto");
8
+ const getRadio = (ratio) => {
9
+ if (typeof ratio === "string") {
10
+ const [width2, height2] = ratio.split(":");
11
+ const parsedRadio = Number(width2) / Number(height2);
12
+ if (!Number.isNaN(parsedRadio))
13
+ return parsedRadio;
14
+ }
15
+ return typeof ratio === "number" ? ratio : 16 / 9;
16
+ };
17
+ const getHeight = (width2) => {
18
+ const height2 = toValue(options.height);
19
+ const ratio = getRadio(toValue(options.ratio));
20
+ return height2 || `${Number(width2) / ratio + toValue(extraHeight)}px`;
21
+ };
22
+ const resize = () => {
23
+ if (el.value)
24
+ height.value = getHeight(el.value.offsetWidth);
25
+ };
26
+ onMounted(() => {
27
+ resize();
28
+ if (isRef(extraHeight))
29
+ watch(extraHeight, resize);
30
+ useEventListener("orientationchange", resize);
31
+ useEventListener("resize", resize);
32
+ });
33
+ return { el, width, height, resize };
45
34
  }
35
+ export {
36
+ useSize
37
+ };
@@ -1 +1,2 @@
1
- export * from '../shared/index.js';
1
+ // src/client/index.ts
2
+ export * from "../shared/index.js";
@@ -1,2 +1,5 @@
1
- import type { MarkdownPowerPluginOptions } from '../shared/index.js';
2
- export declare const pluginOptions: MarkdownPowerPluginOptions;
1
+ import { MarkdownPowerPluginOptions } from '../shared/index.js';
2
+
3
+ declare const pluginOptions: MarkdownPowerPluginOptions;
4
+
5
+ export { pluginOptions };
@@ -1 +1,5 @@
1
- export const pluginOptions = __MD_POWER_INJECT_OPTIONS__;
1
+ // src/client/options.ts
2
+ var pluginOptions = __MD_POWER_INJECT_OPTIONS__;
3
+ export {
4
+ pluginOptions
5
+ };
@@ -1,4 +1,6 @@
1
- export declare const http: {
1
+ declare const http: {
2
2
  get: <T extends object = object, R = any>(url: string, query?: T) => Promise<R>;
3
3
  post: <T extends object = object, R = any>(url: string, data?: T) => Promise<R>;
4
4
  };
5
+
6
+ export { http };
@@ -1,21 +1,25 @@
1
- export const http = {
2
- get: async (url, query) => {
3
- const _url = new URL(url);
4
- if (query) {
5
- for (const [key, value] of Object.entries(query))
6
- _url.searchParams.append(key, value);
7
- }
8
- const res = await fetch(_url.toString());
9
- return await res.json();
10
- },
11
- post: async (url, data) => {
12
- const res = await fetch(url, {
13
- method: 'POST',
14
- headers: {
15
- 'Content-Type': 'application/json',
16
- },
17
- body: data ? JSON.stringify(data) : undefined,
18
- });
19
- return await res.json();
20
- },
1
+ // src/client/utils/http.ts
2
+ var http = {
3
+ get: async (url, query) => {
4
+ const _url = new URL(url);
5
+ if (query) {
6
+ for (const [key, value] of Object.entries(query))
7
+ _url.searchParams.append(key, value);
8
+ }
9
+ const res = await fetch(_url.toString());
10
+ return await res.json();
11
+ },
12
+ post: async (url, data) => {
13
+ const res = await fetch(url, {
14
+ method: "POST",
15
+ headers: {
16
+ "Content-Type": "application/json"
17
+ },
18
+ body: data ? JSON.stringify(data) : void 0
19
+ });
20
+ return await res.json();
21
+ }
22
+ };
23
+ export {
24
+ http
21
25
  };
@@ -1,3 +1,5 @@
1
- export declare function checkIsMobile(ua: string): boolean;
2
- export declare function checkIsSafari(ua: string): boolean;
3
- export declare function checkIsiPad(ua: string): boolean;
1
+ declare function checkIsMobile(ua: string): boolean;
2
+ declare function checkIsSafari(ua: string): boolean;
3
+ declare function checkIsiPad(ua: string): boolean;
4
+
5
+ export { checkIsMobile, checkIsSafari, checkIsiPad };
@@ -1,13 +1,19 @@
1
- export function checkIsMobile(ua) {
2
- return /\b(?:Android|iPhone)/i.test(ua);
1
+ // src/client/utils/is.ts
2
+ function checkIsMobile(ua) {
3
+ return /\b(?:Android|iPhone)/i.test(ua);
3
4
  }
4
- export function checkIsSafari(ua) {
5
- return /version\/[\w.]+ .*(?:mobile ?safari|safari)/i.test(ua);
5
+ function checkIsSafari(ua) {
6
+ return /version\/[\w.]+ .*(?:mobile ?safari|safari)/i.test(ua);
6
7
  }
7
- export function checkIsiPad(ua) {
8
- return [
9
- /\((ipad);[-\w),; ]+apple/i,
10
- /applecoremedia\/[\w.]+ \((ipad)/i,
11
- /\b(ipad)\d\d?,\d\d?[;\]].+ios/i,
12
- ].some(item => item.test(ua));
8
+ function checkIsiPad(ua) {
9
+ return [
10
+ /\((ipad);[-\w),; ]+apple/i,
11
+ /applecoremedia\/[\w.]+ \((ipad)/i,
12
+ /\b(ipad)\d\d?,\d\d?[;\]].+ios/i
13
+ ].some((item) => item.test(ua));
13
14
  }
15
+ export {
16
+ checkIsMobile,
17
+ checkIsSafari,
18
+ checkIsiPad
19
+ };
@@ -1 +1,3 @@
1
- export declare function normalizeLink(url: string): string;
1
+ declare function normalizeLink(url: string): string;
2
+
3
+ export { normalizeLink };
@@ -1,5 +1,9 @@
1
- import { isLinkHttp } from 'vuepress/shared';
2
- import { withBase } from 'vuepress/client';
3
- export function normalizeLink(url) {
4
- return isLinkHttp(url) ? url : withBase(url);
1
+ // src/client/utils/link.ts
2
+ import { isLinkHttp } from "vuepress/shared";
3
+ import { withBase } from "vuepress/client";
4
+ function normalizeLink(url) {
5
+ return isLinkHttp(url) ? url : withBase(url);
5
6
  }
7
+ export {
8
+ normalizeLink
9
+ };
@@ -1 +1,3 @@
1
- export declare function sleep(ms: number): Promise<void>;
1
+ declare function sleep(ms: number): Promise<void>;
2
+
3
+ export { sleep };
@@ -1,5 +1,9 @@
1
- export function sleep(ms) {
2
- return new Promise((resolve) => {
3
- setTimeout(resolve, ms);
4
- });
1
+ // src/client/utils/sleep.ts
2
+ function sleep(ms) {
3
+ return new Promise((resolve) => {
4
+ setTimeout(resolve, ms);
5
+ });
5
6
  }
7
+ export {
8
+ sleep
9
+ };