@delta-comic/ui 3.0.0-next.7 → 3.0.0-next.9
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/core-CccJCdWI.js +22 -0
- package/dist/{core-NNJn692v.js.map → core-CccJCdWI.js.map} +1 -1
- package/dist/{dist-js-X_dgLCzM.js → dist-js-BlNPHicQ.js} +2 -2
- package/dist/{dist-js-X_dgLCzM.js.map → dist-js-BlNPHicQ.js.map} +1 -1
- package/dist/index.css +2 -2
- package/dist/index.d.ts +1289 -60
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4216 -4178
- package/dist/index.js.map +1 -1
- package/dist/rolldown-runtime-Dy4uBu1J.js +11 -0
- package/dist-vite/index.d.mts +0 -1
- package/package.json +27 -29
- package/dist/core-NNJn692v.js +0 -27
package/dist/index.d.ts
CHANGED
|
@@ -3,8 +3,6 @@ import { FormCheckbox, FormConfigure, FormDate, FormDateRange, FormNumber, FormP
|
|
|
3
3
|
import { ImageProps } from "naive-ui";
|
|
4
4
|
import { RouteLocationRaw } from "vue-router";
|
|
5
5
|
import { DataState, UseInfiniteQueryReturn, UseQueryReturn } from "@pinia/colada";
|
|
6
|
-
import MarkdownIt, { Options } from "markdown-it";
|
|
7
|
-
|
|
8
6
|
//#region lib/components/DcAuthorIcon.vue.d.ts
|
|
9
7
|
type __VLS_Props$17 = {
|
|
10
8
|
author: {
|
|
@@ -37,7 +35,7 @@ declare const __VLS_export$27: <T extends PromiseLike<unknown>>(__VLS_props: Non
|
|
|
37
35
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
38
36
|
};
|
|
39
37
|
declare const _default$1: typeof __VLS_export$27;
|
|
40
|
-
type __VLS_PrettifyLocal$9<T> = (T extends any ? { [K in keyof T]: T[K] } : { [K in keyof T as K]: T[K] }) & {};
|
|
38
|
+
type __VLS_PrettifyLocal$9<T> = (T extends any ? { [K in keyof T]: T[K]; } : { [K in keyof T as K]: T[K]; }) & {};
|
|
41
39
|
//#endregion
|
|
42
40
|
//#region lib/components/DcCell.vue.d.ts
|
|
43
41
|
type __VLS_Props$16 = {
|
|
@@ -57,7 +55,8 @@ type __VLS_Props$16 = {
|
|
|
57
55
|
titleStyle?: string | Record<string, any>;
|
|
58
56
|
arrowDirection?: 'up' | 'down' | 'left' | 'right';
|
|
59
57
|
required?: boolean | 'auto';
|
|
60
|
-
clickable?: boolean | null;
|
|
58
|
+
clickable?: boolean | null;
|
|
59
|
+
/** vue-router 路由跳转 */
|
|
61
60
|
to?: any;
|
|
62
61
|
url?: string;
|
|
63
62
|
replace?: boolean;
|
|
@@ -84,19 +83,14 @@ declare const __VLS_base$6: import("vue").DefineComponent<__VLS_Props$16, {}, {}
|
|
|
84
83
|
click: (event: MouseEvent) => any;
|
|
85
84
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props$16> & Readonly<{
|
|
86
85
|
onClick?: ((event: MouseEvent) => any) | undefined;
|
|
87
|
-
}>, {
|
|
88
|
-
border: boolean;
|
|
89
|
-
tag: string;
|
|
90
|
-
required: boolean | "auto";
|
|
91
|
-
clickable: boolean | null;
|
|
92
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
86
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
93
87
|
declare const __VLS_export$26: __VLS_WithSlots$6<typeof __VLS_base$6, __VLS_Slots$6>;
|
|
94
88
|
declare const _default$2: typeof __VLS_export$26;
|
|
95
89
|
type __VLS_WithSlots$6<T, S> = T & {
|
|
96
90
|
new (): {
|
|
97
91
|
$slots: S;
|
|
98
92
|
};
|
|
99
|
-
};
|
|
93
|
+
};
|
|
100
94
|
//#endregion
|
|
101
95
|
//#region lib/components/DcCellGroup.vue.d.ts
|
|
102
96
|
type __VLS_Props$15 = {
|
|
@@ -115,7 +109,7 @@ type __VLS_WithSlots$5<T, S> = T & {
|
|
|
115
109
|
new (): {
|
|
116
110
|
$slots: S;
|
|
117
111
|
};
|
|
118
|
-
};
|
|
112
|
+
};
|
|
119
113
|
//#endregion
|
|
120
114
|
//#region lib/components/config-provider/context.d.ts
|
|
121
115
|
type DcConfigTheme = 'dark' | 'light';
|
|
@@ -144,7 +138,7 @@ type __VLS_WithSlots$4<T, S> = T & {
|
|
|
144
138
|
new (): {
|
|
145
139
|
$slots: S;
|
|
146
140
|
};
|
|
147
|
-
};
|
|
141
|
+
};
|
|
148
142
|
//#endregion
|
|
149
143
|
//#region lib/utils/layout.d.ts
|
|
150
144
|
/**
|
|
@@ -232,7 +226,7 @@ declare const __VLS_export$23: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS
|
|
|
232
226
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
233
227
|
};
|
|
234
228
|
declare const _default$5: typeof __VLS_export$23;
|
|
235
|
-
type __VLS_PrettifyLocal$8<T> = (T extends any ? { [K in keyof T]: T[K] } : { [K in keyof T as K]: T[K] }) & {};
|
|
229
|
+
type __VLS_PrettifyLocal$8<T> = (T extends any ? { [K in keyof T]: T[K]; } : { [K in keyof T as K]: T[K]; }) & {};
|
|
236
230
|
//#endregion
|
|
237
231
|
//#region lib/components/DcImage.vue.d.ts
|
|
238
232
|
type __VLS_Props$14 = {
|
|
@@ -994,24 +988,21 @@ declare const __VLS_base$3: import("vue").DefineComponent<__VLS_Props$14, {
|
|
|
994
988
|
previewDisabled: boolean;
|
|
995
989
|
}> | null>>;
|
|
996
990
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
997
|
-
error: () => any;
|
|
998
991
|
click: (e: Event) => any;
|
|
992
|
+
error: () => any;
|
|
999
993
|
load: (...args: any[]) => any;
|
|
1000
994
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props$14> & Readonly<{
|
|
1001
|
-
onError?: (() => any) | undefined;
|
|
1002
995
|
onClick?: ((e: Event) => any) | undefined;
|
|
996
|
+
onError?: (() => any) | undefined;
|
|
1003
997
|
onLoad?: ((...args: any[]) => any) | undefined;
|
|
1004
|
-
}>, {
|
|
1005
|
-
retryMax: number;
|
|
1006
|
-
fetchpriority: "high" | "low" | "auto";
|
|
1007
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
998
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
1008
999
|
declare const __VLS_export$22: __VLS_WithSlots$3<typeof __VLS_base$3, __VLS_Slots$3>;
|
|
1009
1000
|
declare const _default$17: typeof __VLS_export$22;
|
|
1010
1001
|
type __VLS_WithSlots$3<T, S> = T & {
|
|
1011
1002
|
new (): {
|
|
1012
1003
|
$slots: S;
|
|
1013
1004
|
};
|
|
1014
|
-
};
|
|
1005
|
+
};
|
|
1015
1006
|
//#endregion
|
|
1016
1007
|
//#region lib/components/DcImagedIcon.vue.d.ts
|
|
1017
1008
|
type __VLS_Props$13 = {
|
|
@@ -1032,8 +1023,11 @@ declare const __VLS_export$20: <T extends object>(__VLS_props: NonNullable<Await
|
|
|
1032
1023
|
__VLS_PROPS_FALLBACK: infer P;
|
|
1033
1024
|
} ? P : {});
|
|
1034
1025
|
expose: (exposed: import("vue").ShallowUnwrapRef<{
|
|
1035
|
-
/** 当前滚动位置 */
|
|
1036
|
-
readonly
|
|
1026
|
+
/** 当前滚动位置 */
|
|
1027
|
+
readonly scrollTop: number | undefined;
|
|
1028
|
+
/** 滚动容器元素引用 */
|
|
1029
|
+
readonly scrollParent: HTMLElement | undefined;
|
|
1030
|
+
/** 重置瀑布流列表 */
|
|
1037
1031
|
reloadList(): Promise<void> | undefined;
|
|
1038
1032
|
}>) => void;
|
|
1039
1033
|
attrs: any;
|
|
@@ -1051,7 +1045,7 @@ declare const __VLS_export$20: <T extends object>(__VLS_props: NonNullable<Await
|
|
|
1051
1045
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
1052
1046
|
};
|
|
1053
1047
|
declare const _default$19: typeof __VLS_export$20;
|
|
1054
|
-
type __VLS_PrettifyLocal$7<T> = (T extends any ? { [K in keyof T]: T[K] } : { [K in keyof T as K]: T[K] }) & {};
|
|
1048
|
+
type __VLS_PrettifyLocal$7<T> = (T extends any ? { [K in keyof T]: T[K]; } : { [K in keyof T as K]: T[K]; }) & {};
|
|
1055
1049
|
//#endregion
|
|
1056
1050
|
//#region lib/components/DcLoading.vue.d.ts
|
|
1057
1051
|
type __VLS_Props$12 = {
|
|
@@ -1066,30 +1060,1268 @@ declare var __VLS_1: {};
|
|
|
1066
1060
|
type __VLS_Slots$2 = {} & {
|
|
1067
1061
|
default?: (props: typeof __VLS_1) => any;
|
|
1068
1062
|
};
|
|
1069
|
-
declare const __VLS_base$2: import("vue").DefineComponent<__VLS_Props$12, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props$12> & Readonly<{}>, {
|
|
1070
|
-
strokeWidth: string | number;
|
|
1071
|
-
spinning: boolean;
|
|
1072
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
1063
|
+
declare const __VLS_base$2: import("vue").DefineComponent<__VLS_Props$12, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props$12> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
1073
1064
|
declare const __VLS_export$19: __VLS_WithSlots$2<typeof __VLS_base$2, __VLS_Slots$2>;
|
|
1074
1065
|
declare const _default$20: typeof __VLS_export$19;
|
|
1075
1066
|
type __VLS_WithSlots$2<T, S> = T & {
|
|
1076
1067
|
new (): {
|
|
1077
1068
|
$slots: S;
|
|
1078
1069
|
};
|
|
1079
|
-
};
|
|
1070
|
+
};
|
|
1071
|
+
declare namespace index_d_exports$2 {
|
|
1072
|
+
export { Url, decode, encode, format, parse };
|
|
1073
|
+
}
|
|
1074
|
+
interface Url {
|
|
1075
|
+
protocol: string | null;
|
|
1076
|
+
slashes: boolean | null;
|
|
1077
|
+
auth: string | null;
|
|
1078
|
+
port: string | null;
|
|
1079
|
+
hostname: string | null;
|
|
1080
|
+
hash: string | null;
|
|
1081
|
+
search: string | null;
|
|
1082
|
+
pathname: string | null;
|
|
1083
|
+
}
|
|
1084
|
+
declare function decode(string: string, exclude?: string): string;
|
|
1085
|
+
declare namespace decode {
|
|
1086
|
+
let defaultChars: string;
|
|
1087
|
+
let componentChars: string;
|
|
1088
|
+
}
|
|
1089
|
+
declare function encode(string: string, keepEscaped?: boolean): string;
|
|
1090
|
+
declare function encode(string: string, exclude: string, keepEscaped?: boolean): string;
|
|
1091
|
+
declare namespace encode {
|
|
1092
|
+
let defaultChars: string;
|
|
1093
|
+
let componentChars: string;
|
|
1094
|
+
}
|
|
1095
|
+
declare function format(url: Url): string;
|
|
1096
|
+
declare function parse(url: string, slashesDenoteHost?: boolean): Url;
|
|
1097
|
+
declare namespace index_d_exports$1 {
|
|
1098
|
+
export { Any, Cc, Cf, P$1 as P, S$1 as S, Z };
|
|
1099
|
+
}
|
|
1100
|
+
declare const Any: RegExp;
|
|
1101
|
+
declare const Cc: RegExp;
|
|
1102
|
+
declare const Cf: RegExp;
|
|
1103
|
+
declare const P$1: RegExp;
|
|
1104
|
+
declare const S$1: RegExp;
|
|
1105
|
+
declare const Z: RegExp;
|
|
1106
|
+
//#endregion
|
|
1107
|
+
//#region ../../node_modules/.pnpm/linkify-it@6.1.0/node_modules/linkify-it/build/index.d.ts
|
|
1108
|
+
/**
|
|
1109
|
+
* @category types
|
|
1110
|
+
*/
|
|
1111
|
+
interface REBuilderOptions {
|
|
1112
|
+
'---'?: boolean;
|
|
1113
|
+
fuzzyIP?: boolean;
|
|
1114
|
+
schema_names?: string[];
|
|
1115
|
+
tlds?: string[];
|
|
1116
|
+
urlAuth?: boolean;
|
|
1117
|
+
maxLength?: number;
|
|
1118
|
+
}
|
|
1119
|
+
declare class REBuilder {
|
|
1120
|
+
src_Any: string;
|
|
1121
|
+
src_Cc: string;
|
|
1122
|
+
src_Z: string;
|
|
1123
|
+
src_P: string;
|
|
1124
|
+
src_ZPCc: string;
|
|
1125
|
+
src_ZCc: string;
|
|
1126
|
+
cache: Record<string, RegExp | undefined>;
|
|
1127
|
+
opts: REBuilderOptions;
|
|
1128
|
+
constructor(opts?: REBuilderOptions);
|
|
1129
|
+
set(opts?: REBuilderOptions): this;
|
|
1130
|
+
escapeRE(str: string): string;
|
|
1131
|
+
nestedPairRE(open: string, close: string, depth?: number): string;
|
|
1132
|
+
get_text_separators(): RegExp;
|
|
1133
|
+
get_pseudo_letter(): RegExp;
|
|
1134
|
+
get_ipv4_addr(): RegExp;
|
|
1135
|
+
get_ipv6_addr(): RegExp;
|
|
1136
|
+
get_ipv6_url_host(): RegExp;
|
|
1137
|
+
get_ipv6_mail_host(): RegExp;
|
|
1138
|
+
get_auth(): RegExp;
|
|
1139
|
+
get_port(): RegExp;
|
|
1140
|
+
get_host_terminator(): RegExp;
|
|
1141
|
+
get_path_terminator(): RegExp;
|
|
1142
|
+
get_path(): RegExp;
|
|
1143
|
+
get_mail_name(): RegExp;
|
|
1144
|
+
get_xn(): RegExp;
|
|
1145
|
+
get_tld(): RegExp;
|
|
1146
|
+
get_domain_root(): RegExp;
|
|
1147
|
+
get_domain(): RegExp;
|
|
1148
|
+
get_url_host_port(): RegExp;
|
|
1149
|
+
get_fuzzy_url_host_port(): RegExp;
|
|
1150
|
+
get_mail_host(): RegExp;
|
|
1151
|
+
get_fuzzy_mail_host(): RegExp;
|
|
1152
|
+
get_path_extra(): RegExp;
|
|
1153
|
+
get_fuzzy_mail_host_search(): RegExp;
|
|
1154
|
+
get_fuzzy_link_search(): RegExp;
|
|
1155
|
+
get_http_validator(): RegExp;
|
|
1156
|
+
get_relative_proto_validator(): RegExp;
|
|
1157
|
+
get_mail_name_validator(): RegExp;
|
|
1158
|
+
get_mailto_validator(): RegExp;
|
|
1159
|
+
get_schema_names(): RegExp;
|
|
1160
|
+
get_schema_search(): RegExp;
|
|
1161
|
+
get_schema_at_start(): RegExp;
|
|
1162
|
+
}
|
|
1163
|
+
/**
|
|
1164
|
+
* Recognition options for schemaless links.
|
|
1165
|
+
*
|
|
1166
|
+
* @category types
|
|
1167
|
+
*/
|
|
1168
|
+
interface LinkifyOptions {
|
|
1169
|
+
/** Recognize URLs without `http(s)://` prefix. Default `false`. */
|
|
1170
|
+
fuzzyLink?: boolean;
|
|
1171
|
+
/** Recognize emails without `mailto:` prefix. Default `true`. */
|
|
1172
|
+
fuzzyEmail?: boolean;
|
|
1173
|
+
/**
|
|
1174
|
+
* Allow IPs in fuzzy links. Can conflict with some texts, like version
|
|
1175
|
+
* numbers. Default `false`.
|
|
1176
|
+
*/
|
|
1177
|
+
fuzzyIP?: boolean;
|
|
1178
|
+
/**
|
|
1179
|
+
* Terminate link with `---` if it is considered a long dash. Default `false`.
|
|
1180
|
+
*/
|
|
1181
|
+
'---'?: boolean;
|
|
1182
|
+
/** Allowed TLDs list for fuzzy links. Replaces the default list when set. */
|
|
1183
|
+
tlds?: string[];
|
|
1184
|
+
/** Recognize authentication data in URLs. Default `false`. */
|
|
1185
|
+
urlAuth?: boolean;
|
|
1186
|
+
/** Maximum link length. Default `10000`. */
|
|
1187
|
+
maxLength?: number;
|
|
1188
|
+
}
|
|
1189
|
+
interface LinkifyConstructorOptions extends LinkifyOptions {
|
|
1190
|
+
/** Custom regular expression builder. */
|
|
1191
|
+
rebuilder?: REBuilder;
|
|
1192
|
+
}
|
|
1193
|
+
/**
|
|
1194
|
+
* Custom schema definition.
|
|
1195
|
+
*
|
|
1196
|
+
* @category types
|
|
1197
|
+
*/
|
|
1198
|
+
interface SchemaOpts {
|
|
1199
|
+
/**
|
|
1200
|
+
* Checks text after the schema prefix. Should return matched tail length on
|
|
1201
|
+
* success, or `0` on fail.
|
|
1202
|
+
*/
|
|
1203
|
+
validate: (text: string, pos: number, self: LinkifyIt) => number;
|
|
1204
|
+
/**
|
|
1205
|
+
* Optional function to normalize `text` and `url` of matched result, for
|
|
1206
|
+
* example for `@twitter` mentions.
|
|
1207
|
+
*/
|
|
1208
|
+
normalize?: (match: Match, self: LinkifyIt) => void;
|
|
1209
|
+
}
|
|
1210
|
+
/**
|
|
1211
|
+
* Match result returned by {@link LinkifyIt.match} and
|
|
1212
|
+
* {@link LinkifyIt.matchAtStart}.
|
|
1213
|
+
*
|
|
1214
|
+
* @category types
|
|
1215
|
+
*/
|
|
1216
|
+
declare class Match {
|
|
1217
|
+
/** Prefix (protocol) for matched string. Empty for fuzzy links. */
|
|
1218
|
+
schema: string;
|
|
1219
|
+
/** First position of matched string. */
|
|
1220
|
+
index: number;
|
|
1221
|
+
/** Next position after matched string. */
|
|
1222
|
+
lastIndex: number;
|
|
1223
|
+
/** Matched string. */
|
|
1224
|
+
raw: string;
|
|
1225
|
+
/** Normalized text of matched string. */
|
|
1226
|
+
text: string;
|
|
1227
|
+
/** Normalized URL of matched string. */
|
|
1228
|
+
url: string;
|
|
1229
|
+
constructor(text: string, schema: string, index: number, lastIndex: number);
|
|
1230
|
+
}
|
|
1231
|
+
/** Linkifier instance. */
|
|
1232
|
+
declare class LinkifyIt {
|
|
1233
|
+
__opts__: Required<LinkifyOptions>;
|
|
1234
|
+
private __schemas__;
|
|
1235
|
+
re: REBuilder;
|
|
1236
|
+
/**
|
|
1237
|
+
* Creates new linkifier instance.
|
|
1238
|
+
*
|
|
1239
|
+
* By default understands:
|
|
1240
|
+
*
|
|
1241
|
+
* - `http(s)://...` , `ftp://...`, `mailto:...` & `//...` links
|
|
1242
|
+
* - "fuzzy" emails (foo@bar.com).
|
|
1243
|
+
*
|
|
1244
|
+
* See {@link LinkifyConstructorOptions} for available options.
|
|
1245
|
+
*
|
|
1246
|
+
* @param options Recognition options.
|
|
1247
|
+
*
|
|
1248
|
+
* @example
|
|
1249
|
+
* ```javascript
|
|
1250
|
+
* import { LinkifyIt } from 'linkify-it'
|
|
1251
|
+
*
|
|
1252
|
+
* const linkify = new LinkifyIt({ fuzzyLink: true })
|
|
1253
|
+
*
|
|
1254
|
+
* linkify
|
|
1255
|
+
* .tlds(require('tlds')) // Reload with full TLD list
|
|
1256
|
+
* .tlds('onion', true) // Add unofficial `.onion` domain
|
|
1257
|
+
* .add('ftp:', null) // Disable `ftp:` protocol
|
|
1258
|
+
* .set({ fuzzyIP: true }) // Enable IPs in fuzzy links
|
|
1259
|
+
*
|
|
1260
|
+
* console.log(linkify.test('Site github.com!')) // true
|
|
1261
|
+
* console.log(linkify.match('Site github.com!'))
|
|
1262
|
+
* ```
|
|
1263
|
+
*/
|
|
1264
|
+
constructor(options?: LinkifyConstructorOptions);
|
|
1265
|
+
/**
|
|
1266
|
+
* Add new rule definition.
|
|
1267
|
+
*
|
|
1268
|
+
* `schema` is a link prefix (usually, protocol name with `:` at the end,
|
|
1269
|
+
* `skype:` for example). `linkify-it` makes sure that prefix is not
|
|
1270
|
+
* preceded with alphanumeric char and symbols. Only whitespaces and
|
|
1271
|
+
* punctuation allowed.
|
|
1272
|
+
*
|
|
1273
|
+
* `definition` is a rule to check tail after link prefix. To disable an
|
|
1274
|
+
* existing rule, pass `null`.
|
|
1275
|
+
*
|
|
1276
|
+
* @param schema Rule name (fixed pattern prefix).
|
|
1277
|
+
* @param definition Schema definition, or `null` to disable the rule.
|
|
1278
|
+
*
|
|
1279
|
+
* See [twitter mentions example](https://github.com/markdown-it/linkify-it/blob/master/examples/twitter.mjs).
|
|
1280
|
+
*/
|
|
1281
|
+
add(schema: string, definition?: SchemaOpts | null): this;
|
|
1282
|
+
/**
|
|
1283
|
+
* Set recognition options for links without schema.
|
|
1284
|
+
*
|
|
1285
|
+
* @param options Recognition options.
|
|
1286
|
+
*/
|
|
1287
|
+
set(options?: LinkifyOptions): this;
|
|
1288
|
+
/**
|
|
1289
|
+
* Searches linkifiable pattern and returns `true` on success or `false` on fail.
|
|
1290
|
+
*
|
|
1291
|
+
* @param text Text to scan.
|
|
1292
|
+
*/
|
|
1293
|
+
test(text: string): boolean;
|
|
1294
|
+
/**
|
|
1295
|
+
* Similar to {@link LinkifyIt.test} but checks only specific protocol tail exactly
|
|
1296
|
+
* at given position. Returns length of found pattern (0 on fail).
|
|
1297
|
+
*
|
|
1298
|
+
* @param text Text to scan.
|
|
1299
|
+
* @param schema Rule (schema) name.
|
|
1300
|
+
* @param pos Text offset to check from.
|
|
1301
|
+
*/
|
|
1302
|
+
testSchemaAt(text: string, schema: string, pos: number): number;
|
|
1303
|
+
/**
|
|
1304
|
+
* Returns array of found link descriptions or `null` on fail. We strongly
|
|
1305
|
+
* recommend to use {@link LinkifyIt.test} first, for best speed.
|
|
1306
|
+
*
|
|
1307
|
+
* @param text Text to scan.
|
|
1308
|
+
*/
|
|
1309
|
+
match(text: string): Match[] | null;
|
|
1310
|
+
/**
|
|
1311
|
+
* Returns fully-formed (not fuzzy) link if it starts at the beginning
|
|
1312
|
+
* of the string, and null otherwise.
|
|
1313
|
+
*
|
|
1314
|
+
* @param text Text to scan.
|
|
1315
|
+
*/
|
|
1316
|
+
matchAtStart(text: string): Match | null;
|
|
1317
|
+
/**
|
|
1318
|
+
* Load (or merge) new TLDs list. Those are used for fuzzy links (without
|
|
1319
|
+
* prefix) to avoid false positives. By default this algorithm is used:
|
|
1320
|
+
*
|
|
1321
|
+
* - hostname with any 2-letter root zones are ok.
|
|
1322
|
+
* - biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф
|
|
1323
|
+
* are ok.
|
|
1324
|
+
* - encoded (`xn--...`) root zones are ok.
|
|
1325
|
+
*
|
|
1326
|
+
* If list is replaced, then exact match for 2-chars root zones will be checked.
|
|
1327
|
+
*
|
|
1328
|
+
* @param list List of TLDs.
|
|
1329
|
+
* @param keepOld Merge with current list if `true` (`false` by default).
|
|
1330
|
+
*/
|
|
1331
|
+
tlds(list: string | string[], keepOld?: boolean): this;
|
|
1332
|
+
/**
|
|
1333
|
+
* Default normalizer (if schema does not define its own).
|
|
1334
|
+
*
|
|
1335
|
+
* @param match Match to normalize.
|
|
1336
|
+
*/
|
|
1337
|
+
normalize(match: Match): void;
|
|
1338
|
+
}
|
|
1339
|
+
//#endregion
|
|
1340
|
+
//#region ../../node_modules/.pnpm/markdown-it@15.0.0/node_modules/markdown-it/dist/markdown-it.d.mts
|
|
1341
|
+
//#endregion
|
|
1342
|
+
//#region src/types.d.ts
|
|
1343
|
+
/** @inline */
|
|
1344
|
+
interface Reference {
|
|
1345
|
+
title: string;
|
|
1346
|
+
href: string;
|
|
1347
|
+
}
|
|
1348
|
+
/**
|
|
1349
|
+
* Shared environment passed through parsing and rendering.
|
|
1350
|
+
*
|
|
1351
|
+
* Plugins may use it to store arbitrary data.
|
|
1352
|
+
*/
|
|
1353
|
+
interface Env {
|
|
1354
|
+
[key: string | symbol]: unknown;
|
|
1355
|
+
references?: Record<string, Reference>;
|
|
1356
|
+
}
|
|
1357
|
+
/** Delimiter entry used by emphasis-like inline rules. */
|
|
1358
|
+
interface Delimiter {
|
|
1359
|
+
/** Char code of the starting marker. */
|
|
1360
|
+
marker: number;
|
|
1361
|
+
/** Total length of this series of delimiters. */
|
|
1362
|
+
length?: number;
|
|
1363
|
+
/** A position of the token this delimiter corresponds to. */
|
|
1364
|
+
token: number;
|
|
1365
|
+
/**
|
|
1366
|
+
* If this delimiter is matched as a valid opener, `end` will be
|
|
1367
|
+
* equal to its position, otherwise it's `-1`.
|
|
1368
|
+
*/
|
|
1369
|
+
end: number;
|
|
1370
|
+
/** Whether this delimiter can open an emphasis. */
|
|
1371
|
+
open: boolean;
|
|
1372
|
+
/** Whether this delimiter can close an emphasis. */
|
|
1373
|
+
close: boolean;
|
|
1374
|
+
/** One delimiter represents two characters. */
|
|
1375
|
+
jump?: number;
|
|
1376
|
+
}
|
|
1377
|
+
/**
|
|
1378
|
+
* Options controlling Markdown parsing and rendering.
|
|
1379
|
+
*
|
|
1380
|
+
* @category Main
|
|
1381
|
+
*/
|
|
1382
|
+
interface MarkdownItOptions {
|
|
1383
|
+
/** Enable HTML tags in source. */
|
|
1384
|
+
html?: boolean;
|
|
1385
|
+
/** Use '/' to close single tags (`<br />`). */
|
|
1386
|
+
xhtmlOut?: boolean;
|
|
1387
|
+
/** Convert '\n' in paragraphs into `<br>`. */
|
|
1388
|
+
breaks?: boolean;
|
|
1389
|
+
/** CSS language prefix for fenced blocks, used by external syntax highlighters. */
|
|
1390
|
+
langPrefix?: string;
|
|
1391
|
+
/** Autoconvert URL-like text to links. */
|
|
1392
|
+
linkify?: boolean;
|
|
1393
|
+
/**
|
|
1394
|
+
* Enable language-neutral replacements and quotes beautification.
|
|
1395
|
+
*
|
|
1396
|
+
* See the [replacement rules](https://github.com/markdown-it/markdown-it/blob/master/src/rules_core/replacements.ts)
|
|
1397
|
+
* for the full list.
|
|
1398
|
+
*/
|
|
1399
|
+
typographer?: boolean;
|
|
1400
|
+
/**
|
|
1401
|
+
* Double + single quotes replacement pairs, when typographer is enabled
|
|
1402
|
+
* and smartquotes are on. Can be either a string or an array.
|
|
1403
|
+
*
|
|
1404
|
+
* For example, use `'«»„“'` for Russian, `'„“‚‘'` for German, and
|
|
1405
|
+
* `['«\xA0', '\xA0»', '‹\xA0', '\xA0›']` for French (including nbsp).
|
|
1406
|
+
*/
|
|
1407
|
+
quotes?: string | string[];
|
|
1408
|
+
/**
|
|
1409
|
+
* Highlighter function. Should return escaped HTML, or an empty string if
|
|
1410
|
+
* the source string was not changed and should be escaped externally.
|
|
1411
|
+
* If the result starts with `<pre`, the internal wrapper is skipped.
|
|
1412
|
+
*
|
|
1413
|
+
* The highlighter is called by the default `fence` renderer rule. If needed,
|
|
1414
|
+
* you can replace that renderer rule completely; see the
|
|
1415
|
+
* [renderer source](https://github.com/markdown-it/markdown-it/blob/master/src/renderer.ts).
|
|
1416
|
+
*
|
|
1417
|
+
* @example
|
|
1418
|
+
* ```js
|
|
1419
|
+
* import MarkdownIt from 'markdown-it'
|
|
1420
|
+
* import hljs from 'highlight.js' // https://highlightjs.org
|
|
1421
|
+
*
|
|
1422
|
+
* const md = new MarkdownIt({
|
|
1423
|
+
* highlight: function (str, lang) {
|
|
1424
|
+
* if (lang && hljs.getLanguage(lang)) {
|
|
1425
|
+
* try {
|
|
1426
|
+
* return hljs.highlight(str, { language: lang }).value
|
|
1427
|
+
* } catch (__) {}
|
|
1428
|
+
* }
|
|
1429
|
+
*
|
|
1430
|
+
* return '' // use external default escaping
|
|
1431
|
+
* }
|
|
1432
|
+
* });
|
|
1433
|
+
* ```
|
|
1434
|
+
*
|
|
1435
|
+
* @example
|
|
1436
|
+
* Or with full wrapper override (if you need assign class to `<pre>` or `<code>`):
|
|
1437
|
+
* ```js
|
|
1438
|
+
* import MarkdownIt from 'markdown-it'
|
|
1439
|
+
* import hljs from 'highlight.js' // https://highlightjs.org
|
|
1440
|
+
*
|
|
1441
|
+
* const md = new MarkdownIt({
|
|
1442
|
+
* highlight: function (str, lang) {
|
|
1443
|
+
* if (lang && hljs.getLanguage(lang)) {
|
|
1444
|
+
* try {
|
|
1445
|
+
* return `<pre><code class="hljs">${hljs.highlight(str,
|
|
1446
|
+
* { language: lang, ignoreIllegals: true }).value}</code></pre>`
|
|
1447
|
+
* } catch (__) {}
|
|
1448
|
+
* }
|
|
1449
|
+
*
|
|
1450
|
+
* return `<pre><code class="hljs">${md.utils.escapeHtml(str)}</code></pre>`
|
|
1451
|
+
* }
|
|
1452
|
+
* });
|
|
1453
|
+
* ```
|
|
1454
|
+
*/
|
|
1455
|
+
highlight?: ((str: string, lang: string, attrs: string) => string) | null;
|
|
1456
|
+
/** Internal protection against excessive recursion. */
|
|
1457
|
+
maxNesting?: number;
|
|
1458
|
+
}
|
|
1459
|
+
declare namespace utils_d_exports {
|
|
1460
|
+
export { arrayReplaceAt, asciiTrim, callable, escapeHtml, escapeRE, fromCodePoint, isMdAsciiPunct, isPunctChar, isPunctCharCode, isSpace, isValidEntityCode, isWhiteSpace, lib, normalizeReference, unescapeAll, unescapeMd };
|
|
1461
|
+
}
|
|
1462
|
+
/** @hidden */
|
|
1463
|
+
type ClassToWrap = new (...args: any[]) => object;
|
|
1464
|
+
/** Wraps a class so it can be called with or without `new`. */
|
|
1465
|
+
declare function callable<T extends ClassToWrap>(cls: T): T & ((...args: ConstructorParameters<T>) => InstanceType<T>);
|
|
1466
|
+
/**
|
|
1467
|
+
* Returns a copy of a token array with the token at `pos` replaced by
|
|
1468
|
+
* `newElements`. Used to transform token streams without modifying the
|
|
1469
|
+
* original array.
|
|
1470
|
+
*/
|
|
1471
|
+
declare function arrayReplaceAt<T>(src: T[], pos: number, newElements: T[]): T[];
|
|
1472
|
+
/** Checks whether a code point can be decoded from a numeric HTML entity. */
|
|
1473
|
+
declare function isValidEntityCode(c: number): boolean;
|
|
1474
|
+
/**
|
|
1475
|
+
* Converts a Unicode code point to a string, like `String.fromCodePoint()`,
|
|
1476
|
+
* but does not throw for invalid input.
|
|
1477
|
+
*/
|
|
1478
|
+
declare function fromCodePoint(c: number): string;
|
|
1479
|
+
/** Decodes Markdown backslash escapes. */
|
|
1480
|
+
declare function unescapeMd(str: string): string;
|
|
1481
|
+
/**
|
|
1482
|
+
* Decodes Markdown backslash escapes and HTML character references in link
|
|
1483
|
+
* destinations, link titles, and fenced code info strings.
|
|
1484
|
+
*/
|
|
1485
|
+
declare function unescapeAll(str: string): string;
|
|
1486
|
+
/** Escapes HTML special characters in a string. */
|
|
1487
|
+
declare function escapeHtml(str: string): string;
|
|
1488
|
+
/** Escapes regular expression metacharacters in a string. */
|
|
1489
|
+
declare function escapeRE(str: string): string;
|
|
1490
|
+
/** Checks whether a character code is an ASCII space or tab. */
|
|
1491
|
+
declare function isSpace(code: number): boolean;
|
|
1492
|
+
/**
|
|
1493
|
+
* Checks whether a character code is whitespace recognized by Markdown.
|
|
1494
|
+
*
|
|
1495
|
+
* Matches the Unicode `Zs` category or `\t`, `\f`, `\v`, `\r`, `\n`.
|
|
1496
|
+
*/
|
|
1497
|
+
declare function isWhiteSpace(code: number): boolean;
|
|
1498
|
+
/**
|
|
1499
|
+
* Checks whether a character is Unicode punctuation or a symbol.
|
|
1500
|
+
*
|
|
1501
|
+
* Does not support astral characters.
|
|
1502
|
+
*/
|
|
1503
|
+
declare function isPunctChar(ch: string): boolean;
|
|
1504
|
+
/** Checks whether a Unicode code point is punctuation or a symbol. */
|
|
1505
|
+
declare function isPunctCharCode(code: number): boolean;
|
|
1506
|
+
/**
|
|
1507
|
+
* Markdown ASCII punctuation characters.
|
|
1508
|
+
*
|
|
1509
|
+
* !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @,
|
|
1510
|
+
* [, \, ], ^, _, `, {, |, }, or ~
|
|
1511
|
+
*
|
|
1512
|
+
* http://spec.commonmark.org/0.15/#ascii-punctuation-character
|
|
1513
|
+
*
|
|
1514
|
+
* Don't confuse with Unicode punctuation. It lacks some characters in the
|
|
1515
|
+
* ASCII range.
|
|
1516
|
+
*/
|
|
1517
|
+
declare function isMdAsciiPunct(ch: number): boolean;
|
|
1518
|
+
/** Normalizes `[reference labels]` for case-insensitive lookup. */
|
|
1519
|
+
declare function normalizeReference(str: string): string;
|
|
1520
|
+
/**
|
|
1521
|
+
* "Light" `.trim()` for blocks (headings, paragraphs), where Unicode spaces
|
|
1522
|
+
* should be preserved.
|
|
1523
|
+
*/
|
|
1524
|
+
declare function asciiTrim(str: string): string;
|
|
1525
|
+
/**
|
|
1526
|
+
* Libraries commonly used by markdown-it and its plugins, re-exported to
|
|
1527
|
+
* reduce duplicate dependencies in browser bundles.
|
|
1528
|
+
*/
|
|
1529
|
+
declare const lib: {
|
|
1530
|
+
mdurl: typeof index_d_exports$2;
|
|
1531
|
+
ucmicro: typeof index_d_exports$1;
|
|
1532
|
+
};
|
|
1533
|
+
//#endregion
|
|
1534
|
+
//#region src/token.d.ts
|
|
1535
|
+
/** @inline */
|
|
1536
|
+
type TokenNesting = -1 | 0 | 1;
|
|
1537
|
+
/** @inline */
|
|
1538
|
+
type TokenAttribute = [name: string, value: string | number];
|
|
1539
|
+
/**
|
|
1540
|
+
* Represents one item in the parsed token stream, storing parsed data and
|
|
1541
|
+
* providing helpers for managing HTML attributes.
|
|
1542
|
+
*/
|
|
1543
|
+
declare class Token {
|
|
1544
|
+
/**
|
|
1545
|
+
* Type of the token (string, e.g. "paragraph_open")
|
|
1546
|
+
*/
|
|
1547
|
+
type: string;
|
|
1548
|
+
/**
|
|
1549
|
+
* html tag name, e.g. "p"
|
|
1550
|
+
*/
|
|
1551
|
+
tag: string;
|
|
1552
|
+
/** Html attributes. Format: `[ [ name1, value1 ], [ name2, value2 ] ]` */
|
|
1553
|
+
attrs: TokenAttribute[] | null;
|
|
1554
|
+
/**
|
|
1555
|
+
* Source map info. Format: `[ line_begin, line_end ]`
|
|
1556
|
+
*/
|
|
1557
|
+
map: [number, number] | null;
|
|
1558
|
+
/**
|
|
1559
|
+
* Level change (number in {-1, 0, 1} set), where:
|
|
1560
|
+
*
|
|
1561
|
+
* - `1` means the tag is opening
|
|
1562
|
+
* - `0` means the tag is self-closing
|
|
1563
|
+
* - `-1` means the tag is closing
|
|
1564
|
+
*/
|
|
1565
|
+
nesting: TokenNesting;
|
|
1566
|
+
/**
|
|
1567
|
+
* nesting level, the same as `state.level`
|
|
1568
|
+
*/
|
|
1569
|
+
level: number;
|
|
1570
|
+
/**
|
|
1571
|
+
* An array of child nodes (inline and img tokens)
|
|
1572
|
+
*/
|
|
1573
|
+
children: Token[] | null;
|
|
1574
|
+
/**
|
|
1575
|
+
* In a case of self-closing tag (code, html, fence, etc.),
|
|
1576
|
+
* it has contents of this tag.
|
|
1577
|
+
*/
|
|
1578
|
+
content: string;
|
|
1579
|
+
/**
|
|
1580
|
+
* '*' or '_' for emphasis, fence string for fence, etc.
|
|
1581
|
+
*/
|
|
1582
|
+
markup: string;
|
|
1583
|
+
/**
|
|
1584
|
+
* Additional information:
|
|
1585
|
+
*
|
|
1586
|
+
* - Info string for "fence" tokens
|
|
1587
|
+
* - The value "auto" for autolink "link_open" and "link_close" tokens
|
|
1588
|
+
* - The string value of the item marker for ordered-list "list_item_open" tokens
|
|
1589
|
+
*/
|
|
1590
|
+
info: string;
|
|
1591
|
+
/** A place for plugins to store an arbitrary data */
|
|
1592
|
+
meta: Record<string, unknown> | null;
|
|
1593
|
+
/**
|
|
1594
|
+
* True for block-level tokens, false for inline tokens.
|
|
1595
|
+
* Used in renderer to calculate line breaks
|
|
1596
|
+
*/
|
|
1597
|
+
block: boolean;
|
|
1598
|
+
/**
|
|
1599
|
+
* If it's true, ignore this element when rendering. Used for tight lists
|
|
1600
|
+
* to hide paragraphs.
|
|
1601
|
+
*/
|
|
1602
|
+
hidden: boolean;
|
|
1603
|
+
constructor(type: string, tag: string, nesting: TokenNesting);
|
|
1604
|
+
/**
|
|
1605
|
+
* Search attribute index by name.
|
|
1606
|
+
*/
|
|
1607
|
+
attrIndex(name: string): number;
|
|
1608
|
+
/**
|
|
1609
|
+
* Add `[ name, value ]` attribute to list. Init attrs if necessary
|
|
1610
|
+
*/
|
|
1611
|
+
attrPush(attrData: TokenAttribute): void;
|
|
1612
|
+
/**
|
|
1613
|
+
* Set `name` attribute to `value`. Override old value if exists.
|
|
1614
|
+
*/
|
|
1615
|
+
attrSet(name: string, value: string | number): void;
|
|
1616
|
+
/**
|
|
1617
|
+
* Get the value of attribute `name`, or null if it does not exist.
|
|
1618
|
+
*/
|
|
1619
|
+
attrGet(name: string): string | number | null;
|
|
1620
|
+
/**
|
|
1621
|
+
* Join value to existing attribute via space. Or create new attribute if not
|
|
1622
|
+
* exists. Useful to operate with token classes.
|
|
1623
|
+
*/
|
|
1624
|
+
attrJoin(name: string, value: string | number): void;
|
|
1625
|
+
}
|
|
1626
|
+
//#endregion
|
|
1627
|
+
//#region src/rules_inline/state_inline.d.ts
|
|
1628
|
+
/** @inline */
|
|
1629
|
+
interface ScannedDelimiters {
|
|
1630
|
+
can_open: boolean;
|
|
1631
|
+
can_close: boolean;
|
|
1632
|
+
length: number;
|
|
1633
|
+
}
|
|
1634
|
+
/** @inline */
|
|
1635
|
+
type StateTokenMeta = Record<string, unknown> & {
|
|
1636
|
+
delimiters?: Delimiter[];
|
|
1637
|
+
};
|
|
1638
|
+
/** Mutable state passed to inline rules while tokenizing inline content. */
|
|
1639
|
+
declare class StateInline {
|
|
1640
|
+
src: string;
|
|
1641
|
+
env: Env;
|
|
1642
|
+
md: MarkdownIt;
|
|
1643
|
+
tokens: Token[];
|
|
1644
|
+
tokens_meta: Array<StateTokenMeta | undefined>;
|
|
1645
|
+
pos: number;
|
|
1646
|
+
posMax: number;
|
|
1647
|
+
level: number;
|
|
1648
|
+
pending: string;
|
|
1649
|
+
pendingLevel: number;
|
|
1650
|
+
cache: Record<number, number>;
|
|
1651
|
+
backticks: Record<number, number>;
|
|
1652
|
+
backticksScanned: boolean;
|
|
1653
|
+
linkLevel: number;
|
|
1654
|
+
delimiters: Delimiter[];
|
|
1655
|
+
_prev_delimiters: Delimiter[][];
|
|
1656
|
+
Token: typeof Token;
|
|
1657
|
+
constructor(src: string, md: MarkdownIt, env: Env, outTokens: Token[]);
|
|
1658
|
+
pushPending(): Token;
|
|
1659
|
+
push(type: string, tag: string, nesting: -1 | 0 | 1): Token;
|
|
1660
|
+
scanDelims(start: number, canSplitWord: boolean): ScannedDelimiters;
|
|
1661
|
+
}
|
|
1662
|
+
//#endregion
|
|
1663
|
+
//#region src/helpers/parse_link_label.d.ts
|
|
1664
|
+
/** Finds the end of a link or image label (`[label]`). */
|
|
1665
|
+
declare function parseLinkLabel(state: StateInline, start: number, disableNested?: boolean): number;
|
|
1666
|
+
//#endregion
|
|
1667
|
+
//#region src/helpers/parse_link_destination.d.ts
|
|
1668
|
+
/** Parses the destination in `[label](destination "title")`. */
|
|
1669
|
+
declare function parseLinkDestination(str: string, start: number, max: number): {
|
|
1670
|
+
ok: boolean;
|
|
1671
|
+
pos: number;
|
|
1672
|
+
str: string;
|
|
1673
|
+
};
|
|
1674
|
+
//#endregion
|
|
1675
|
+
//#region src/helpers/parse_link_title.d.ts
|
|
1676
|
+
/** @inline */
|
|
1677
|
+
interface ParseLinkTitleResult {
|
|
1678
|
+
ok: boolean;
|
|
1679
|
+
can_continue: boolean;
|
|
1680
|
+
pos: number;
|
|
1681
|
+
str: string;
|
|
1682
|
+
marker: number;
|
|
1683
|
+
}
|
|
1684
|
+
/**
|
|
1685
|
+
* Parses the optional title in `[label](destination "title")` or
|
|
1686
|
+
* `[label]: destination "title"`.
|
|
1687
|
+
*
|
|
1688
|
+
* `prev_state` continues a reference title on the next source line.
|
|
1689
|
+
*/
|
|
1690
|
+
declare function parseLinkTitle(str: string, start: number, max: number, prev_state?: ParseLinkTitleResult): ParseLinkTitleResult;
|
|
1691
|
+
declare namespace index_d_exports {
|
|
1692
|
+
export { parseLinkDestination, parseLinkLabel, parseLinkTitle };
|
|
1693
|
+
}
|
|
1694
|
+
//#endregion
|
|
1695
|
+
//#region src/ruler.d.ts
|
|
1696
|
+
/** @inline */
|
|
1697
|
+
type RuleOptions = {
|
|
1698
|
+
alt?: string[];
|
|
1699
|
+
};
|
|
1700
|
+
/**
|
|
1701
|
+
* Helper class, used by {@link MarkdownIt.core}, {@link MarkdownIt.block} and
|
|
1702
|
+
* {@link MarkdownIt.inline} to manage sequences of functions (rules):
|
|
1703
|
+
*
|
|
1704
|
+
* - keep rules in defined order
|
|
1705
|
+
* - assign the name to each rule
|
|
1706
|
+
* - enable/disable rules
|
|
1707
|
+
* - add/replace rules
|
|
1708
|
+
* - allow assign rules to additional named chains (in the same)
|
|
1709
|
+
* - cacheing lists of active rules
|
|
1710
|
+
*
|
|
1711
|
+
* You will not need use this class directly until write plugins. For simple
|
|
1712
|
+
* rules control use {@link MarkdownIt.disable}, {@link MarkdownIt.enable} and
|
|
1713
|
+
* {@link MarkdownIt.use}.
|
|
1714
|
+
*/
|
|
1715
|
+
declare class Ruler<Args extends unknown[], Result> {
|
|
1716
|
+
__rules__: Array<{
|
|
1717
|
+
name: string;
|
|
1718
|
+
enabled: boolean;
|
|
1719
|
+
fn: (...args: Args) => Result;
|
|
1720
|
+
alt: string[];
|
|
1721
|
+
}>;
|
|
1722
|
+
__cache__: Record<string, Array<(...args: Args) => Result>> | null;
|
|
1723
|
+
__find__(name: string): number;
|
|
1724
|
+
__compile__(): void;
|
|
1725
|
+
/**
|
|
1726
|
+
* Replace rule by name with new function & options. Throws error if name not
|
|
1727
|
+
* found.
|
|
1728
|
+
*
|
|
1729
|
+
* @param name Rule name to replace.
|
|
1730
|
+
* @param fn New rule function.
|
|
1731
|
+
* @param options Rule options. `alt` is an array with names of "alternate"
|
|
1732
|
+
* chains.
|
|
1733
|
+
*
|
|
1734
|
+
* @example Replace existing typographer replacement rule with new one
|
|
1735
|
+
* ```javascript
|
|
1736
|
+
* import MarkdownIt from 'markdown-it'
|
|
1737
|
+
* const md = new MarkdownIt()
|
|
1738
|
+
*
|
|
1739
|
+
* md.core.ruler.at('replacements', function replace(state) {
|
|
1740
|
+
* //...
|
|
1741
|
+
* });
|
|
1742
|
+
* ```
|
|
1743
|
+
*/
|
|
1744
|
+
at(name: string, fn: (...args: Args) => Result, options?: RuleOptions): void;
|
|
1745
|
+
/**
|
|
1746
|
+
* Add new rule to chain before one with given name. See also
|
|
1747
|
+
* {@link Ruler.after}, {@link Ruler.push}.
|
|
1748
|
+
*
|
|
1749
|
+
* @param beforeName New rule will be added before this one.
|
|
1750
|
+
* @param ruleName Name of added rule.
|
|
1751
|
+
* @param fn Rule function.
|
|
1752
|
+
* @param options Rule options. `alt` is an array with names of "alternate"
|
|
1753
|
+
* chains.
|
|
1754
|
+
*
|
|
1755
|
+
* @example
|
|
1756
|
+
* ```javascript
|
|
1757
|
+
* import MarkdownIt from 'markdown-it'
|
|
1758
|
+
* const md = new MarkdownIt()
|
|
1759
|
+
*
|
|
1760
|
+
* md.block.ruler.before('paragraph', 'my_rule', function replace(state) {
|
|
1761
|
+
* //...
|
|
1762
|
+
* });
|
|
1763
|
+
* ```
|
|
1764
|
+
*/
|
|
1765
|
+
before(beforeName: string, ruleName: string, fn: (...args: Args) => Result, options?: RuleOptions): void;
|
|
1766
|
+
/**
|
|
1767
|
+
* Add new rule to chain after one with given name. See also
|
|
1768
|
+
* {@link Ruler.before}, {@link Ruler.push}.
|
|
1769
|
+
*
|
|
1770
|
+
* @param afterName New rule will be added after this one.
|
|
1771
|
+
* @param ruleName Name of added rule.
|
|
1772
|
+
* @param fn Rule function.
|
|
1773
|
+
* @param options Rule options. `alt` is an array with names of "alternate"
|
|
1774
|
+
* chains.
|
|
1775
|
+
*
|
|
1776
|
+
* @example
|
|
1777
|
+
* ```javascript
|
|
1778
|
+
* import MarkdownIt from 'markdown-it'
|
|
1779
|
+
* const md = new MarkdownIt()
|
|
1780
|
+
*
|
|
1781
|
+
* md.inline.ruler.after('text', 'my_rule', function replace(state) {
|
|
1782
|
+
* //...
|
|
1783
|
+
* });
|
|
1784
|
+
* ```
|
|
1785
|
+
*/
|
|
1786
|
+
after(afterName: string, ruleName: string, fn: (...args: Args) => Result, options?: RuleOptions): void;
|
|
1787
|
+
/**
|
|
1788
|
+
* Push new rule to the end of chain. See also
|
|
1789
|
+
* {@link Ruler.before}, {@link Ruler.after}.
|
|
1790
|
+
*
|
|
1791
|
+
* @param ruleName Name of added rule.
|
|
1792
|
+
* @param fn Rule function.
|
|
1793
|
+
* @param options Rule options. `alt` is an array with names of "alternate"
|
|
1794
|
+
* chains.
|
|
1795
|
+
*
|
|
1796
|
+
* @example
|
|
1797
|
+
* ```javascript
|
|
1798
|
+
* import MarkdownIt from 'markdown-it'
|
|
1799
|
+
* const md = new MarkdownIt()
|
|
1800
|
+
*
|
|
1801
|
+
* md.core.ruler.push('my_rule', function replace(state) {
|
|
1802
|
+
* //...
|
|
1803
|
+
* });
|
|
1804
|
+
* ```
|
|
1805
|
+
*/
|
|
1806
|
+
push(ruleName: string, fn: (...args: Args) => Result, options?: RuleOptions): void;
|
|
1807
|
+
/**
|
|
1808
|
+
* Enable rules with given names. If any rule name not found - throw Error.
|
|
1809
|
+
* Errors can be disabled by second param.
|
|
1810
|
+
*
|
|
1811
|
+
* See also {@link Ruler.disable}, {@link Ruler.enableOnly}.
|
|
1812
|
+
*
|
|
1813
|
+
* @param list List of rule names to enable.
|
|
1814
|
+
* @param ignoreInvalid Set `true` to ignore errors when rule not found.
|
|
1815
|
+
* @returns List of found rule names (if no exception happened).
|
|
1816
|
+
*/
|
|
1817
|
+
enable(list: string | string[], ignoreInvalid?: boolean): string[];
|
|
1818
|
+
/**
|
|
1819
|
+
* Enable rules with given names, and disable everything else. If any rule name
|
|
1820
|
+
* not found - throw Error. Errors can be disabled by second param.
|
|
1821
|
+
*
|
|
1822
|
+
* See also {@link Ruler.disable}, {@link Ruler.enable}.
|
|
1823
|
+
*
|
|
1824
|
+
* @param list List of rule names to enable (whitelist).
|
|
1825
|
+
* @param ignoreInvalid Set `true` to ignore errors when rule not found.
|
|
1826
|
+
*/
|
|
1827
|
+
enableOnly(list: string | string[], ignoreInvalid?: boolean): void;
|
|
1828
|
+
/**
|
|
1829
|
+
* Disable rules with given names. If any rule name not found - throw Error.
|
|
1830
|
+
* Errors can be disabled by second param.
|
|
1831
|
+
*
|
|
1832
|
+
* See also {@link Ruler.enable}, {@link Ruler.enableOnly}.
|
|
1833
|
+
*
|
|
1834
|
+
* @param list List of rule names to disable.
|
|
1835
|
+
* @param ignoreInvalid Set `true` to ignore errors when rule not found.
|
|
1836
|
+
* @returns List of found rule names (if no exception happened).
|
|
1837
|
+
*/
|
|
1838
|
+
disable(list: string | string[], ignoreInvalid?: boolean): string[];
|
|
1839
|
+
/**
|
|
1840
|
+
* Return array of active functions (rules) for given chain name. It analyzes
|
|
1841
|
+
* rules configuration, compiles caches if not exists and returns result.
|
|
1842
|
+
*
|
|
1843
|
+
* Default chain name is `''` (empty string). It can't be skipped. That's
|
|
1844
|
+
* done intentionally, to keep signature monomorphic for high speed.
|
|
1845
|
+
*/
|
|
1846
|
+
getRules(chainName: string): Array<(...args: Args) => Result>;
|
|
1847
|
+
}
|
|
1848
|
+
//#endregion
|
|
1849
|
+
//#region src/renderer.d.ts
|
|
1850
|
+
/** Function that renders a token at a given position in a token stream. */
|
|
1851
|
+
type RendererRule = (tokens: Token[], idx: number, options: Required<MarkdownItOptions>, env: Env | undefined, renderer: Renderer) => string;
|
|
1852
|
+
/**
|
|
1853
|
+
* Generates HTML from parsed token stream. Each instance has independent
|
|
1854
|
+
* copy of rules. Those can be rewritten with ease. Also, you can add new
|
|
1855
|
+
* rules if you create plugin and adds new token types.
|
|
1856
|
+
*
|
|
1857
|
+
* Creates new renderer instance and fills {@link Renderer.rules} with defaults.
|
|
1858
|
+
*/
|
|
1859
|
+
declare class Renderer {
|
|
1860
|
+
/**
|
|
1861
|
+
* Contains render rules for tokens. Can be updated and extended.
|
|
1862
|
+
*
|
|
1863
|
+
* See [source code](https://github.com/markdown-it/markdown-it/blob/master/src/renderer.ts)
|
|
1864
|
+
* for more details and examples.
|
|
1865
|
+
*
|
|
1866
|
+
* @example Custom render rules
|
|
1867
|
+
* ```javascript
|
|
1868
|
+
* import MarkdownIt from 'markdown-it'
|
|
1869
|
+
* const md = new MarkdownIt()
|
|
1870
|
+
*
|
|
1871
|
+
* md.renderer.rules.strong_open = function () { return '<b>'; };
|
|
1872
|
+
* md.renderer.rules.strong_close = function () { return '</b>'; };
|
|
1873
|
+
*
|
|
1874
|
+
* const result = md.renderInline(...);
|
|
1875
|
+
* ```
|
|
1876
|
+
*
|
|
1877
|
+
* @example Each rule is called as independent static function with fixed signature
|
|
1878
|
+
* ```javascript
|
|
1879
|
+
* function my_token_render(tokens, idx, options, env, renderer) {
|
|
1880
|
+
* // ...
|
|
1881
|
+
* return renderedHTML;
|
|
1882
|
+
* }
|
|
1883
|
+
* ```
|
|
1884
|
+
*/
|
|
1885
|
+
rules: Record<string, RendererRule>;
|
|
1886
|
+
/**
|
|
1887
|
+
* Render token attributes to string.
|
|
1888
|
+
*/
|
|
1889
|
+
renderAttrs(token: Pick<Token, 'attrs'>): string;
|
|
1890
|
+
/**
|
|
1891
|
+
* Default token renderer. Can be overriden by custom function
|
|
1892
|
+
* in {@link Renderer.rules}.
|
|
1893
|
+
*
|
|
1894
|
+
* @param tokens List of tokens.
|
|
1895
|
+
* @param idx Token index to render.
|
|
1896
|
+
* @param options Params of parser instance.
|
|
1897
|
+
*/
|
|
1898
|
+
renderToken(tokens: Token[], idx: number, options: Required<MarkdownItOptions>): string;
|
|
1899
|
+
/**
|
|
1900
|
+
* The same as {@link Renderer.render}, but for single token of `inline` type.
|
|
1901
|
+
*
|
|
1902
|
+
* @param tokens List on block tokens to render.
|
|
1903
|
+
* @param options Params of parser instance.
|
|
1904
|
+
* @param env Additional data from parsed input (references, for example).
|
|
1905
|
+
*/
|
|
1906
|
+
renderInline(tokens: Token[], options: Required<MarkdownItOptions>, env: Env | undefined): string;
|
|
1907
|
+
/**
|
|
1908
|
+
* Special kludge for image `alt` attributes to conform CommonMark spec.
|
|
1909
|
+
* Don't try to use it! Spec requires to show `alt` content with stripped markup,
|
|
1910
|
+
* instead of simple escaping.
|
|
1911
|
+
*
|
|
1912
|
+
* @param tokens List on block tokens to render.
|
|
1913
|
+
* @param options Params of parser instance.
|
|
1914
|
+
* @param env Additional data from parsed input (references, for example).
|
|
1915
|
+
*/
|
|
1916
|
+
renderInlineAsText(tokens: Token[], options: Required<MarkdownItOptions>, env: Env | undefined): string;
|
|
1917
|
+
/**
|
|
1918
|
+
* Takes token stream and generates HTML. Probably, you will never need to call
|
|
1919
|
+
* this method directly.
|
|
1920
|
+
*
|
|
1921
|
+
* @param tokens List on block tokens to render.
|
|
1922
|
+
* @param options Params of parser instance.
|
|
1923
|
+
* @param env Additional data from parsed input (references, for example).
|
|
1924
|
+
*/
|
|
1925
|
+
render(tokens: Token[], options: Required<MarkdownItOptions>, env?: Env): string;
|
|
1926
|
+
}
|
|
1927
|
+
//#endregion
|
|
1928
|
+
//#region src/rules_core/state_core.d.ts
|
|
1929
|
+
/** Mutable state passed through the core rules chain. */
|
|
1930
|
+
declare class StateCore {
|
|
1931
|
+
src: string;
|
|
1932
|
+
env: Env;
|
|
1933
|
+
tokens: Token[];
|
|
1934
|
+
inlineMode: boolean;
|
|
1935
|
+
md: MarkdownIt;
|
|
1936
|
+
Token: typeof Token;
|
|
1937
|
+
constructor(src: string, md: MarkdownIt, env: Env);
|
|
1938
|
+
}
|
|
1939
|
+
//#endregion
|
|
1940
|
+
//#region src/parser_core.d.ts
|
|
1941
|
+
/**
|
|
1942
|
+
* Top-level rules executor. Glues block/inline parsers and does intermediate
|
|
1943
|
+
* transformations.
|
|
1944
|
+
*/
|
|
1945
|
+
declare class ParserCore {
|
|
1946
|
+
/**
|
|
1947
|
+
* {@link Ruler} instance. Keep configuration of core rules.
|
|
1948
|
+
*/
|
|
1949
|
+
ruler: Ruler<[StateCore], void>;
|
|
1950
|
+
State: typeof StateCore;
|
|
1951
|
+
constructor();
|
|
1952
|
+
/**
|
|
1953
|
+
* Executes core chain rules.
|
|
1954
|
+
*/
|
|
1955
|
+
process(state: StateCore): void;
|
|
1956
|
+
}
|
|
1957
|
+
//#endregion
|
|
1958
|
+
//#region src/rules_block/state_block.d.ts
|
|
1959
|
+
/** Mutable state passed to block rules while tokenizing a source document. */
|
|
1960
|
+
declare class StateBlock {
|
|
1961
|
+
src: string;
|
|
1962
|
+
md: MarkdownIt;
|
|
1963
|
+
env: Env;
|
|
1964
|
+
tokens: Token[];
|
|
1965
|
+
bMarks: number[];
|
|
1966
|
+
eMarks: number[];
|
|
1967
|
+
tShift: number[];
|
|
1968
|
+
sCount: number[];
|
|
1969
|
+
bsCount: number[];
|
|
1970
|
+
blkIndent: number;
|
|
1971
|
+
line: number;
|
|
1972
|
+
lineMax: number;
|
|
1973
|
+
tight: boolean;
|
|
1974
|
+
listIndent: number;
|
|
1975
|
+
parentType: string;
|
|
1976
|
+
level: number;
|
|
1977
|
+
Token: typeof Token;
|
|
1978
|
+
constructor(src: string, md: MarkdownIt, env: Env, tokens: Token[]);
|
|
1979
|
+
push(type: string, tag: string, nesting: -1 | 0 | 1): Token;
|
|
1980
|
+
isEmpty(line: number): boolean;
|
|
1981
|
+
skipEmptyLines(from: number): number;
|
|
1982
|
+
skipSpaces(pos: number): number;
|
|
1983
|
+
skipSpacesBack(pos: number, min: number): number;
|
|
1984
|
+
skipChars(pos: number, code: number): number;
|
|
1985
|
+
skipCharsBack(pos: number, code: number, min: number): number;
|
|
1986
|
+
getLines(begin: number, end: number, indent: number, keepLastLF: boolean): string;
|
|
1987
|
+
}
|
|
1988
|
+
//#endregion
|
|
1989
|
+
//#region src/parser_block.d.ts
|
|
1990
|
+
/**
|
|
1991
|
+
* Block-level tokenizer.
|
|
1992
|
+
*/
|
|
1993
|
+
declare class ParserBlock {
|
|
1994
|
+
/**
|
|
1995
|
+
* {@link Ruler} instance. Keep configuration of block rules.
|
|
1996
|
+
*/
|
|
1997
|
+
ruler: Ruler<[StateBlock, number, number, boolean], boolean>;
|
|
1998
|
+
State: typeof StateBlock;
|
|
1999
|
+
constructor();
|
|
2000
|
+
tokenize(state: StateBlock, startLine: number, endLine: number): void;
|
|
2001
|
+
/**
|
|
2002
|
+
* Process input string and push block tokens into `outTokens`
|
|
2003
|
+
*/
|
|
2004
|
+
parse(src: string, md: MarkdownIt, env: Env, outTokens: Token[]): void;
|
|
2005
|
+
}
|
|
2006
|
+
//#endregion
|
|
2007
|
+
//#region src/parser_inline.d.ts
|
|
2008
|
+
/**
|
|
2009
|
+
* Tokenizes paragraph content.
|
|
2010
|
+
*/
|
|
2011
|
+
declare class ParserInline {
|
|
2012
|
+
/**
|
|
2013
|
+
* {@link Ruler} instance. Keep configuration of inline rules.
|
|
2014
|
+
*/
|
|
2015
|
+
ruler: Ruler<[StateInline, boolean], boolean>;
|
|
2016
|
+
/**
|
|
2017
|
+
* {@link Ruler} instance. Second ruler used for post-processing
|
|
2018
|
+
* (e.g. in emphasis-like rules).
|
|
2019
|
+
*/
|
|
2020
|
+
ruler2: Ruler<[StateInline], void>;
|
|
2021
|
+
State: typeof StateInline;
|
|
2022
|
+
constructor();
|
|
2023
|
+
skipToken(state: StateInline): void;
|
|
2024
|
+
tokenize(state: StateInline): void;
|
|
2025
|
+
/**
|
|
2026
|
+
* Process input string and push inline tokens into `outTokens`
|
|
2027
|
+
*/
|
|
2028
|
+
parse(str: string, md: MarkdownIt, env: Env, outTokens: Token[]): void;
|
|
2029
|
+
}
|
|
2030
|
+
//#endregion
|
|
2031
|
+
//#region src/markdownit.d.ts
|
|
2032
|
+
declare const config: {
|
|
2033
|
+
default: {
|
|
2034
|
+
options: Required<MarkdownItOptions>;
|
|
2035
|
+
components: {
|
|
2036
|
+
core: {};
|
|
2037
|
+
block: {};
|
|
2038
|
+
inline: {};
|
|
2039
|
+
};
|
|
2040
|
+
};
|
|
2041
|
+
zero: {
|
|
2042
|
+
options: Required<MarkdownItOptions>;
|
|
2043
|
+
components: {
|
|
2044
|
+
core: {
|
|
2045
|
+
rules: string[];
|
|
2046
|
+
};
|
|
2047
|
+
block: {
|
|
2048
|
+
rules: string[];
|
|
2049
|
+
};
|
|
2050
|
+
inline: {
|
|
2051
|
+
rules: string[];
|
|
2052
|
+
rules2: string[];
|
|
2053
|
+
};
|
|
2054
|
+
};
|
|
2055
|
+
};
|
|
2056
|
+
commonmark: {
|
|
2057
|
+
options: Required<MarkdownItOptions>;
|
|
2058
|
+
components: {
|
|
2059
|
+
core: {
|
|
2060
|
+
rules: string[];
|
|
2061
|
+
};
|
|
2062
|
+
block: {
|
|
2063
|
+
rules: string[];
|
|
2064
|
+
};
|
|
2065
|
+
inline: {
|
|
2066
|
+
rules: string[];
|
|
2067
|
+
rules2: string[];
|
|
2068
|
+
};
|
|
2069
|
+
};
|
|
2070
|
+
};
|
|
2071
|
+
};
|
|
2072
|
+
type MarkdownItPresetName = keyof typeof config;
|
|
2073
|
+
/**
|
|
2074
|
+
* Parser preset containing options and enabled rules for each parser component.
|
|
2075
|
+
*/
|
|
2076
|
+
interface MarkdownItPreset {
|
|
2077
|
+
options?: Required<MarkdownItOptions>;
|
|
2078
|
+
components?: {
|
|
2079
|
+
core?: {
|
|
2080
|
+
rules?: string[];
|
|
2081
|
+
};
|
|
2082
|
+
block?: {
|
|
2083
|
+
rules?: string[];
|
|
2084
|
+
};
|
|
2085
|
+
inline?: {
|
|
2086
|
+
rules?: string[];
|
|
2087
|
+
rules2?: string[];
|
|
2088
|
+
};
|
|
2089
|
+
};
|
|
2090
|
+
}
|
|
2091
|
+
/**
|
|
2092
|
+
* Parses Markdown into tokens and renders them to HTML.
|
|
2093
|
+
*
|
|
2094
|
+
* @category Main
|
|
2095
|
+
*/
|
|
2096
|
+
declare class MarkdownIt {
|
|
2097
|
+
/**
|
|
2098
|
+
* Instance of {@link ParserInline}. You may need it to add new rules when
|
|
2099
|
+
* writing plugins. For simple rules control use {@link MarkdownIt.disable}
|
|
2100
|
+
* and {@link MarkdownIt.enable}.
|
|
2101
|
+
*/
|
|
2102
|
+
inline: ParserInline;
|
|
2103
|
+
/**
|
|
2104
|
+
* Instance of {@link ParserBlock}. You may need it to add new rules when
|
|
2105
|
+
* writing plugins. For simple rules control use {@link MarkdownIt.disable}
|
|
2106
|
+
* and {@link MarkdownIt.enable}.
|
|
2107
|
+
*/
|
|
2108
|
+
block: ParserBlock;
|
|
2109
|
+
/**
|
|
2110
|
+
* Instance of {@link ParserCore} chain executor. You may need it to add new
|
|
2111
|
+
* rules when writing plugins. For simple rules control use
|
|
2112
|
+
* {@link MarkdownIt.disable} and {@link MarkdownIt.enable}.
|
|
2113
|
+
*/
|
|
2114
|
+
core: ParserCore;
|
|
2115
|
+
/**
|
|
2116
|
+
* Instance of {@link Renderer}. Use it to modify output look. Or to add rendering
|
|
2117
|
+
* rules for new token types, generated by plugins.
|
|
2118
|
+
*
|
|
2119
|
+
* See {@link Renderer} docs and
|
|
2120
|
+
* [source code](https://github.com/markdown-it/markdown-it/blob/master/src/renderer.ts).
|
|
2121
|
+
*
|
|
2122
|
+
* @example
|
|
2123
|
+
* ```javascript
|
|
2124
|
+
* import MarkdownIt from 'markdown-it'
|
|
2125
|
+
* const md = new MarkdownIt()
|
|
2126
|
+
*
|
|
2127
|
+
* function myToken(tokens, idx, options, env, self) {
|
|
2128
|
+
* //...
|
|
2129
|
+
* return result;
|
|
2130
|
+
* };
|
|
2131
|
+
*
|
|
2132
|
+
* md.renderer.rules['my_token'] = myToken
|
|
2133
|
+
* ```
|
|
2134
|
+
*/
|
|
2135
|
+
renderer: Renderer;
|
|
2136
|
+
/**
|
|
2137
|
+
* [linkify-it](https://github.com/markdown-it/linkify-it) instance.
|
|
2138
|
+
* Used by [linkify](https://github.com/markdown-it/markdown-it/blob/master/src/rules_core/linkify.ts)
|
|
2139
|
+
* rule.
|
|
2140
|
+
*/
|
|
2141
|
+
linkify: LinkifyIt;
|
|
2142
|
+
/**
|
|
2143
|
+
* Link validation function. CommonMark allows too much in links. By default
|
|
2144
|
+
* we disable `javascript:`, `vbscript:`, `file:` schemas, and almost all `data:...` schemas
|
|
2145
|
+
* except some embedded image types.
|
|
2146
|
+
*
|
|
2147
|
+
* You can change this behaviour:
|
|
2148
|
+
*
|
|
2149
|
+
* @example
|
|
2150
|
+
* ```javascript
|
|
2151
|
+
* import MarkdownIt from 'markdown-it'
|
|
2152
|
+
* const md = new MarkdownIt()
|
|
2153
|
+
*
|
|
2154
|
+
* // enable everything
|
|
2155
|
+
* md.validateLink = function () { return true; }
|
|
2156
|
+
* ```
|
|
2157
|
+
*/
|
|
2158
|
+
validateLink(url: string): boolean;
|
|
2159
|
+
/**
|
|
2160
|
+
* Function used to encode link url to a machine-readable format,
|
|
2161
|
+
* which includes url-encoding, punycode, etc.
|
|
2162
|
+
*/
|
|
2163
|
+
normalizeLink(url: string): string;
|
|
2164
|
+
/**
|
|
2165
|
+
* Function used to decode link url to a human-readable format`
|
|
2166
|
+
*/
|
|
2167
|
+
normalizeLinkText(url: string): string;
|
|
2168
|
+
/**
|
|
2169
|
+
* Assorted utility functions, useful to write plugins. See details
|
|
2170
|
+
* [here](https://github.com/markdown-it/markdown-it/blob/master/src/common/utils.ts).
|
|
2171
|
+
*/
|
|
2172
|
+
utils: typeof utils_d_exports;
|
|
2173
|
+
/**
|
|
2174
|
+
* Link components parser functions, useful to write plugins. See details
|
|
2175
|
+
* [here](https://github.com/markdown-it/markdown-it/blob/master/src/helpers).
|
|
2176
|
+
*/
|
|
2177
|
+
helpers: typeof index_d_exports;
|
|
2178
|
+
options: Required<MarkdownItOptions>;
|
|
2179
|
+
constructor(...args: [] | [options: MarkdownItOptions] | [presetName: MarkdownItPresetName, options?: MarkdownItOptions]);
|
|
2180
|
+
/**
|
|
2181
|
+
* Set parser options (in the same format as in constructor). Probably, you
|
|
2182
|
+
* will never need it, but you can change options after constructor call.
|
|
2183
|
+
*
|
|
2184
|
+
* __Note:__ To achieve the best possible performance, don't modify a
|
|
2185
|
+
* `markdown-it` instance options on the fly. If you need multiple configurations
|
|
2186
|
+
* it's best to create multiple instances and initialize each with separate
|
|
2187
|
+
* config.
|
|
2188
|
+
*
|
|
2189
|
+
* @example
|
|
2190
|
+
* ```javascript
|
|
2191
|
+
* import MarkdownIt from 'markdown-it'
|
|
2192
|
+
*
|
|
2193
|
+
* const md = new MarkdownIt()
|
|
2194
|
+
* .set({ html: true, breaks: true })
|
|
2195
|
+
* .set({ typographer: true })
|
|
2196
|
+
* ```
|
|
2197
|
+
*/
|
|
2198
|
+
set(options: MarkdownItOptions): this;
|
|
2199
|
+
/**
|
|
2200
|
+
* Batch load of all options and compenent settings. This is internal method,
|
|
2201
|
+
* and you probably will not need it. But if you will - see available presets
|
|
2202
|
+
* and data structure [here](https://github.com/markdown-it/markdown-it/tree/master/src/presets)
|
|
2203
|
+
*
|
|
2204
|
+
* We strongly recommend to use presets instead of direct config loads. That
|
|
2205
|
+
* will give better compatibility with next versions.
|
|
2206
|
+
*/
|
|
2207
|
+
configure(presets: MarkdownItPresetName | MarkdownItPreset): this;
|
|
2208
|
+
/**
|
|
2209
|
+
* Enable list or rules. It will automatically find appropriate components,
|
|
2210
|
+
* containing rules with given names. If rule not found, and `ignoreInvalid`
|
|
2211
|
+
* not set - throws exception.
|
|
2212
|
+
*
|
|
2213
|
+
* @param list Rule name or list of rule names to enable.
|
|
2214
|
+
* @param ignoreInvalid Set `true` to ignore errors when rule not found.
|
|
2215
|
+
*
|
|
2216
|
+
* @example
|
|
2217
|
+
* ```javascript
|
|
2218
|
+
* import MarkdownIt from 'markdown-it'
|
|
2219
|
+
*
|
|
2220
|
+
* const md = new MarkdownIt()
|
|
2221
|
+
* .enable(['sub', 'sup'])
|
|
2222
|
+
* .disable('smartquotes')
|
|
2223
|
+
* ```
|
|
2224
|
+
*/
|
|
2225
|
+
enable(list: string | string[], ignoreInvalid?: boolean): this;
|
|
2226
|
+
/**
|
|
2227
|
+
* The same as {@link MarkdownIt.enable}, but turn specified rules off.
|
|
2228
|
+
*
|
|
2229
|
+
* @param list Rule name or list of rule names to disable.
|
|
2230
|
+
* @param ignoreInvalid Set `true` to ignore errors when rule not found.
|
|
2231
|
+
*/
|
|
2232
|
+
disable(list: string | string[], ignoreInvalid?: boolean): this;
|
|
2233
|
+
/**
|
|
2234
|
+
* Load specified plugin with given params into current parser instance.
|
|
2235
|
+
* It's just a sugar to call `plugin(md, params)` with curring.
|
|
2236
|
+
*
|
|
2237
|
+
* @example
|
|
2238
|
+
* ```javascript
|
|
2239
|
+
* import MarkdownIt from 'markdown-it'
|
|
2240
|
+
* import iterator from 'markdown-it-for-inline'
|
|
2241
|
+
*
|
|
2242
|
+
* const md = new MarkdownIt()
|
|
2243
|
+
* .use(iterator, 'foo_replace', 'text', function (tokens, idx) {
|
|
2244
|
+
* tokens[idx].content = tokens[idx].content.replace(/foo/g, 'bar')
|
|
2245
|
+
* })
|
|
2246
|
+
* ```
|
|
2247
|
+
*/
|
|
2248
|
+
use<Params extends unknown[]>(plugin: (md: this, ...params: Params) => void, ...params: Params): this;
|
|
2249
|
+
/**
|
|
2250
|
+
* Parse input string and return list of block tokens (special token type
|
|
2251
|
+
* "inline" will contain list of inline tokens). You should not call this
|
|
2252
|
+
* method directly, until you write custom renderer (for example, to produce
|
|
2253
|
+
* AST).
|
|
2254
|
+
*
|
|
2255
|
+
* `env` is used to pass data between "distributed" rules and return additional
|
|
2256
|
+
* metadata like reference info, needed for the renderer. It also can be used to
|
|
2257
|
+
* inject data in specific cases. Usually, you will be ok to pass `{}`,
|
|
2258
|
+
* and then pass updated object to renderer.
|
|
2259
|
+
*
|
|
2260
|
+
* @param src Source string.
|
|
2261
|
+
* @param env Environment sandbox.
|
|
2262
|
+
*/
|
|
2263
|
+
parse(src: string, env: Env): Token[];
|
|
2264
|
+
/**
|
|
2265
|
+
* Render markdown string into html. It does all magic for you :).
|
|
2266
|
+
*
|
|
2267
|
+
* `env` can be used to inject additional metadata (`{}` by default).
|
|
2268
|
+
* But you will not need it with high probability. See also comment
|
|
2269
|
+
* in {@link MarkdownIt.parse}.
|
|
2270
|
+
*
|
|
2271
|
+
* @param src Source string.
|
|
2272
|
+
* @param env Environment sandbox.
|
|
2273
|
+
*/
|
|
2274
|
+
render(src: string, env?: Env): string;
|
|
2275
|
+
/**
|
|
2276
|
+
* The same as {@link MarkdownIt.parse} but skip all block rules. It returns
|
|
2277
|
+
* the block tokens list with the single `inline` element, containing parsed
|
|
2278
|
+
* inline tokens in `children` property. Also updates `env` object.
|
|
2279
|
+
*
|
|
2280
|
+
* @param src Source string.
|
|
2281
|
+
* @param env Environment sandbox.
|
|
2282
|
+
*/
|
|
2283
|
+
parseInline(src: string, env: Env): Token[];
|
|
2284
|
+
/**
|
|
2285
|
+
* Similar to {@link MarkdownIt.render} but for single paragraph content.
|
|
2286
|
+
* Result will NOT be wrapped into `<p>` tags.
|
|
2287
|
+
*
|
|
2288
|
+
* @param src Source string.
|
|
2289
|
+
* @param env Environment sandbox.
|
|
2290
|
+
*/
|
|
2291
|
+
renderInline(src: string, env?: Env): string;
|
|
2292
|
+
static Token: typeof Token;
|
|
2293
|
+
static Ruler: typeof Ruler;
|
|
2294
|
+
static Renderer: typeof Renderer;
|
|
2295
|
+
static ParserCore: typeof ParserCore;
|
|
2296
|
+
static StateCore: typeof StateCore;
|
|
2297
|
+
static ParserBlock: typeof ParserBlock;
|
|
2298
|
+
static StateBlock: typeof StateBlock;
|
|
2299
|
+
static ParserInline: typeof ParserInline;
|
|
2300
|
+
static StateInline: typeof StateInline;
|
|
2301
|
+
}
|
|
2302
|
+
//#endregion
|
|
2303
|
+
//#region src/index.d.ts
|
|
2304
|
+
/**
|
|
2305
|
+
* Default package export.
|
|
2306
|
+
*
|
|
2307
|
+
* For backward compatibility, the {@link MarkdownIt} class is wrapped so
|
|
2308
|
+
* legacy code can call it without `new`. New code should instantiate it as a
|
|
2309
|
+
* regular class with `new`. The compatibility wrapper may be removed in a
|
|
2310
|
+
* future release.
|
|
2311
|
+
*
|
|
2312
|
+
* @category Main
|
|
2313
|
+
*/
|
|
2314
|
+
declare const MarkdownItCallable: typeof MarkdownIt & ((...args: [] | [options: MarkdownItOptions] | [presetName: "default" | "zero" | "commonmark", options?: MarkdownItOptions | undefined]) => MarkdownIt);
|
|
1080
2315
|
//#endregion
|
|
1081
2316
|
//#region lib/components/DcMarkdown/index.vue.d.ts
|
|
1082
2317
|
type __VLS_Props$11 = {
|
|
1083
2318
|
markdown: string;
|
|
1084
|
-
plugins?: Parameters<
|
|
1085
|
-
config?:
|
|
1086
|
-
env?:
|
|
2319
|
+
plugins?: Parameters<InstanceType<typeof MarkdownItCallable>['use']>[];
|
|
2320
|
+
config?: MarkdownItOptions;
|
|
2321
|
+
env?: Env;
|
|
1087
2322
|
isDarkMode?: boolean;
|
|
1088
2323
|
} & StyleProps;
|
|
1089
|
-
declare const __VLS_export$18: import("vue").DefineComponent<__VLS_Props$11, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props$11> & Readonly<{}>, {
|
|
1090
|
-
plugins: Parameters<MarkdownIt["use"]>[];
|
|
1091
|
-
config: Options;
|
|
1092
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
2324
|
+
declare const __VLS_export$18: import("vue").DefineComponent<__VLS_Props$11, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props$11> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
1093
2325
|
declare const _default$21: typeof __VLS_export$18;
|
|
1094
2326
|
//#endregion
|
|
1095
2327
|
//#region lib/components/DcPullRefresh.vue.d.ts
|
|
@@ -1114,17 +2346,14 @@ declare const __VLS_base$1: import("vue").DefineComponent<__VLS_PublicProps$9, {
|
|
|
1114
2346
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps$9> & Readonly<{
|
|
1115
2347
|
"onUpdate:refreshing"?: ((value: boolean) => any) | undefined;
|
|
1116
2348
|
"onUpdate:pulling"?: ((value: boolean) => any) | undefined;
|
|
1117
|
-
}>, {
|
|
1118
|
-
disabled: boolean;
|
|
1119
|
-
pullDistance: number;
|
|
1120
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
2349
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
1121
2350
|
declare const __VLS_export$17: __VLS_WithSlots$1<typeof __VLS_base$1, __VLS_Slots$1>;
|
|
1122
2351
|
declare const _default$22: typeof __VLS_export$17;
|
|
1123
2352
|
type __VLS_WithSlots$1<T, S> = T & {
|
|
1124
2353
|
new (): {
|
|
1125
2354
|
$slots: S;
|
|
1126
2355
|
};
|
|
1127
|
-
};
|
|
2356
|
+
};
|
|
1128
2357
|
//#endregion
|
|
1129
2358
|
//#region ../../node_modules/.pnpm/tailwind-merge@3.6.0/node_modules/tailwind-merge/dist/types.d.ts
|
|
1130
2359
|
/**
|
|
@@ -1159,7 +2388,7 @@ declare const __VLS_export$16: <T extends DataState<any, any, any>>(__VLS_props:
|
|
|
1159
2388
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
1160
2389
|
};
|
|
1161
2390
|
declare const _default$23: typeof __VLS_export$16;
|
|
1162
|
-
type __VLS_PrettifyLocal$6<T> = (T extends any ? { [K in keyof T]: T[K] } : { [K in keyof T as K]: T[K] }) & {};
|
|
2391
|
+
type __VLS_PrettifyLocal$6<T> = (T extends any ? { [K in keyof T]: T[K]; } : { [K in keyof T as K]: T[K]; }) & {};
|
|
1163
2392
|
//#endregion
|
|
1164
2393
|
//#region lib/components/DcTab.vue.d.ts
|
|
1165
2394
|
declare const __VLS_export$15: <T extends {
|
|
@@ -1172,9 +2401,12 @@ declare const __VLS_export$15: <T extends {
|
|
|
1172
2401
|
* 基于路由的name匹配
|
|
1173
2402
|
*/
|
|
1174
2403
|
items: T[];
|
|
1175
|
-
mode?: "replace" | "push";
|
|
1176
|
-
|
|
1177
|
-
|
|
2404
|
+
mode?: "replace" | "push";
|
|
2405
|
+
/** 是否使用路由模式,为 false 时使用 v-model 控制选中项 */
|
|
2406
|
+
router?: boolean;
|
|
2407
|
+
/** 标签宽度自适应内容 */
|
|
2408
|
+
shrink?: boolean;
|
|
2409
|
+
/** 是否启用手势滑动切换 */
|
|
1178
2410
|
swipeable?: boolean;
|
|
1179
2411
|
} & StyleProps & {
|
|
1180
2412
|
modelValue?: string;
|
|
@@ -1195,15 +2427,13 @@ declare const __VLS_export$15: <T extends {
|
|
|
1195
2427
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
1196
2428
|
};
|
|
1197
2429
|
declare const _default$24: typeof __VLS_export$15;
|
|
1198
|
-
type __VLS_PrettifyLocal$5<T> = (T extends any ? { [K in keyof T]: T[K] } : { [K in keyof T as K]: T[K] }) & {};
|
|
2430
|
+
type __VLS_PrettifyLocal$5<T> = (T extends any ? { [K in keyof T]: T[K]; } : { [K in keyof T as K]: T[K]; }) & {};
|
|
1199
2431
|
//#endregion
|
|
1200
2432
|
//#region lib/components/DcText.vue.d.ts
|
|
1201
2433
|
type __VLS_Props$9 = {
|
|
1202
2434
|
text?: string;
|
|
1203
2435
|
} & StyleProps;
|
|
1204
|
-
declare const __VLS_export$14: import("vue").DefineComponent<__VLS_Props$9, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props$9> & Readonly<{}>, {
|
|
1205
|
-
text: string;
|
|
1206
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
2436
|
+
declare const __VLS_export$14: import("vue").DefineComponent<__VLS_Props$9, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props$9> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
1207
2437
|
declare const _default$25: typeof __VLS_export$14;
|
|
1208
2438
|
//#endregion
|
|
1209
2439
|
//#region lib/components/DcToggleIcon.vue.d.ts
|
|
@@ -1223,14 +2453,14 @@ type __VLS_Slots = {} & {
|
|
|
1223
2453
|
default?: (props: typeof __VLS_12) => any;
|
|
1224
2454
|
};
|
|
1225
2455
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps$8, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
1226
|
-
click: (to: boolean) => any;
|
|
1227
2456
|
"update:modelValue": (value: boolean) => any;
|
|
1228
2457
|
change: (mode: boolean) => any;
|
|
2458
|
+
click: (to: boolean) => any;
|
|
1229
2459
|
longClick: () => any;
|
|
1230
2460
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps$8> & Readonly<{
|
|
1231
|
-
onClick?: ((to: boolean) => any) | undefined;
|
|
1232
2461
|
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
1233
2462
|
onChange?: ((mode: boolean) => any) | undefined;
|
|
2463
|
+
onClick?: ((to: boolean) => any) | undefined;
|
|
1234
2464
|
onLongClick?: (() => any) | undefined;
|
|
1235
2465
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
1236
2466
|
declare const __VLS_export$13: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -1239,7 +2469,7 @@ type __VLS_WithSlots<T, S> = T & {
|
|
|
1239
2469
|
new (): {
|
|
1240
2470
|
$slots: S;
|
|
1241
2471
|
};
|
|
1242
|
-
};
|
|
2472
|
+
};
|
|
1243
2473
|
//#endregion
|
|
1244
2474
|
//#region lib/components/DcVar.vue.d.ts
|
|
1245
2475
|
declare const __VLS_export$12: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal$4<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
@@ -1260,7 +2490,7 @@ declare const __VLS_export$12: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS
|
|
|
1260
2490
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
1261
2491
|
};
|
|
1262
2492
|
declare const _default$27: typeof __VLS_export$12;
|
|
1263
|
-
type __VLS_PrettifyLocal$4<T> = (T extends any ? { [K in keyof T]: T[K] } : { [K in keyof T as K]: T[K] }) & {};
|
|
2493
|
+
type __VLS_PrettifyLocal$4<T> = (T extends any ? { [K in keyof T]: T[K]; } : { [K in keyof T as K]: T[K]; }) & {};
|
|
1264
2494
|
//#endregion
|
|
1265
2495
|
//#region lib/components/DcWaterfall.vue.d.ts
|
|
1266
2496
|
declare const __VLS_export$11: <T extends object>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal$3<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
@@ -1294,9 +2524,9 @@ declare const __VLS_export$11: <T extends object>(__VLS_props: NonNullable<Await
|
|
|
1294
2524
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
1295
2525
|
};
|
|
1296
2526
|
declare const _default$28: typeof __VLS_export$11;
|
|
1297
|
-
type __VLS_PrettifyLocal$3<T> = (T extends any ? { [K in keyof T]: T[K] } : { [K in keyof T as K]: T[K] }) & {};
|
|
2527
|
+
type __VLS_PrettifyLocal$3<T> = (T extends any ? { [K in keyof T]: T[K]; } : { [K in keyof T as K]: T[K]; }) & {};
|
|
1298
2528
|
//#endregion
|
|
1299
|
-
//#region ../../node_modules/.pnpm/vue-component-type-helpers@3.3.
|
|
2529
|
+
//#region ../../node_modules/.pnpm/vue-component-type-helpers@3.3.9/node_modules/vue-component-type-helpers/index.d.ts
|
|
1300
2530
|
type ComponentProps<T> = T extends (new (...args: any) => {
|
|
1301
2531
|
$props: infer P;
|
|
1302
2532
|
}) ? NonNullable<P> : T extends ((props: infer P, ...args: any) => any) ? P : {};
|
|
@@ -1337,7 +2567,7 @@ declare const __VLS_export$10: <TKey extends EnvironmentKey, TComponent extends
|
|
|
1337
2567
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
1338
2568
|
};
|
|
1339
2569
|
declare const _default$6: typeof __VLS_export$10;
|
|
1340
|
-
type __VLS_PrettifyLocal$2<T> = (T extends any ? { [K in keyof T]: T[K] } : { [K in keyof T as K]: T[K] }) & {};
|
|
2570
|
+
type __VLS_PrettifyLocal$2<T> = (T extends any ? { [K in keyof T]: T[K]; } : { [K in keyof T as K]: T[K]; }) & {};
|
|
1341
2571
|
//#endregion
|
|
1342
2572
|
//#region lib/components/form/type.d.ts
|
|
1343
2573
|
interface FormRowSlot<T extends FormConfigure, O extends (keyof T)[], K extends O[number]> {
|
|
@@ -1378,7 +2608,7 @@ declare const __VLS_export$9: <T extends FormConfigure, O extends (keyof T)[] =
|
|
|
1378
2608
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
1379
2609
|
};
|
|
1380
2610
|
declare const _default$7: typeof __VLS_export$9;
|
|
1381
|
-
type __VLS_PrettifyLocal$1<T> = (T extends any ? { [K in keyof T]: T[K] } : { [K in keyof T as K]: T[K] }) & {};
|
|
2611
|
+
type __VLS_PrettifyLocal$1<T> = (T extends any ? { [K in keyof T]: T[K]; } : { [K in keyof T as K]: T[K]; }) & {};
|
|
1382
2612
|
//#endregion
|
|
1383
2613
|
//#region lib/components/form/components/DcFormCheckbox.vue.d.ts
|
|
1384
2614
|
type __VLS_Props$7 = {
|
|
@@ -1445,7 +2675,7 @@ declare const __VLS_export$5: <T extends FormSingleConfigure>(__VLS_props: NonNu
|
|
|
1445
2675
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
1446
2676
|
};
|
|
1447
2677
|
declare const _default$11: typeof __VLS_export$5;
|
|
1448
|
-
type __VLS_PrettifyLocal<T> = (T extends any ? { [K in keyof T]: T[K] } : { [K in keyof T as K]: T[K] }) & {};
|
|
2678
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? { [K in keyof T]: T[K]; } : { [K in keyof T as K]: T[K]; }) & {};
|
|
1449
2679
|
//#endregion
|
|
1450
2680
|
//#region lib/components/form/components/DcFormNumber.vue.d.ts
|
|
1451
2681
|
type __VLS_Props$4 = {
|
|
@@ -1543,8 +2773,7 @@ declare const translateUi: (key: UiMessageKey, params?: UiMessageParams) => stri
|
|
|
1543
2773
|
//#endregion
|
|
1544
2774
|
//#region lib/message/download.d.ts
|
|
1545
2775
|
interface DownloadMessageProgress extends DownloadMessageLoading {
|
|
1546
|
-
/** 0~100 */
|
|
1547
|
-
progress: number;
|
|
2776
|
+
/** 0~100 */ progress: number;
|
|
1548
2777
|
}
|
|
1549
2778
|
interface DownloadMessageLoading {
|
|
1550
2779
|
description: string;
|