@markuplint/ml-core 3.3.0 → 3.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/lib/index.d.ts +11 -1
  2. package/lib/ml-core.d.ts +22 -11
  3. package/lib/ml-dom/helper/create-node.d.ts +4 -1
  4. package/lib/ml-dom/helper/getIndent.d.ts +7 -7
  5. package/lib/ml-dom/helper/walkers.d.ts +11 -3
  6. package/lib/ml-dom/helper/walkers.js +1 -0
  7. package/lib/ml-dom/manipulations/child-node-methods.d.ts +18 -5
  8. package/lib/ml-dom/manipulations/get-children.d.ts +3 -1
  9. package/lib/ml-dom/node/attr.d.ts +89 -89
  10. package/lib/ml-dom/node/block.d.ts +30 -30
  11. package/lib/ml-dom/node/character-data.d.ts +59 -52
  12. package/lib/ml-dom/node/child-node.d.ts +6 -1
  13. package/lib/ml-dom/node/comment.d.ts +15 -12
  14. package/lib/ml-dom/node/document-fragment.d.ts +22 -19
  15. package/lib/ml-dom/node/document-type.d.ts +34 -31
  16. package/lib/ml-dom/node/document.d.ts +1596 -1582
  17. package/lib/ml-dom/node/dom-token-list.d.ts +26 -26
  18. package/lib/ml-dom/node/element.d.ts +1894 -1888
  19. package/lib/ml-dom/node/named-node-map.d.ts +44 -39
  20. package/lib/ml-dom/node/node-list.d.ts +9 -3
  21. package/lib/ml-dom/node/node-store.d.ts +3 -3
  22. package/lib/ml-dom/node/node.d.ts +491 -471
  23. package/lib/ml-dom/node/parent-node.d.ts +66 -57
  24. package/lib/ml-dom/node/rule-mapper.d.ts +7 -7
  25. package/lib/ml-dom/node/text.d.ts +49 -46
  26. package/lib/ml-dom/node/types.d.ts +66 -10
  27. package/lib/ml-dom/node/unexpected-call-error.d.ts +1 -2
  28. package/lib/ml-dom/token/token.d.ts +44 -44
  29. package/lib/ml-rule/create-test-rule.d.ts +5 -3
  30. package/lib/ml-rule/ml-rule-context.d.ts +55 -47
  31. package/lib/ml-rule/ml-rule.d.ts +24 -22
  32. package/lib/ml-rule/types.d.ts +18 -12
  33. package/lib/plugin/types.d.ts +5 -5
  34. package/lib/ruleset/index.d.ts +4 -4
  35. package/lib/test/index.d.ts +19 -7
  36. package/lib/types.d.ts +7 -7
  37. package/lib/utils/get-location-from-chars.d.ts +9 -4
  38. package/package.json +4 -2
@@ -3,18 +3,24 @@ import type { MLRuleContext } from './ml-rule-context';
3
3
  import type { Translator } from '@markuplint/i18n';
4
4
  import type { Report, RuleConfigValue, Severity } from '@markuplint/ml-config';
5
5
  export type RuleSeed<T extends RuleConfigValue = boolean, O = null> = {
6
- defaultSeverity?: Severity;
7
- defaultValue?: T;
8
- defaultOptions?: O;
9
- verify(context: ReturnType<MLRuleContext<T, O>['provide']>): void | Promise<void>;
10
- fix?(context: ReturnType<MLRuleContext<T, O>['provide']>): void | Promise<void>;
6
+ defaultSeverity?: Severity;
7
+ defaultValue?: T;
8
+ defaultOptions?: O;
9
+ verify(context: ReturnType<MLRuleContext<T, O>['provide']>): void | Promise<void>;
10
+ fix?(context: ReturnType<MLRuleContext<T, O>['provide']>): void | Promise<void>;
11
11
  };
12
- export type Checker<T extends RuleConfigValue, O = null, P extends Record<string, unknown> = {}> = (params: P) => CheckerReport<T, O>;
13
- export type ElementChecker<T extends RuleConfigValue, O = null, P extends Record<string, unknown> = {}> = (params: P & {
14
- el: Element<T, O>;
15
- }) => CheckerReport<T, O>;
16
- export type AttrChecker<T extends RuleConfigValue, O = null, P extends Record<string, unknown> = {}> = (params: P & {
17
- attr: Attr<T, O>;
18
- }) => CheckerReport<T, O>;
12
+ export type Checker<T extends RuleConfigValue, O = null, P extends Record<string, unknown> = {}> = (
13
+ params: P,
14
+ ) => CheckerReport<T, O>;
15
+ export type ElementChecker<T extends RuleConfigValue, O = null, P extends Record<string, unknown> = {}> = (
16
+ params: P & {
17
+ el: Element<T, O>;
18
+ },
19
+ ) => CheckerReport<T, O>;
20
+ export type AttrChecker<T extends RuleConfigValue, O = null, P extends Record<string, unknown> = {}> = (
21
+ params: P & {
22
+ attr: Attr<T, O>;
23
+ },
24
+ ) => CheckerReport<T, O>;
19
25
  export type CheckerReport<T extends RuleConfigValue, O = null> = (t: Translator) => Report<T, O> | undefined | null;
20
26
  export type AnyRuleSeed = RuleSeed<any, any>;
@@ -1,12 +1,12 @@
1
1
  import type { AnyRuleSeed } from '../ml-rule';
2
2
  import type { Config } from '@markuplint/ml-config';
3
3
  export type Plugin = {
4
- name: string;
5
- rules?: Record<string, AnyRuleSeed>;
6
- configs?: Record<string, Config>;
4
+ name: string;
5
+ rules?: Record<string, AnyRuleSeed>;
6
+ configs?: Record<string, Config>;
7
7
  };
8
8
  export type PluginCreator<S extends CreatePluginSettings> = {
9
- name: string;
10
- create(setting: S): Omit<Plugin, 'name'>;
9
+ name: string;
10
+ create(setting: S): Omit<Plugin, 'name'>;
11
11
  };
12
12
  export type CreatePluginSettings = Record<string, unknown>;
@@ -1,7 +1,7 @@
1
1
  import type { ChildNodeRule, Config, NodeRule, Rules } from '@markuplint/ml-config';
2
2
  export default class Ruleset {
3
- readonly childNodeRules: ReadonlyArray<ChildNodeRule>;
4
- readonly nodeRules: ReadonlyArray<NodeRule>;
5
- readonly rules: Readonly<Rules>;
6
- constructor(config: Config);
3
+ readonly childNodeRules: ReadonlyArray<ChildNodeRule>;
4
+ readonly nodeRules: ReadonlyArray<NodeRule>;
5
+ readonly rules: Readonly<Rules>;
6
+ constructor(config: Config);
7
7
  }
@@ -3,14 +3,26 @@ import type { Config, RuleConfigValue } from '@markuplint/ml-config';
3
3
  import type { ExtendedSpec, MLMLSpec } from '@markuplint/ml-spec';
4
4
  import { Document } from '../ml-dom';
5
5
  export type CreateTestOptions = {
6
- config?: Config;
7
- parser?: MLMarkupLanguageParser;
8
- specs?: MLMLSpec;
6
+ config?: Config;
7
+ parser?: MLMarkupLanguageParser;
8
+ specs?: MLMLSpec;
9
9
  };
10
- export declare function createTestDocument<T extends RuleConfigValue = any, O = any>(sourceCode: string, options?: CreateTestOptions): Document<T, O>;
11
- export declare function createTestNodeList(sourceCode: string, options?: CreateTestOptions): readonly import("../ml-dom/node/node").MLNode<any, any, import("@markuplint/ml-ast").MLASTAbstractNode>[];
12
- export declare function createTestTokenList(sourceCode: string, options?: CreateTestOptions): readonly import("../ml-dom/token/token").MLToken<import("@markuplint/ml-ast").MLToken>[];
13
- export declare function createTestElement(sourceCode: string, options?: CreateTestOptions): import("../ml-dom").Element<any, any>;
10
+ export declare function createTestDocument<T extends RuleConfigValue = any, O = any>(
11
+ sourceCode: string,
12
+ options?: CreateTestOptions,
13
+ ): Document<T, O>;
14
+ export declare function createTestNodeList(
15
+ sourceCode: string,
16
+ options?: CreateTestOptions,
17
+ ): readonly import('../ml-dom/node/node').MLNode<any, any, import('@markuplint/ml-ast').MLASTAbstractNode>[];
18
+ export declare function createTestTokenList(
19
+ sourceCode: string,
20
+ options?: CreateTestOptions,
21
+ ): readonly import('../ml-dom/token/token').MLToken<import('@markuplint/ml-ast').MLToken>[];
22
+ export declare function createTestElement(
23
+ sourceCode: string,
24
+ options?: CreateTestOptions,
25
+ ): import('../ml-dom').Element<any, any>;
14
26
  /**
15
27
  * for test suite
16
28
  */
package/lib/types.d.ts CHANGED
@@ -6,11 +6,11 @@ import type { Pretender } from '@markuplint/ml-config';
6
6
  import type { ExtendedSpec, MLMLSpec } from '@markuplint/ml-spec';
7
7
  export type MLSchema = Readonly<[MLMLSpec, ...ExtendedSpec[]]>;
8
8
  export type MLFabric = {
9
- parser: MLMarkupLanguageParser;
10
- ruleset: Partial<Ruleset>;
11
- rules: AnyMLRule[];
12
- locale: LocaleSet;
13
- schemas: MLSchema;
14
- parserOptions: ParserOptions;
15
- pretenders: Pretender[];
9
+ parser: MLMarkupLanguageParser;
10
+ ruleset: Partial<Ruleset>;
11
+ rules: AnyMLRule[];
12
+ locale: LocaleSet;
13
+ schemas: MLSchema;
14
+ parserOptions: ParserOptions;
15
+ pretenders: Pretender[];
16
16
  };
@@ -1,7 +1,12 @@
1
1
  interface Location {
2
- line: number;
3
- col: number;
4
- raw: string;
2
+ line: number;
3
+ col: number;
4
+ raw: string;
5
5
  }
6
- export declare function getLocationFromChars(searches: string[], text: string, currentLine: number, currentCol: number): Location[];
6
+ export declare function getLocationFromChars(
7
+ searches: string[],
8
+ text: string,
9
+ currentLine: number,
10
+ currentCol: number,
11
+ ): Location[];
7
12
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markuplint/ml-core",
3
- "version": "3.3.0",
3
+ "version": "3.3.1",
4
4
  "description": "The core module of markuplint",
5
5
  "repository": "git@github.com:markuplint/markuplint.git",
6
6
  "author": "Yusuke Hirao <yusukehirao@me.com>",
@@ -24,6 +24,8 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "@markuplint/config-presets": "3.3.0",
27
+ "@markuplint/html-parser": "3.3.1",
28
+ "@markuplint/html-spec": "3.3.1",
27
29
  "@markuplint/i18n": "3.3.0",
28
30
  "@markuplint/ml-ast": "3.0.0",
29
31
  "@markuplint/ml-config": "3.3.0",
@@ -37,5 +39,5 @@
37
39
  "@markuplint/html-parser": "3.3.0",
38
40
  "@types/debug": "^4.1.7"
39
41
  },
40
- "gitHead": "791fb22a4df7acb985ced3808923fba0cd95c28a"
42
+ "gitHead": "f19e7de726cf01d53342bc5513c30da75d28da63"
41
43
  }