UNPKG

2.31 kBTypeScriptView Raw
1/// <reference types="node" />
2import type { Options } from './ecmarkup';
3import type { ExportedBiblio } from './Biblio';
4import Clause from './Clause';
5import { CancellationToken } from 'prex';
6import type { JSDOM } from 'jsdom';
7export type Warning = {
8 type: 'global';
9 ruleId: string;
10 message: string;
11} | {
12 type: 'node';
13 node: Text | Element;
14 ruleId: string;
15 message: string;
16} | {
17 type: 'attr';
18 node: Element;
19 attr: string;
20 ruleId: string;
21 message: string;
22} | {
23 type: 'attr-value';
24 node: Element;
25 attr: string;
26 ruleId: string;
27 message: string;
28} | {
29 type: 'contents';
30 node: Text | Element;
31 ruleId: string;
32 message: string;
33 nodeRelativeLine: number;
34 nodeRelativeColumn: number;
35} | {
36 type: 'raw';
37 ruleId: string;
38 message: string;
39 line: number;
40 column: number;
41 file?: string;
42 source?: string;
43};
44export type WorklistItem = {
45 aoid: string | null;
46 effects: string[];
47};
48export declare function maybeAddClauseToEffectWorklist(effectName: string, clause: Clause, worklist: WorklistItem[]): void;
49export default class Spec {
50 spec: this;
51 opts: Options;
52 rootPath: string;
53 rootDir: string;
54 namespace: string;
55 generatedFiles: Map<string | null, string | Buffer>;
56 readonly log: (msg: string) => void;
57 readonly warn: (err: Warning) => void | undefined;
58 private _fetch;
59 constructor(rootPath: string, fetch: (file: string, token: CancellationToken) => PromiseLike<string>, dom: JSDOM, opts: Options | undefined, sourceText: string, token?: CancellationToken);
60 private labelClauses;
61 private toHTML;
62 private buildReferenceGraph;
63 private readSectionId;
64 private propagateEffects;
65 private propagateEffect;
66 private annotateExternalLinks;
67 private buildMultipage;
68 private buildAssets;
69 private addStyle;
70 private buildSpecWrapper;
71 private buildShortcutsHelp;
72 private processMetadata;
73 private loadBiblios;
74 private loadImports;
75 exportBiblio(): ExportedBiblio | null;
76 private highlightCode;
77 private buildBoilerplate;
78 private buildCopyrightBoilerplate;
79 private generateSDOMap;
80 private getProductions;
81 private setReplacementAlgorithmOffsets;
82 private _updateBySelector;
83}