-
-
Notifications
You must be signed in to change notification settings - Fork 131
/
index.d.ts
3727 lines (3172 loc) · 121 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/// <reference types="node" />
// TypeScript Version: 3.7
import Author = Document.Author;
import Title = Document.Title;
import Registry = Extensions.Registry;
import Cursor = Reader.Cursor;
declare class OpalKlass<T> {
$new(...params: any[]): T;
}
interface Runtime {
ioModule: string | 'node';
platform: string | 'node';
engine: string | 'v8';
framework: string;
}
export class Reader implements Logging {
/**
* Push source onto the front of the reader and switch the context based on the file, document-relative path and line information given.
*
* This method is typically used in an IncludeProcessor to add source read from the target specified.
*
* @param data - data
* @param file - file
* @param path - path
* @param lineno - line number
* @param attributes - a JSON of attributes
* @returns this {Reader} object.
*/
pushInclude(data: string | string[], file?: string, path?: string, lineno?: number, attributes?: object): Reader;
/**
* Get the current location of the reader's cursor, which encapsulates the file, dir, path, and lineno of the file being read.
*/
getCursor(): Cursor;
/**
* Get the remaining unprocessed lines, without consuming them, as an {Array} of {string}.
*
* Lines will not be consumed from the Reader (ie. you will be able to read these lines again).
*
* @returns the remaining unprocessed lines as an Array of String.
*/
getLines(): string[];
/**
* Get the remaining unprocessed lines, without consuming them, as a String.
*
* Lines will not be consumed from the Reader (ie. you will be able to read these lines again).
*
* @returns the remaining unprocessed lines as a String (joined by linefeed characters).
*/
getString(): string;
/**
* Check whether there are any lines left to read.
* If a previous call to this method resulted in a value of false, immediately returned the cached value.
* Otherwise, delegate to peekLine to determine if there is a next line available.
*
* @returns true if there are more lines, false if there are not.
*/
hasMoreLines(): boolean;
/**
* Check whether this reader is empty (contains no lines).
*
* @returns true if there are no more lines to peek, otherwise false.
*/
isEmpty(): boolean;
/**
* Peek at the next line.
* Processes the line if not already marked as processed, but does not consume it (ie. you will be able to read this line again).
*
* This method will probe the reader for more lines.
* If there is a next line that has not previously been visited, the line is passed to the Reader#processLine method to be initialized.
* This call gives sub-classes the opportunity to do preprocessing.
* If the return value of the Reader#processLine is undefined, the data is assumed to be changed and Reader#peekLine is invoked again to perform further processing.
*
* If hasMoreLines is called immediately before peekLine, the direct flag is implicitly true (since the line is flagged as visited).
*
* @param direct - A {boolean} flag to bypasses the check for more lines and immediately returns the first element of the internal lines {Array}. (default: false)
* @returns the next line as a {string} if there are lines remaining.
*/
peekLine(direct: boolean): string;
/**
* Consume, preprocess, and return the next line.
*
* Line will be consumed from the Reader (ie. you won't be able to read this line again).
*
* @returns the next line as a {string} if data is present.
*/
readLine(): string;
/**
* Consume, preprocess, and return the remaining lines.
*
* This method calls Reader#readLine repeatedly until all lines are consumed and returns the lines as an {Array} of {string}.
* This method differs from Reader#getLines in that it processes each line in turn, hence triggering any preprocessors implemented in sub-classes.
*
* Lines will be consumed from the Reader (ie. you won't be able to read these lines again).
*
* @returns the lines read as an {Array} of {string}.
*/
readLines(): string[];
/**
* Consume, preprocess, and return the remaining lines joined as a {string}.
*
* Delegates to Reader#readLines, then joins the result.
*
* Lines will be consumed from the Reader (ie. you won't be able to read these lines again).
*
* @returns the lines read joined as a {string}
*/
read(): string;
/**
* Advance to the next line by discarding the line at the front of the stack.
* @returns a Boolean indicating whether there was a line to discard.
*/
advance(): boolean;
getLogger(): Logger;
createLogMessage(text: string, context: any): LoggerMessage;
}
export namespace Reader {
/**
*
*/
class Cursor {
/**
* @returns the file associated to the cursor
*/
getFile(): string | undefined;
/**
* @returns the directory associated to the cursor
*/
getDirectory(): string | undefined;
/**
* @returns the path associated to the cursor (or '<stdin>')
*/
getPath(): string | undefined;
/**
* Get the line number of the cursor.
* @returns the line number of the cursor
*/
getLineNumber(): number | undefined;
}
}
export namespace SafeMode {
/**
* A safe mode level that disables any of the security features enforced by
*/
const UNSAFE: number;
/**
* A safe mode level that closely parallels safe mode in AsciiDoc.
* This value prevents access to files which reside outside of the parent directory of the source file and disables any macro other than the include::[] directive.
*/
const SAFE: number;
/**
* A safe mode level that disallows the document from setting attributes that would affect the conversion of the document,
* in addition to all the security features of {SafeMode.SAFE}.
* For instance, this level forbids changing the backend or source-highlighter using an attribute defined in the source document header.
* This is the most fundamental level of security for server deployments (hence the name).
*/
const SERVER: number;
/**
* A safe mode level that disallows the document from attempting to read files from the file system and including the contents of them into the document,
* in additional to all the security features of SafeMode.SERVER}.
* For instance, this level disallows use of the include::[] directive and the embedding of binary content (data uri), stylesheets and JavaScripts referenced by the document.
* (Asciidoctor and trusted extensions may still be allowed to embed trusted content into the document).
* Since Asciidoctor is aiming for wide adoption, this level is the default and is recommended for server deployments.
*/
const SECURE: number;
/**
* @param name - the name of the security level
* @returns the integer value of the corresponding security level.
*/
function getValueForName(name: string): number;
/**
* @param value - the integer value of the security level
* @returns the name of the corresponding security level.
*/
function getNameForValue(value: number): string | undefined;
/**
* @returns the String {Array} of security levels.
*/
function getNames(): string[];
}
interface Callout {
[key: string]: any;
id?: string;
ordinal?: number;
}
/**
* Maintains a catalog of callouts and their associations.
*/
export class Callouts {
/**
* Create a new Callouts.
* @returns a new Callouts
*/
static create(): Callouts;
/**
* Register a new callout for the given list item ordinal.
* Generates a unique id for this callout based on the index of the next callout list in the document and the index of this callout since the end of the last callout list.
*
* @param ordinal - the Integer ordinal (1-based) of the list item to which this callout is to be associated
* @returns The unique String id of this callout
* @example
* callouts = asciidoctor.Callouts.create()
* callouts.register(1)
* // => "CO1-1"
* callouts.nextList()
* callouts.register(2)
* // => "CO2-1"
*/
register(ordinal: number): string;
/**
* Get the next callout index in the document.
*
* Reads the next callout index in the document and advances the pointer.
* This method is used during conversion to retrieve the unique id of the callout that was generated during parsing.
*
* @returns The unique String id of the next callout in the document
*/
readNextId(): string;
/**
*
*/
getLists(): Callout[][];
/**
*
*/
getListIndex(): number;
/**
* et a space-separated list of callout ids for the specified list item.
* @param ordinal - the Integer ordinal (1-based) of the list item for which to retrieve the callouts
* @returns a space-separated String of callout ids associated with the specified list item
*/
getCalloutIds(ordinal: number): string;
/**
* The current list for which callouts are being collected.
* @returns The Array of callouts at the position of the list index pointer
*/
getCurrentList(): any[];
/**
* Advance to the next callout list in the document.
*/
nextList(): void;
/**
* Rewind the list index pointer, intended to be used when switching from the parsing to conversion phase.
*/
rewind(): void;
}
/**
* Logger
*/
interface LoggerFormatterFunction {
postConstruct?: (this: LoggerFormatter) => any;
call?: (this: LoggerFormatter, severity: string, time: Date, programName: string, message: string | RubyLoggerMessage) => string;
}
interface LoggerFunction {
postConstruct?: (this: Logger) => any;
add?: (this: Logger, severity: string, message: string | RubyLoggerMessage | undefined, programName: string) => void;
}
export namespace LoggerManager {
function getLogger(): Logger;
function setLogger(logger: Logger): void;
function newLogger(name: string, functions: LoggerFunction): Logger;
function newFormatter(name: string, functions: LoggerFormatterFunction): LoggerFormatter;
}
interface Writer {
write(message: string | LoggerMessage): void;
}
interface BasicLogger {
log(message: string | LoggerMessage): void;
}
declare class RubyLogger {
$add(severity: string | number, message: string | LoggerMessage, programName?: string): any;
add(severity: string | number, message: string | LoggerMessage, programName?: string): any;
log(severity: string | number, message: string | LoggerMessage, programName?: string): any;
debug(message: string): any;
info(message: string): any;
warn(message: string): any;
error(message: string): any;
fatal(message: string): any;
isDebugEnabled(): boolean;
isInfoEnabled(): boolean;
isWarnEnabled(): boolean;
isErrorEnabled(): boolean;
isFatalEnabled(): boolean;
}
export class Logger extends RubyLogger {
[key: string]: any;
formatter: LoggerFormatter;
getMaxSeverity(): undefined | number;
getFormatter(): LoggerFormatter;
setFormatter(formatter: LoggerFormatter): any;
getLevel(): number;
setLevel(level: number): any;
getProgramName(): string;
setProgramName(programName: string): any;
}
export class MemoryLogger extends Logger {
/**
* Create a new MemoryLogger.
* @returns a new MemoryLogger
*/
static create(): MemoryLogger;
getMessages(): LoggerMessage[];
}
export class NullLogger extends Logger {
/**
* Create a new NullLogger.
* @returns a new NullLogger
*/
static create(): NullLogger;
getMaxSeverity(): undefined | number;
}
export class LoggerFormatter {
call(severity: string, time: Date, programName: string, message: string): string;
}
interface Logging {
getLogger(): Logger;
createLogMessage(text: string, context: any): LoggerMessage;
}
export namespace LoggerSeverity {
function get(severity: string): number;
}
interface RubyLoggerMessage {
message: string;
source_location: SourceLocation;
text: string;
}
export class LoggerMessage implements RubyLoggerMessage {
message: string;
source_location: SourceLocation;
text: string;
getText(): string;
getSeverity(): string;
getSourceLocation(): SourceLocation;
}
interface SourceLocation {
getLineNumber(): number;
getFile(): undefined | string;
getDirectory(): string;
getPath(): string;
}
export class Timings {
/**
* Create a new Timings.
* @returns a Timings
*/
static create(): Timings;
/**
* Print a report to the specified output.
* The report will include:
* - the time to read and parse source
* - the time to convert document
* - the total time (read, parse and convert)
* @param to - an optional output (by default stdout)
* @param subject - an optional subject (usually the file name)
*/
printReport(to?: Writer | BasicLogger | RubyLogger, subject?: string): void;
}
export namespace Document {
/**
* The Author class represents information about an author extracted from document attributes.
*/
class Author {
/**
* @returns the author's full name
*/
getName(): string | undefined;
/**
* @returns the author's first name
*/
getFirstName(): string | undefined;
/**
* @returns the author's middle name (or undefined if the author has no middle name)
*/
getMiddleName(): string | undefined;
/**
* @returns the author's last name
*/
getLastName(): string | undefined;
/**
* @returns the author's initials (by default based on the author's name)
*/
getInitials(): string | undefined;
/**
* @returns the author's email
*/
getEmail(): string | undefined;
}
namespace Title {
interface Options {
partition?: boolean;
sanitize?: boolean;
use_fallback?: boolean;
}
}
/**
*
*/
class Footnote {
/**
* @returns the footnote's index
*/
getIndex(): number | undefined;
/**
* @returns the footnote's id
*/
getId(): number | undefined;
/**
* @returns the footnote's text
*/
getText(): string | undefined;
}
interface AttributeEntry {
name: string;
value: string;
negate: boolean;
}
/**
*
*/
class ImageReference {
/**
* @returns the image's target
*/
getTarget(): string;
/**
* @returns the image's directory (imagesdir attribute)
*/
getImagesDirectory(): string | undefined;
}
/**
* The Title class represents a partitioned title (i.e., title & subtitle).
*/
class Title {
getMain(): string;
getCombined(): string;
getSubtitle(): string;
isSanitized(): boolean;
hasSubtitle(): boolean;
}
class RevisionInfo {
/**
* Get the document revision date from document header (document attribute <code>revdate</code>).
*/
getDate(): string;
/**
* Get the document revision number from document header (document attribute <code>revnumber</code>).
*/
getNumber(): string;
/**
* Get the document revision remark from document header (document attribute <code>revremark</code>).
* A short summary of changes in this document revision.
*/
getRemark(): string;
/**
* @returns true if the revision info is empty (ie. not defined), otherwise false
*/
isEmpty(): boolean;
}
}
export namespace Image {
interface Attributes {
[key: string]: any;
target: string;
alt?: string;
title?: string;
caption?: string;
}
}
interface Attributes {
[key: string]: any;
}
export namespace Inline {
interface Options {
[key: string]: any;
id?: string;
type?: string;
target?: string;
attributes?: Attributes;
}
}
export namespace Block {
interface Options {
[key: string]: any;
content_model?: string;
subs?: string | string[];
}
interface Attributes {
attribute_entries?: Document.AttributeEntry[];
}
}
interface Selector {
[key: string]: any;
}
interface ParseAttributesOptions {
[key: string]: any;
positional_attributes?: string | string[];
sub_attributes?: boolean;
}
interface Options {
[key: string]: any;
}
interface ProcessorOptions {
[key: string]: any;
/**
* Sets additional document attributes, which override equivalently-named attributes defined in the document unless the value ends with @.
* Any number of built-in or user-defined attributes in one of the following formats:
* - JSON: {'name': 'value'}
* - Array:['name=value']
* - String: 'name=value'
*/
attributes?: Attributes | string[] | string;
/**
* Selects the converter to use (as registered with this keyword).
*/
backend?: string;
/**
* Sets the base (aka working) directory containing the document and resources.
*/
base_dir?: string;
/**
* If true, tells the parser to capture images and links in the reference table.
* (Normally only IDs, footnotes and indexterms are included).
* The reference table is available via the references property on the document AST object.
* (Experimental).
*/
catalog_assets?: boolean;
/**
* Sets the document type.
*/
doctype?: string;
/**
* Overrides the extensions registry instance.
* Instead of providing a JavaScript function containing extensions to register,
* this option lets you replace the extension registry itself,
* giving you complete control over how extensions are registered for this processor.
*/
extension_registry?: Registry;
/**
* @deprecated Please use {@link ProcessorOptions#standalone}
*/
header_footer?: boolean;
/**
* If true, add the document header and footer (i.e., framing) around the body content in the output.
*/
standalone?: boolean;
/**
* If true, the processor will create the necessary output directories if they don’t yet exist.
*/
mkdirs?: boolean;
/**
* If true, the source is parsed eagerly (i.e., as soon as the source is passed to the load or loadFile API).
* If false, parsing is deferred until the parse method is explicitly invoked.
*/
parse?: boolean;
/**
* Sets the safe mode.
*/
safe?: string | number;
/**
* Keeps track of the file and line number for each parsed block.
* (Useful for tooling applications where the association between the converted output and the source file is important).
*/
sourcemap?: boolean;
/**
* An array of directories containing templates to be used instead of the default built-in templates.
*/
template_dirs?: string[];
/**
* Capture time taken to read, parse, and convert document. Internal use only.
*/
timings?: Timings;
/**
* Destination directory for output file(s), relative to base_dir.
*/
to_dir?: string;
/**
* The name of the output file to write, or true to use the default output file (docname + outfilesuffix).
*/
to_file?: boolean | string;
}
/**
* @description
* Extensions provide a way to participate in the parsing and converting
* phases of the AsciiDoc processor or extend the AsciiDoc syntax.
*
* The various extensions participate in AsciiDoc processing as follows:
*
* 1. After the source lines are normalized, {{@link Extensions/Preprocessor}}s modify or replace
* the source lines before parsing begins. {{@link Extensions/IncludeProcessor}}s are used to
* process include directives for targets which they claim to handle.
* 2. The Parser parses the block-level content into an abstract syntax tree.
* Custom blocks and block macros are processed by associated {{@link Extensions/BlockProcessor}}s
* and {{@link Extensions/BlockMacroProcessor}}s, respectively.
* 3. {{@link Extensions/TreeProcessor}}s are run on the abstract syntax tree.
* 4. Conversion of the document begins, at which point inline markup is processed
* and converted. Custom inline macros are processed by associated {InlineMacroProcessor}s.
* 5. {{@link Extensions/Postprocessor}}s modify or replace the converted document.
* 6. The output is written to the output stream.
*
* Extensions may be registered globally using the {Extensions.register} method
* or added to a custom {Registry} instance and passed as an option to a single
* Asciidoctor processor.
*
* @example
* asciidoctor.Extensions.register(function () {
* this.block(function () {
* var self = this;
* self.named('shout');
* self.onContext('paragraph');
* self.process(function (parent, reader) {
* var lines = reader.getLines().map(function (l) { return l.toUpperCase(); });
* return this.createBlock(parent, 'paragraph', lines);
* });
* });
* });
*/
export namespace Extensions {
/**
* Tree processor functions
*/
interface TreeProcessorFunctions {
postConstruct?: (this: TreeProcessorInstance) => any;
initialize?: (this: TreeProcessorInstance, name: string, config: any) => void;
process: (this: TreeProcessorInstance, parent: Document) => any;
}
interface TreeProcessorInstance extends TreeProcessor {
[key: string]: any;
super: (...params: any[]) => void;
}
/**
* Include processor functions
*/
interface IncludeProcessorFunctions {
postConstruct?: (this: IncludeProcessorInstance) => any;
initialize?: (this: IncludeProcessorInstance, name: string, config: any) => void;
process: (this: IncludeProcessorInstance, document: Document, reader: Reader, target: string, attributes: any) => void;
}
interface IncludeProcessorInstance extends IncludeProcessor {
[key: string]: any;
super: (...params: any[]) => void;
}
/**
* Postprocessor functions
*/
interface PostprocessorFunctions {
postConstruct?: (this: PostprocessorInstance) => any;
initialize?: (this: PostprocessorInstance, name: string, config: any) => void;
process: (this: PostprocessorInstance, document: Document, output: string) => any;
}
interface PostprocessorInstance extends Postprocessor {
[key: string]: any;
super: (...params: any[]) => void;
}
/**
* Preprocessor functions
*/
interface PreprocessorFunctions {
postConstruct?: (this: PreprocessorInstance) => any;
initialize?: (this: PreprocessorInstance, name: string, config: any) => void;
process: (this: PreprocessorInstance, document: Document, reader: Reader) => any;
}
interface PreprocessorInstance extends Preprocessor {
[key: string]: any;
super: (...params: any[]) => void;
}
/**
* Docinfo processor functions
*/
interface DocinfoProcessorFunctions {
postConstruct?: (this: DocinfoProcessorInstance) => any;
initialize?: (this: DocinfoProcessorInstance, name: string, config: any) => void;
process: (this: DocinfoProcessorInstance, parent: Document, reader: Reader) => any;
}
interface DocinfoProcessorInstance extends DocinfoProcessor {
[key: string]: any;
super: (...params: any[]) => void;
}
/**
* Block processor functions
*/
interface BlockProcessorFunctions {
postConstruct?: (this: BlockProcessorInstance) => any;
initialize?: (this: BlockProcessorInstance, name: string, config: any) => void;
process: (this: BlockProcessorInstance, parent: Document, reader: Reader, attributes?: any) => any;
}
interface BlockProcessorInstance extends BlockProcessor {
[key: string]: any;
super: (...params: any[]) => void;
}
/**
* Block macro functions
*/
interface BlockMacroFunctions {
postConstruct?: (this: BlockMacroProcessorInstance) => any;
initialize?: (this: BlockMacroProcessorInstance, name: string, config: any) => void;
process: (this: BlockMacroProcessorInstance, parent: Document, target: string, attributes?: any) => any;
}
interface BlockMacroProcessorInstance extends BlockMacroProcessor {
[key: string]: any;
super: (...params: any[]) => void;
}
/**
* Inline macro functions
*/
interface InlineMacroFunctions {
postConstruct?: (this: InlineMacroProcessorInstance) => any;
initialize?: (this: InlineMacroProcessorInstance, name: string, config: any) => void;
process: (this: InlineMacroProcessorInstance, parent: Document, target: string, attributes?: any) => any;
}
interface InlineMacroProcessorInstance extends InlineMacroProcessor {
[key: string]: any;
super: (...params: any[]) => void;
}
/**
* Create a new {@link Registry}.
* @param [name] - An optional name
* @param [block] - An optional block
* @returns a {@link Registry}
*/
function create(name?: string, block?: (this: Registry) => any): Registry;
/**
*/
function register(block?: (this: Registry) => any): void;
/**
* Get statically-registered extension groups.
*/
function getGroups(): object;
/**
* Unregister all statically-registered extension groups.
*/
function unregisterAll(): void;
/**
* Unregister the specified statically-registered extension groups.
*
* NOTE Opal cannot delete an entry from a Hash that is indexed by symbol, so
* we have to resort to using low-level operations in this method.
*/
function unregister(...names: string[]): void;
/**
* Create a postprocessor
* @description this API is experimental and subject to change
*/
function createPostprocessor(arg: string | PostprocessorFunctions): PostprocessorKlass;
/**
* Create a postprocessor
* @description this API is experimental and subject to change
*/
function createPostprocessor(name: string, functions: PostprocessorFunctions): PostprocessorKlass;
/**
* Create and instantiate a postprocessor
* @description this API is experimental and subject to change
*/
function newPostprocessor(arg: string | PostprocessorFunctions): Postprocessor;
/**
* Create and instantiate a postprocessor
* @description this API is experimental and subject to change
*/
function newPostprocessor(name: string, functions: PostprocessorFunctions): Postprocessor;
/**
* Create a preprocessor
* @description this API is experimental and subject to change
*/
function createPreprocessor(arg: string | PreprocessorFunctions): PreprocessorKlass;
/**
* Create a preprocessor
* @description this API is experimental and subject to change
*/
function createPreprocessor(name: string, functions: PreprocessorFunctions): PreprocessorKlass;
/**
* Create and instantiate a preprocessor
* @description this API is experimental and subject to change
*/
function newPreprocessor(arg: string | PreprocessorFunctions): Preprocessor;
/**
* Create and instantiate a preprocessor
* @description this API is experimental and subject to change
*/
function newPreprocessor(name: string, functions: PreprocessorFunctions): Preprocessor;
/**
* Create a tree processor
* @description this API is experimental and subject to change
*/
function createTreeProcessor(arg: string | TreeProcessorFunctions): TreeProcessorKlass;
/**
* Create a tree processor
* @description this API is experimental and subject to change
*/
function createTreeProcessor(name: string, functions: TreeProcessorFunctions): TreeProcessorKlass;
/**
* Create and instantiate a tree processor
* @description this API is experimental and subject to change
*/
function newTreeProcessor(arg: string | TreeProcessorFunctions): TreeProcessor;
/**
* Create and instantiate a tree processor
* @description this API is experimental and subject to change
*/
function newTreeProcessor(name: string, functions: TreeProcessorFunctions): TreeProcessor;
/**
* Create an include processor
* @description this API is experimental and subject to change
*/
function createIncludeProcessor(arg: string | IncludeProcessorFunctions): IncludeProcessorKlass;
/**
* Create an include processor
* @description this API is experimental and subject to change
*/
function createIncludeProcessor(name: string, functions: IncludeProcessorFunctions): IncludeProcessorKlass;
/**
* Create and instantiate an include processor
* @description this API is experimental and subject to change
*/
function newIncludeProcessor(arg: string | IncludeProcessorFunctions): IncludeProcessor;
/**
* Create and instantiate an include processor
* @description this API is experimental and subject to change
*/
function newIncludeProcessor(name: string, functions: IncludeProcessorFunctions): IncludeProcessor;
/**
* Create a Docinfo processor
* @description this API is experimental and subject to change
*/
function createDocinfoProcessor(arg: string | DocinfoProcessorFunctions): DocinfoProcessorKlass;
/**
* Create a Docinfo processor
* @description this API is experimental and subject to change
*/
function createDocinfoProcessor(name: string, functions: DocinfoProcessorFunctions): DocinfoProcessorKlass;
/**
* Create and instantiate a Docinfo processor
* @description this API is experimental and subject to change
*/