shelving 1.86.1 → 1.86.2

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.
@@ -1,3 +1,4 @@
1
+ import { getPrototype } from "../util/object.js";
1
2
  import { withArrayItems, omitArrayItems } from "../util/array.js";
2
3
  import { Constraint } from "./Constraint.js";
3
4
  /** Type of Rule that is powered by several sub-constraints (e.g. `Filters` and `Sorts` and `Query` itself extend this). */
@@ -21,12 +22,12 @@ export class Constraints extends Constraint {
21
22
  /** Clone this set of constraints but add additional constraints. */
22
23
  with(...constraints) {
23
24
  const _constraints = withArrayItems(this._constraints, ...constraints);
24
- return _constraints !== this._constraints ? { __proto__: Object.getPrototypeOf(this), ...this, _constraints: _constraints } : this;
25
+ return _constraints !== this._constraints ? { __proto__: getPrototype(this), ...this, _constraints: _constraints } : this;
25
26
  }
26
27
  /** Clone this set of constraints but remove specific constraints. */
27
28
  omit(...constraints) {
28
29
  const _constraints = omitArrayItems(this._constraints, ...constraints);
29
- return _constraints !== this._constraints ? { __proto__: Object.getPrototypeOf(this), ...this, _constraints: _constraints } : this;
30
+ return _constraints !== this._constraints ? { __proto__: getPrototype(this), ...this, _constraints: _constraints } : this;
30
31
  }
31
32
  /** Iterate over the constraints. */
32
33
  [Symbol.iterator]() {
@@ -31,7 +31,7 @@ export declare class QueryConstraints<T extends Data = Data> extends Constraint<
31
31
  readonly filters: FilterConstraints<T>;
32
32
  readonly sorts: SortConstraints<T>;
33
33
  readonly limit: number | null;
34
- constructor(filters?: FilterList<Partial<T>>, sorts?: SortList<Partial<T>>, limit?: number | null);
34
+ constructor(filters?: FilterList<Partial<T>> | FilterConstraints<T>, sorts?: SortList<Partial<T>> | SortConstraints<T>, limit?: number | null);
35
35
  filter(...filters: FilterList<Partial<T>>[]): this;
36
36
  get unfilter(): this;
37
37
  match(item: T): boolean;
@@ -1,4 +1,4 @@
1
- import { getProp } from "../util/object.js";
1
+ import { getProp, getPrototype } from "../util/object.js";
2
2
  import { assert } from "../util/assert.js";
3
3
  import { limitArray } from "../util/array.js";
4
4
  import { FilterConstraints } from "./FilterConstraints.js";
@@ -19,7 +19,7 @@ export class QueryConstraints extends Constraint {
19
19
  // Implement `Filterable`
20
20
  filter(...filters) {
21
21
  return {
22
- __proto__: Object.getPrototypeOf(this),
22
+ __proto__: getPrototype(this),
23
23
  ...this,
24
24
  filters: this.filters.filter(...filters),
25
25
  };
@@ -28,7 +28,7 @@ export class QueryConstraints extends Constraint {
28
28
  if (!this.filters.size)
29
29
  return this;
30
30
  return {
31
- __proto__: Object.getPrototypeOf(this),
31
+ __proto__: getPrototype(this),
32
32
  ...this,
33
33
  filters: EMPTY_FILTERS,
34
34
  };
@@ -39,7 +39,7 @@ export class QueryConstraints extends Constraint {
39
39
  // Implement `Sortable`
40
40
  sort(...sorts) {
41
41
  return {
42
- __proto__: Object.getPrototypeOf(this),
42
+ __proto__: getPrototype(this),
43
43
  ...this,
44
44
  sorts: this.sorts.sort(...sorts),
45
45
  };
@@ -48,7 +48,7 @@ export class QueryConstraints extends Constraint {
48
48
  if (!this.sorts.size)
49
49
  return this;
50
50
  return {
51
- __proto__: Object.getPrototypeOf(this),
51
+ __proto__: getPrototype(this),
52
52
  ...this,
53
53
  sorts: EMPTY_SORTS,
54
54
  };
@@ -59,14 +59,14 @@ export class QueryConstraints extends Constraint {
59
59
  // Implement `Queryable`
60
60
  after(item) {
61
61
  return {
62
- __proto__: Object.getPrototypeOf(this),
62
+ __proto__: getPrototype(this),
63
63
  ...this,
64
64
  filters: this.filters.with(..._getAfterFilters(this.sorts, item)),
65
65
  };
66
66
  }
67
67
  before(item) {
68
68
  return {
69
- __proto__: Object.getPrototypeOf(this),
69
+ __proto__: getPrototype(this),
70
70
  ...this,
71
71
  filters: this.filters.with(..._getBeforeFilters(this.sorts, item)),
72
72
  };
@@ -75,7 +75,7 @@ export class QueryConstraints extends Constraint {
75
75
  if (this.limit === limit)
76
76
  return this;
77
77
  return {
78
- __proto__: Object.getPrototypeOf(this),
78
+ __proto__: getPrototype(this),
79
79
  ...this,
80
80
  limit,
81
81
  };
@@ -7,7 +7,7 @@ export class ThroughError extends Error {
7
7
  constructor(message, cause) {
8
8
  super(message);
9
9
  this.cause = cause;
10
- this.stack = `${this.stack}\nCause: ${cause instanceof Error ? cause.stack : debug(cause)}`;
10
+ this.stack = `${this.stack || ""}\nCause: ${cause instanceof Error ? cause.stack || "" : debug(cause)}`;
11
11
  }
12
12
  }
13
13
  ThroughError.prototype.name = "ThroughError";
package/markup/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from "./options.js";
2
+ export * from "./rule.js";
2
3
  export * from "./rules.js";
3
4
  export * from "./render.js";
4
5
  export * from "./regexp.js";
package/markup/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from "./options.js";
2
+ export * from "./rule.js";
2
3
  export * from "./rules.js";
3
4
  export * from "./render.js";
4
5
  export * from "./regexp.js";
@@ -1,4 +1,4 @@
1
- import { MarkupRules } from "./rules.js";
1
+ import type { MarkupRules } from "./rule.js";
2
2
  /** The current parsing options (represents the current state of the parsing). */
3
3
  export type MarkupOptions = {
4
4
  /** The active list of parsing rules. */
@@ -2,13 +2,13 @@ import type { Data } from "../util/data.js";
2
2
  import { NamedRegExp, NamedRegExpData, PossibleRegExp } from "../util/regexp.js";
3
3
  import type { MarkupOptions } from "./options.js";
4
4
  /** Subset of `NamedRegExpArray<T>` that are the only things we're required return from a `MarkupMatcher` function. */
5
- export type MarkupMatch<T extends Data | undefined = Data | undefined> = {
5
+ export type MarkupMatch<T extends Data | undefined> = {
6
6
  0: string;
7
7
  index: number;
8
8
  groups: T;
9
9
  };
10
10
  /** Function that matches a string and returns a `MarkupMatch` or `null` or `void` */
11
- export type MarkupMatcher<T extends Data | undefined = Data | undefined> = (input: string, options: MarkupOptions) => MarkupMatch<T> | null | void;
11
+ export type MarkupMatcher<T extends Data> = (input: string, options: MarkupOptions) => MarkupMatch<T> | null | void;
12
12
  export declare const LINE_REGEXP: RegExp;
13
13
  export declare const LINE_START_REGEXP: RegExp;
14
14
  export declare const LINE_END_REGEXP: RegExp;
package/markup/render.js CHANGED
@@ -77,49 +77,48 @@ function _renderElement(element, options, context) {
77
77
  */
78
78
  function* _parseString(input, options, context, offset = 0) {
79
79
  let matchedRule = undefined;
80
- let matchedPriority = Number.MIN_SAFE_INTEGER;
81
- let matchedIndex = Number.MIN_SAFE_INTEGER;
82
- let matchedLength = 0;
83
- let matchedGroups = undefined;
80
+ let matchedResult = undefined;
81
+ let highPriority = Number.MIN_SAFE_INTEGER;
82
+ let lowIndex = Number.MIN_SAFE_INTEGER;
84
83
  // Loop through all rules in the list and see if any match.
85
84
  for (const rule of options.rules) {
86
85
  // Only apply this rule if both:
87
86
  // 1. The priority is equal or higher to the current priority.
88
87
  // 2. The rule is allowed in the current context.
89
- const { priority = 0, match, contexts } = rule;
90
- if (priority >= matchedPriority && contexts.includes(context)) {
91
- const result = typeof match === "function" ? match(input, options) : match.exec(input);
88
+ const { priority } = rule;
89
+ if (rule.priority >= highPriority && rule.contexts.includes(context)) {
90
+ const result = rule.match(input, options);
92
91
  if (result) {
93
92
  // Use the match if it has length and is earlier in the string or is higher priority.
94
- const { 0: { length } = "", index, groups } = result;
95
- if (length && (index < matchedIndex || priority > matchedPriority)) {
93
+ const { 0: { length } = "", index } = result;
94
+ if (length && (index < lowIndex || rule.priority > highPriority)) {
96
95
  matchedRule = rule;
97
- matchedPriority = priority;
98
- matchedIndex = index;
99
- matchedLength = length;
100
- matchedGroups = groups;
96
+ matchedResult = result;
97
+ highPriority = priority;
98
+ lowIndex = index;
101
99
  }
102
100
  }
103
101
  }
104
102
  }
105
103
  // Did at least one rule match?
106
- if (matchedRule && matchedLength) {
104
+ if (matchedRule && matchedResult) {
107
105
  // If index is more than zero, then the string before the match may match another rule at lower priority.
108
- const prefix = input.slice(0, matchedIndex);
106
+ const prefix = input.slice(0, lowIndex);
109
107
  if (prefix.length)
110
108
  yield* _parseString(prefix, options, context, offset);
111
109
  // Call the rule's `render()` function to generate the node.
112
110
  // React gets annoyed if we don't set a `key:` property on lists of elements.
113
111
  // We use the string offset as the `.key` property in the element because it's cheap to calculate and guaranteed to be unique within the string.
114
112
  // Trying to generate an incrementing number would require tracking the number and passing it back and forth through `_parseString()`
115
- const { render, subcontext } = matchedRule;
116
- const element = render(matchedGroups, options);
117
- element.key = offset + matchedIndex;
113
+ const { 0: { length } = "", groups, index } = matchedResult;
114
+ const element = matchedRule.render(groups, options);
115
+ element.key = offset + index;
116
+ const { subcontext } = matchedRule;
118
117
  yield subcontext ? _renderElement(element, options, subcontext) : element;
119
118
  // Decrement the content.
120
- const suffix = input.slice(matchedIndex + matchedLength);
119
+ const suffix = input.slice(index + length);
121
120
  if (suffix.length)
122
- yield* _parseString(suffix, options, context, offset + matchedIndex + matchedLength);
121
+ yield* _parseString(suffix, options, context, offset + index + length);
123
122
  }
124
123
  else {
125
124
  // If nothing matched return the entire string..
@@ -0,0 +1,80 @@
1
+ import { NamedRegExp, NamedRegExpArray, NamedRegExpData } from "../util/regexp.js";
2
+ import { Data } from "../util/data.js";
3
+ import { JSXElement } from "../util/jsx.js";
4
+ import { ImmutableArray } from "../util/array.js";
5
+ import { MarkupOptions } from "./options.js";
6
+ export type MarkupRuleMatch<T extends Data = Data> = {
7
+ 0: string;
8
+ index: number;
9
+ groups?: T;
10
+ };
11
+ export declare abstract class MarkupRule {
12
+ /**
13
+ * Contexts this rule should be applied in,
14
+ *
15
+ * @example `["block", "inline", "list"]`
16
+ */
17
+ readonly contexts: ImmutableArray<string>;
18
+ /**
19
+ * Context that children should be rendered with.
20
+ *
21
+ * @example `"inline"` // Children of the element rendered by this rule will be parsed against markup rules applied in the "inline" context.
22
+ */
23
+ readonly subcontext: string | null;
24
+ /**
25
+ * Priority for this rule (defaults to zero).
26
+ *
27
+ * @example e.g. `<p>` rule is lower priority than other blocks so it matches last and paragraphs can be interrupted by e.g. `<ul>` and `<blockquote>`.
28
+ * @example e.g. `<code>` rule is higher priority than other inlines so e.g. `<strong>` or `<em>` don't match inside a code block.
29
+ */
30
+ readonly priority: number;
31
+ constructor(contexts: ImmutableArray<string>, //
32
+ subcontext?: string | null, priority?: number);
33
+ /** Match an input string against this */
34
+ abstract match(input: string, options: MarkupOptions): MarkupRuleMatch | null;
35
+ /** Render the JSX element for this rule using the props matched by `.match` */
36
+ abstract render(props: Data | undefined, options: MarkupOptions): JSXElement;
37
+ }
38
+ export declare class RegExpMarkupRule extends MarkupRule {
39
+ private readonly _regexp;
40
+ private readonly _render;
41
+ constructor(_regexp: RegExp, //
42
+ _render: (props: Data, options: MarkupOptions) => JSXElement, contexts: ImmutableArray<string>, subcontext?: string | null, priority?: number);
43
+ match(input: string): MarkupRuleMatch | null;
44
+ render(props: Data, options: MarkupOptions): JSXElement;
45
+ }
46
+ export declare class NamedRegExpMarkupRule<T extends NamedRegExpData> extends MarkupRule {
47
+ private readonly _regexp;
48
+ private readonly _render;
49
+ constructor(_regexp: NamedRegExp<T>, //
50
+ _render: (props: T, options: MarkupOptions) => JSXElement, contexts: ImmutableArray<string>, subcontext?: string | null, priority?: number);
51
+ match(input: string): NamedRegExpArray<T> | null;
52
+ render(props: T, options: MarkupOptions): JSXElement;
53
+ }
54
+ export declare class LinkRegExpMarkupRule extends MarkupRule {
55
+ readonly _regexp: NamedRegExp<{
56
+ title?: string;
57
+ href: string;
58
+ }>;
59
+ readonly _render: (props: {
60
+ title: string;
61
+ href: string;
62
+ }, options: MarkupOptions) => JSXElement;
63
+ constructor(_regexp: NamedRegExp<{
64
+ title?: string;
65
+ href: string;
66
+ }>, //
67
+ _render: (props: {
68
+ title: string;
69
+ href: string;
70
+ }, options: MarkupOptions) => JSXElement, contexts: ImmutableArray<string>, subcontext?: string | null, priority?: number);
71
+ match(input: string, { schemes, url: base }: MarkupOptions): MarkupRuleMatch<{
72
+ title: string;
73
+ href: string;
74
+ }> | null;
75
+ render(props: {
76
+ title: string;
77
+ href: string;
78
+ }, options: MarkupOptions): JSXElement<import("../util/jsx.js").JSXProps>;
79
+ }
80
+ export type MarkupRules = MarkupRule[];
package/markup/rule.js ADDED
@@ -0,0 +1,63 @@
1
+ import { formatURL, getOptionalURL } from "../util/url.js";
2
+ export class MarkupRule {
3
+ constructor(contexts, //
4
+ subcontext = null, priority = 0) {
5
+ this.contexts = contexts;
6
+ this.subcontext = subcontext;
7
+ this.priority = priority;
8
+ }
9
+ }
10
+ export class RegExpMarkupRule extends MarkupRule {
11
+ constructor(_regexp, //
12
+ _render, contexts, subcontext, priority) {
13
+ super(contexts, subcontext, priority);
14
+ this._regexp = _regexp;
15
+ this._render = _render;
16
+ }
17
+ match(input) {
18
+ return this._regexp.exec(input);
19
+ }
20
+ render(props, options) {
21
+ return this._render(props, options);
22
+ }
23
+ }
24
+ export class NamedRegExpMarkupRule extends MarkupRule {
25
+ constructor(_regexp, //
26
+ _render, contexts, subcontext, priority) {
27
+ super(contexts, subcontext, priority);
28
+ this._regexp = _regexp;
29
+ this._render = _render;
30
+ }
31
+ match(input) {
32
+ return this._regexp.exec(input);
33
+ }
34
+ render(props, options) {
35
+ return this._render(props, options);
36
+ }
37
+ }
38
+ export class LinkRegExpMarkupRule extends MarkupRule {
39
+ constructor(_regexp, //
40
+ _render, contexts, subcontext, priority) {
41
+ super(contexts, subcontext, priority);
42
+ this._regexp = _regexp;
43
+ this._render = _render;
44
+ }
45
+ // Validates that the link is a valid URL (using `getOptionalURL()` to resolve relative links relative to `options.url`).
46
+ // Validates that the link's URL scheme is in the `options.schemes` whitelist (defaults to `http` and `https`).
47
+ // Generates a default title for the link using `formatURL()` (e.g. `shax.com/my/dir`).
48
+ match(input, { schemes, url: base }) {
49
+ const match = this._regexp.exec(input);
50
+ if (match) {
51
+ const { 0: first, index, groups } = match;
52
+ const { href, title } = groups;
53
+ const url = getOptionalURL(href, base);
54
+ if (url && schemes.includes(url.protocol)) {
55
+ return { 0: first, index, groups: { href: url.href, title: (title === null || title === void 0 ? void 0 : title.trim()) || formatURL(url) } };
56
+ }
57
+ }
58
+ return null;
59
+ }
60
+ render(props, options) {
61
+ return this._render(props, options);
62
+ }
63
+ }
package/markup/rules.d.ts CHANGED
@@ -1,49 +1,14 @@
1
- import type { Data } from "../util/data.js";
2
1
  import type { JSXElement } from "../util/jsx.js";
3
- import { NamedRegExp, NamedRegExpData } from "../util/regexp.js";
4
- import { MarkupMatcher } from "./regexp.js";
2
+ import { NamedRegExp } from "../util/regexp.js";
5
3
  import type { MarkupOptions } from "./options.js";
6
- /** Rule for parsing string markup into a JSX element. */
7
- export interface MarkupRule<T extends Data | undefined = Data | undefined> {
8
- /**
9
- * Regular expression or custom matching function.
10
- */
11
- readonly match: (T extends undefined ? RegExp : T extends NamedRegExpData ? NamedRegExp<T> : never) | MarkupMatcher<T>;
12
- /**
13
- * Render the JSX element for this rule using the props matched by
14
- */
15
- readonly render: (orops: T, options: MarkupOptions) => JSXElement;
16
- /**
17
- * Contexts this rule should be applied in,
18
- *
19
- * @example `["block", "inline", "list"]`
20
- */
21
- readonly contexts: string[];
22
- /**
23
- * Context that children should be rendered with.
24
- *
25
- * @example `"inline"` // Children of the element rendered by this rule will be parsed against markup rules applied in the "inline" context.
26
- */
27
- readonly subcontext?: string;
28
- /**
29
- * Priority for this rule (defaults to zero).
30
- *
31
- * @example e.g. `<p>` rule is lower priority than other blocks so it matches last and paragraphs can be interrupted by e.g. `<ul>` and `<blockquote>`.
32
- * @example e.g. `<code>` rule is higher priority than other inlines so e.g. `<strong>` or `<em>` don't match inside a code block.
33
- */
34
- readonly priority?: number;
35
- }
36
- /** Any markup rule. */
37
- export type AnyMarkupRule = MarkupRule<any>;
38
- /** A set of markup rules (as an object or array). */
39
- export type MarkupRules = AnyMarkupRule[];
4
+ import { LinkRegExpMarkupRule, MarkupRules, NamedRegExpMarkupRule, RegExpMarkupRule } from "./rule.js";
40
5
  /**
41
6
  * Headings are single line only (don't allow multiline).
42
7
  * - 1-6 hashes then 1+ spaces, then the title.
43
8
  * - Same as Markdown syntax.
44
9
  * - Markdown's underline syntax is not supported (for simplification).
45
10
  */
46
- export declare const HEADING_RULE: MarkupRule<{
11
+ export declare const HEADING_RULE: NamedRegExpMarkupRule<{
47
12
  prefix: string;
48
13
  heading: string;
49
14
  }>;
@@ -54,14 +19,14 @@ export declare const HEADING_RULE: MarkupRule<{
54
19
  * - Character must be the same every time (can't mix)
55
20
  * - Might have infinite number of spaces between the characters.
56
21
  */
57
- export declare const SEPARATOR_RULE: MarkupRule;
58
- export declare const UNORDERED_RULE: MarkupRule<{
22
+ export declare const SEPARATOR_RULE: RegExpMarkupRule;
23
+ export declare const UNORDERED_RULE: NamedRegExpMarkupRule<{
59
24
  list: string;
60
25
  }>;
61
- export declare const ORDERED_RULE: MarkupRule<{
26
+ export declare const ORDERED_RULE: NamedRegExpMarkupRule<{
62
27
  list: string;
63
28
  }>;
64
- export declare const BLOCKQUOTE_RULE: MarkupRule<{
29
+ export declare const BLOCKQUOTE_RULE: NamedRegExpMarkupRule<{
65
30
  quote: string;
66
31
  }>;
67
32
  /**
@@ -71,7 +36,7 @@ export declare const BLOCKQUOTE_RULE: MarkupRule<{
71
36
  * - If there's no closing fence the code block will run to the end of the current string.
72
37
  * - Markdown-style four-space indent syntax is not supported (only fenced code, since it's easier to use).
73
38
  */
74
- export declare const FENCED_CODE_RULE: MarkupRule<{
39
+ export declare const FENCED_CODE_RULE: NamedRegExpMarkupRule<{
75
40
  wrap: string;
76
41
  title?: string;
77
42
  code: string;
@@ -80,23 +45,14 @@ export declare const FENCED_CODE_RULE: MarkupRule<{
80
45
  * Paragraph.
81
46
  * - When ordering rules, paragraph should go after other "block" context elements (because it has a very generous capture).
82
47
  */
83
- export declare const PARAGRAPH_RULE: MarkupRule<{
48
+ export declare const PARAGRAPH_RULE: NamedRegExpMarkupRule<{
84
49
  paragraph: string;
85
50
  }>;
86
- /**
87
- * Function that checks a link against the schemas allowed by rendering.
88
- * - Used by `URL_RULE~ and `LINK_RULE`
89
- * - Validates that the link is a valid URL (using `getOptionalURL()` to resolve relative links relative to `options.url`).
90
- * - Validates that the link's URL scheme is in the `options.schemes` whitelist (defaults to `http` and `https`).
91
- * - Generates a default title for the link using `formatURL()` (e.g. `shax.com/my/dir`).
92
- */
93
- export declare function getLinkMatcher(regexp: NamedRegExp<{
94
- title?: string;
95
- href: string;
96
- }>): MarkupMatcher<{
51
+ /** Render function for URL and LINK rules. */
52
+ export declare function renderLinkRule({ href, title }: {
97
53
  title: string;
98
54
  href: string;
99
- }>;
55
+ }, { rel }: MarkupOptions): JSXElement;
100
56
  /**
101
57
  * Autolinked URL starts with `http:` or `https:` or `mailto:` (any scheme in `options.schemes`) and matches an unlimited number of non-space characters.
102
58
  * - If followed by space and then text in `()` round or `[]` square brackets that will be used as the title, e.g. `http://google.com/maps (Google Maps)` or `http://google.com/maps [Google Maps]` (this syntax is from Todoist and maybe other things too).
@@ -108,10 +64,7 @@ export declare const URL_REGEXP: NamedRegExp<{
108
64
  title?: string;
109
65
  href: string;
110
66
  }>;
111
- export declare const URL_RULE: MarkupRule<{
112
- title: string;
113
- href: string;
114
- }>;
67
+ export declare const URL_RULE: LinkRegExpMarkupRule;
115
68
  /**
116
69
  * Markdown-style link.
117
70
  * - Link in standard Markdown format, e.g. `[Google Maps](http://google.com/maps)`
@@ -124,10 +77,7 @@ export declare const LINK_REGEXP: NamedRegExp<{
124
77
  title: string;
125
78
  href: string;
126
79
  }>;
127
- export declare const LINK_RULE: MarkupRule<{
128
- title: string;
129
- href: string;
130
- }>;
80
+ export declare const LINK_RULE: LinkRegExpMarkupRule;
131
81
  /**
132
82
  * Inline code.
133
83
  * - Text surrounded by one or more "`" backtick tilde characters.
@@ -135,7 +85,7 @@ export declare const LINK_RULE: MarkupRule<{
135
85
  * - Closing characters must exactly match opening characters.
136
86
  * - Same as Markdown syntax.
137
87
  */
138
- export declare const CODE_RULE: MarkupRule<{
88
+ export declare const CODE_RULE: NamedRegExpMarkupRule<{
139
89
  code: string;
140
90
  }>;
141
91
  /**
@@ -160,7 +110,7 @@ declare const INLINE_CHARS: {
160
110
  "=": string;
161
111
  ":": string;
162
112
  };
163
- export declare const INLINE_RULE: MarkupRule<{
113
+ export declare const INLINE_RULE: NamedRegExpMarkupRule<{
164
114
  char: keyof typeof INLINE_CHARS;
165
115
  wrap: string;
166
116
  text: string;
@@ -173,7 +123,7 @@ export declare const INLINE_RULE: MarkupRule<{
173
123
  * - This is more intuitive (a linebreak becomes a linebreak is isn't silently ignored).
174
124
  * - This works better with textareas that wrap text (since manually breaking up long lines is no longer necessary).
175
125
  */
176
- export declare const LINEBREAK_RULE: MarkupRule;
126
+ export declare const LINEBREAK_RULE: RegExpMarkupRule;
177
127
  /**
178
128
  * All markup rules.
179
129
  * - Syntax parsed by `renderMarkup()` is defined entirely by the list of rules (i.e. not by code).