@difizen/libro-common 0.0.2-alpha.0 → 0.1.0

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,120 +0,0 @@
1
- import type { Event } from '@difizen/mana-common';
2
- /**
3
- * A readonly poll that calls an asynchronous function with each tick.
4
- *
5
- * @typeparam T - The resolved type of the factory's promises.
6
- *
7
- * @typeparam U - The rejected type of the factory's promises.
8
- *
9
- * @typeparam V - The type to extend the phases supported by a poll.
10
- */
11
- export interface IPoll<T, U, V extends string> extends AsyncIterable<IPoll.State<T, U, V>> {
12
- /**
13
- * A signal emitted when the poll is disposed.
14
- */
15
- readonly onDispose: Event<void>;
16
- /**
17
- * The polling frequency data.
18
- */
19
- readonly frequency: IPoll.Frequency;
20
- /**
21
- * Whether the poll is disposed.
22
- */
23
- readonly disposed: boolean;
24
- /**
25
- * The name of the poll.
26
- */
27
- readonly name: string;
28
- /**
29
- * The poll state, which is the content of the currently-scheduled poll tick.
30
- */
31
- readonly state: IPoll.State<T, U, V>;
32
- /**
33
- * A promise that resolves when the currently-scheduled tick completes.
34
- *
35
- * #### Notes
36
- * Usually this will resolve after `state.interval` milliseconds from
37
- * `state.timestamp`. It can resolve earlier if the user starts or refreshes
38
- * the poll, etc.
39
- */
40
- readonly tick: Promise<IPoll<T, U, V>>;
41
- /**
42
- * A signal emitted when the poll state changes, i.e., a new tick is scheduled.
43
- */
44
- readonly ticked: Event<IPoll.State<T, U, V>>;
45
- }
46
- /**
47
- * A namespace for `IPoll` types.
48
- */
49
- export declare namespace IPoll {
50
- /**
51
- * The polling frequency parameters.
52
- *
53
- * #### Notes
54
- * We implement the "decorrelated jitter" strategy from
55
- * https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/.
56
- * Essentially, if consecutive retries are needed, we choose an integer:
57
- * `sleep = min(max, rand(interval, backoff * sleep))`
58
- * This ensures that the poll is never less than `interval`, and nicely
59
- * spreads out retries for consecutive tries. Over time, if (interval < max),
60
- * the random number will be above `max` about (1 - 1/backoff) of the time
61
- * (sleeping the `max`), and the rest of the time the sleep will be a random
62
- * number below `max`, decorrelating our trigger time from other pollers.
63
- */
64
- type Frequency = {
65
- /**
66
- * Whether poll frequency backs off (boolean) or the backoff growth rate
67
- * (float > 1).
68
- *
69
- * #### Notes
70
- * If `true`, the default backoff growth rate is `3`.
71
- */
72
- readonly backoff: boolean | number;
73
- /**
74
- * The basic polling interval in milliseconds (integer).
75
- */
76
- readonly interval: number;
77
- /**
78
- * The maximum milliseconds (integer) between poll requests.
79
- */
80
- readonly max: number;
81
- };
82
- /**
83
- * The phase of the poll when the current tick was scheduled.
84
- *
85
- * @typeparam T - A type for any additional tick phases a poll supports.
86
- */
87
- type Phase<T extends string> = T | 'constructed' | 'disposed' | 'reconnected' | 'refreshed' | 'rejected' | 'resolved' | 'standby' | 'started' | 'stopped';
88
- /**
89
- * Definition of poll state at any given time.
90
- *
91
- * @typeparam T - The resolved type of the factory's promises.
92
- *
93
- * @typeparam U - The rejected type of the factory's promises.
94
- *
95
- * @typeparam V - The type to extend the phases supported by a poll.
96
- */
97
- type State<T, U, V extends string> = {
98
- /**
99
- * The number of milliseconds until the current tick resolves.
100
- */
101
- readonly interval: number;
102
- /**
103
- * The payload of the last poll resolution or rejection.
104
- *
105
- * #### Notes
106
- * The payload is `null` unless the `phase` is `'reconnected`, `'resolved'`,
107
- * or `'rejected'`. Its type is `T` for resolutions and `U` for rejections.
108
- */
109
- readonly payload: T | U | null;
110
- /**
111
- * The current poll phase.
112
- */
113
- readonly phase: Phase<V>;
114
- /**
115
- * The timestamp for when this tick was scheduled.
116
- */
117
- readonly timestamp: number;
118
- };
119
- }
120
- //# sourceMappingURL=protocol.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../src/polling/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAElD;;;;;;;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SAAS,GACT,SAAS,CAAC;IAEd;;;;;;;;OAQG;IACH,KAAY,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,SAAS,MAAM,IAAI;QAC1C;;WAEG;QACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;QAE1B;;;;;;WAMG;QACH,QAAQ,CAAC,OAAO,EAAE,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;QAE/B;;WAEG;QACH,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;QAEzB;;WAEG;QACH,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;KAC5B,CAAC;CACH"}
package/es/posix.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export declare const join: (...args: string[]) => string;
2
- //# sourceMappingURL=posix.d.ts.map
package/es/posix.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"posix.d.ts","sourceRoot":"","sources":["../src/posix.ts"],"names":[],"mappings":"AA0DA,eAAO,MAAM,IAAI,YAAsB,MAAM,EAAE,WAgB9C,CAAC"}
@@ -1,181 +0,0 @@
1
- import type { PartialJSONObject } from '../json.js';
2
- import type { ExecutionCount, IAttachments, MultilineString } from './notebook-protocol.js';
3
- import type { IOutput } from './output-protocol.js';
4
- /**
5
- * A type which describes the type of cell.
6
- */
7
- export type CellType = 'code' | 'markdown' | 'raw' | string;
8
- /**
9
- * The Jupyter metadata namespace.
10
- */
11
- export interface IBaseCellJupyterMetadata extends PartialJSONObject {
12
- /**
13
- * Whether the source is hidden.
14
- */
15
- source_hidden: boolean;
16
- }
17
- /**
18
- * Cell-level metadata.
19
- */
20
- export interface IBaseCellMetadata extends PartialJSONObject {
21
- /**
22
- * Whether the cell is trusted.
23
- *
24
- * #### Notes
25
- * This is not strictly part of the nbformat spec, but it is added by
26
- * the contents manager.
27
- *
28
- * See https://jupyter-server.readthedocs.io/en/latest/operators/security.html.
29
- */
30
- trusted: boolean;
31
- /**
32
- * The cell's name. If present, must be a non-empty string.
33
- */
34
- name: string;
35
- /**
36
- * The Jupyter metadata namespace
37
- */
38
- jupyter: Partial<IBaseCellJupyterMetadata>;
39
- /**
40
- * The cell's tags. Tags must be unique, and must not contain commas.
41
- */
42
- tags: string[];
43
- }
44
- /**
45
- * The base cell interface.
46
- */
47
- export interface IBaseCell extends PartialJSONObject {
48
- /**
49
- * String identifying the type of cell.
50
- */
51
- cell_type: string;
52
- /**
53
- * Contents of the cell, represented as an array of lines.
54
- */
55
- source: MultilineString;
56
- /**
57
- * Cell-level metadata.
58
- */
59
- metadata: Partial<ICellMetadata>;
60
- }
61
- /**
62
- * Metadata for the raw cell.
63
- */
64
- export interface IRawCellMetadata extends IBaseCellMetadata {
65
- /**
66
- * Raw cell metadata format for nbconvert.
67
- */
68
- format: string;
69
- }
70
- /**
71
- * A raw cell.
72
- */
73
- export interface IRawCell extends IBaseCell {
74
- /**
75
- * A string field representing the identifier of this particular cell.
76
- *
77
- * Notebook format 4.4 requires no id field, but format 4.5 requires an id
78
- * field. We need to handle both cases, so we make id optional here.
79
- */
80
- id?: string | undefined;
81
- /**
82
- * String identifying the type of cell.
83
- */
84
- cell_type: 'raw';
85
- /**
86
- * Cell-level metadata.
87
- */
88
- metadata: Partial<IRawCellMetadata>;
89
- /**
90
- * Cell attachments.
91
- */
92
- attachments?: IAttachments | undefined;
93
- }
94
- /**
95
- * A markdown cell.
96
- */
97
- export interface IMarkdownCell extends IBaseCell {
98
- /**
99
- * A string field representing the identifier of this particular cell.
100
- *
101
- * Notebook format 4.4 requires no id field, but format 4.5 requires an id
102
- * field. We need to handle both cases, so we make id optional here.
103
- */
104
- id?: string | undefined;
105
- /**
106
- * String identifying the type of cell.
107
- */
108
- cell_type: 'markdown';
109
- /**
110
- * Cell attachments.
111
- */
112
- attachments?: IAttachments | undefined;
113
- }
114
- /**
115
- * The Jupyter metadata namespace for code cells.
116
- */
117
- export interface ICodeCellJupyterMetadata extends IBaseCellJupyterMetadata {
118
- /**
119
- * Whether the outputs are hidden. See https://github.com/jupyter/nbformat/issues/137.
120
- */
121
- outputs_hidden: boolean;
122
- }
123
- /**
124
- * Metadata for a code cell.
125
- */
126
- export interface ICodeCellMetadata extends IBaseCellMetadata {
127
- /**
128
- * Whether the cell is collapsed/expanded.
129
- */
130
- collapsed: boolean;
131
- /**
132
- * The Jupyter metadata namespace
133
- */
134
- jupyter: Partial<ICodeCellJupyterMetadata>;
135
- /**
136
- * Whether the cell's output is scrolled, unscrolled, or autoscrolled.
137
- */
138
- scrolled: boolean | 'auto';
139
- }
140
- /**
141
- * A code cell.
142
- */
143
- export interface ICodeCell extends IBaseCell {
144
- /**
145
- * A string field representing the identifier of this particular cell.
146
- *
147
- * Notebook format 4.4 requires no id field, but format 4.5 requires an id
148
- * field. We need to handle both cases, so we make id optional here.
149
- */
150
- id?: string | undefined;
151
- /**
152
- * String identifying the type of cell.
153
- * Changed in Libro: cell_type 不再限制只能是code,以便支持多种语言的cell
154
- */
155
- cell_type: string;
156
- /**
157
- * Cell-level metadata.
158
- */
159
- metadata: Partial<ICodeCellMetadata>;
160
- /**
161
- * Execution, display, or stream outputs.
162
- */
163
- outputs: IOutput[];
164
- /**
165
- * The code cell's prompt number. Will be null if the cell has not been run.
166
- */
167
- execution_count: ExecutionCount;
168
- }
169
- /**
170
- * An unrecognized cell.
171
- */
172
- export type IUnrecognizedCell = IBaseCell;
173
- /**
174
- * A cell union type.
175
- */
176
- export type ICell = IRawCell | IMarkdownCell | ICodeCell | IUnrecognizedCell;
177
- /**
178
- * A union metadata type.
179
- */
180
- export type ICellMetadata = IBaseCellMetadata | IRawCellMetadata | ICodeCellMetadata;
181
- //# sourceMappingURL=cell-protocol.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cell-protocol.d.ts","sourceRoot":"","sources":["../../src/protocol/cell-protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD,OAAO,KAAK,EACV,cAAc,EAC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AAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAExB;;OAEG;IACH,SAAS,EAAE,UAAU,CAAC;IAEtB;;OAEG;IACH,WAAW,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;CACxC;AAED;;GAEG;AACH,MAAM,WAAW,wBAAyB,SAAQ,wBAAwB;IACxE;;OAEG;IACH,cAAc,EAAE,OAAO,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,iBAAiB;IAC1D;;OAEG;IACH,SAAS,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC,wBAAwB,CAAC,CAAC;IAE3C;;OAEG;IACH,QAAQ,EAAE,OAAO,GAAG,MAAM,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,SAAU,SAAQ,SAAS;IAC1C;;;;;OAKG;IACH,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAExB;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAGlB;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAErC;;OAEG;IACH,OAAO,EAAE,OAAO,EAAE,CAAC;IAEnB;;OAEG;IACH,eAAe,EAAE,cAAc,CAAC;CACjC;AAED;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,SAAS,CAAC;AAE1C;;GAEG;AACH,MAAM,MAAM,KAAK,GAAG,QAAQ,GAAG,aAAa,GAAG,SAAS,GAAG,iBAAiB,CAAC;AAE7E;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAAG,gBAAgB,GAAG,iBAAiB,CAAC"}
@@ -1,4 +0,0 @@
1
- export * from './cell-protocol.js';
2
- export * from './notebook-protocol.js';
3
- export * from './output-protocol.js';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/protocol/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC"}
@@ -1,63 +0,0 @@
1
- import type { PartialJSONObject } from '../json.js';
2
- import type { ICell } from './cell-protocol.js';
3
- /**
4
- * The earliest major version of the notebook format we support.
5
- */
6
- export declare const MAJOR_VERSION = 4;
7
- /**
8
- * The earliest minor version of the notebook format we support.
9
- */
10
- export declare const MINOR_VERSION = 4;
11
- /**
12
- * The kernelspec metadata.
13
- */
14
- export interface IKernelspecMetadata extends PartialJSONObject {
15
- name: string;
16
- display_name: string;
17
- }
18
- /**
19
- * The language info metadata
20
- */
21
- export interface ILanguageInfoMetadata extends PartialJSONObject {
22
- name: string;
23
- codemirror_mode?: string | PartialJSONObject;
24
- file_extension?: string;
25
- mimetype?: string;
26
- pygments_lexer?: string;
27
- }
28
- /**
29
- * The default metadata for the notebook.
30
- */
31
- export interface INotebookMetadata extends PartialJSONObject {
32
- kernelspec?: IKernelspecMetadata;
33
- language_info?: ILanguageInfoMetadata;
34
- orig_nbformat?: number;
35
- }
36
- /**
37
- * The notebook content.
38
- */
39
- export interface INotebookContent extends PartialJSONObject {
40
- metadata: INotebookMetadata;
41
- nbformat_minor: number;
42
- nbformat: number;
43
- cells: ICell[];
44
- }
45
- /**
46
- * A multiline string.
47
- */
48
- export type MultilineString = string | string[];
49
- /**
50
- * A mime-type keyed dictionary of data.
51
- */
52
- export interface IMimeBundle extends PartialJSONObject {
53
- [key: string]: MultilineString | PartialJSONObject;
54
- }
55
- /**
56
- * Media attachments (e.g. inline images).
57
- */
58
- export type IAttachments = Record<string, IMimeBundle | undefined>;
59
- /**
60
- * The code cell's prompt number. Will be null if the cell has not been run.
61
- */
62
- export type ExecutionCount = number | null;
63
- //# sourceMappingURL=notebook-protocol.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"notebook-protocol.d.ts","sourceRoot":"","sources":["../../src/protocol/notebook-protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,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;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,IAAI,CAAC"}
@@ -1,125 +0,0 @@
1
- import type { PartialJSONObject } from '../json.js';
2
- import type { ExecutionCount, IMimeBundle, MultilineString } from './notebook-protocol.js';
3
- /**
4
- * Cell output metadata.
5
- */
6
- export type OutputMetadata = PartialJSONObject;
7
- /**
8
- * The valid output types.
9
- */
10
- export type OutputType = 'execute_result' | 'display_data' | 'stream' | 'error' | 'update_display_data';
11
- /**
12
- * The base output type.
13
- */
14
- export interface IBaseOutput extends PartialJSONObject {
15
- /**
16
- * Type of cell output.
17
- */
18
- output_type: string;
19
- }
20
- /**
21
- * Result of executing a code cell.
22
- */
23
- export interface IExecuteResult extends IBaseOutput {
24
- /**
25
- * Type of cell output.
26
- */
27
- output_type: 'execute_result';
28
- /**
29
- * A result's prompt number.
30
- */
31
- execution_count: ExecutionCount;
32
- /**
33
- * A mime-type keyed dictionary of data.
34
- */
35
- data: IMimeBundle;
36
- /**
37
- * Cell output metadata.
38
- */
39
- metadata: OutputMetadata;
40
- }
41
- /**
42
- * Data displayed as a result of code cell execution.
43
- */
44
- export interface IDisplayData extends IBaseOutput {
45
- /**
46
- * Type of cell output.
47
- */
48
- output_type: 'display_data';
49
- /**
50
- * A mime-type keyed dictionary of data.
51
- */
52
- data: IMimeBundle;
53
- /**
54
- * Cell output metadata.
55
- */
56
- metadata: OutputMetadata;
57
- }
58
- /**
59
- * Data displayed as an update to existing display data.
60
- */
61
- export interface IDisplayUpdate extends IBaseOutput {
62
- /**
63
- * Type of cell output.
64
- */
65
- output_type: 'update_display_data';
66
- /**
67
- * A mime-type keyed dictionary of data.
68
- */
69
- data: IMimeBundle;
70
- /**
71
- * Cell output metadata.
72
- */
73
- metadata: OutputMetadata;
74
- }
75
- /**
76
- * Stream output from a code cell.
77
- */
78
- export interface IStream extends IBaseOutput {
79
- /**
80
- * Type of cell output.
81
- */
82
- output_type: 'stream';
83
- /**
84
- * The name of the stream.
85
- */
86
- name: StreamType;
87
- /**
88
- * The stream's text output.
89
- */
90
- text: MultilineString;
91
- }
92
- /**
93
- * An alias for a stream type.
94
- */
95
- export type StreamType = 'stdout' | 'stderr';
96
- /**
97
- * Output of an error that occurred during code cell execution.
98
- */
99
- export interface IError extends IBaseOutput {
100
- /**
101
- * Type of cell output.
102
- */
103
- output_type: 'error';
104
- /**
105
- * The name of the error.
106
- */
107
- ename: string;
108
- /**
109
- * The value, or message, of the error.
110
- */
111
- evalue: string;
112
- /**
113
- * The error's traceback.
114
- */
115
- traceback: string[];
116
- }
117
- /**
118
- * Unrecognized output.
119
- */
120
- export type IUnrecognizedOutput = IBaseOutput;
121
- /**
122
- * An output union type.
123
- */
124
- export type IOutput = IUnrecognizedOutput | IExecuteResult | IDisplayData | IStream | IError;
125
- //# sourceMappingURL=output-protocol.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"output-protocol.d.ts","sourceRoot":"","sources":["../../src/protocol/output-protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD,OAAO,KAAK,EACV,cAAc,EACd,WAAW,EACX,eAAe,EAChB,MAAM,wBAAwB,CAAC;AAEhC;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,iBAAiB,CAAC;AAE/C;;GAEG;AACH,MAAM,MAAM,UAAU,GAClB,gBAAgB,GAChB,cAAc,GACd,QAAQ,GACR,OAAO,GACP,qBAAqB,CAAC;AAE1B;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,iBAAiB;IACpD;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,cAAe,SAAQ,WAAW;IACjD;;OAEG;IACH,WAAW,EAAE,gBAAgB,CAAC;IAE9B;;OAEG;IACH,eAAe,EAAE,cAAc,CAAC;IAEhC;;OAEG;IACH,IAAI,EAAE,WAAW,CAAC;IAElB;;OAEG;IACH,QAAQ,EAAE,cAAc,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,YAAa,SAAQ,WAAW;IAC/C;;OAEG;IACH,WAAW,EAAE,cAAc,CAAC;IAE5B;;OAEG;IACH,IAAI,EAAE,WAAW,CAAC;IAElB;;OAEG;IACH,QAAQ,EAAE,cAAc,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,cAAe,SAAQ,WAAW;IACjD;;OAEG;IACH,WAAW,EAAE,qBAAqB,CAAC;IAEnC;;OAEG;IACH,IAAI,EAAE,WAAW,CAAC;IAElB;;OAEG;IACH,QAAQ,EAAE,cAAc,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,OAAQ,SAAQ,WAAW;IAC1C;;OAEG;IACH,WAAW,EAAE,QAAQ,CAAC;IAEtB;;OAEG;IACH,IAAI,EAAE,UAAU,CAAC;IAEjB;;OAEG;IACH,IAAI,EAAE,eAAe,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE7C;;GAEG;AACH,MAAM,WAAW,MAAO,SAAQ,WAAW;IACzC;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,WAAW,CAAC;AAE9C;;GAEG;AACH,MAAM,MAAM,OAAO,GACf,mBAAmB,GACnB,cAAc,GACd,YAAY,GACZ,OAAO,GACP,MAAM,CAAC"}
package/es/sanitizer.d.ts DELETED
@@ -1,44 +0,0 @@
1
- export interface ISanitizerOptions {
2
- /**
3
- * The allowed tags.
4
- */
5
- allowedTags?: string[];
6
- /**
7
- * The allowed attributes for a given tag.
8
- */
9
- allowedAttributes?: Record<string, string[]>;
10
- /**
11
- * The allowed style values for a given tag.
12
- */
13
- allowedStyles?: Record<string, Record<string, RegExp[]>>;
14
- }
15
- export interface ISanitizer {
16
- /**
17
- * Sanitize an HTML string.
18
- *
19
- * @param dirty - The dirty text.
20
- *
21
- * @param options - The optional sanitization options.
22
- *
23
- * @returns The sanitized string.
24
- */
25
- sanitize: (dirty: string, options?: ISanitizerOptions) => string;
26
- }
27
- /**
28
- * A class to sanitize HTML strings.
29
- */
30
- export declare class Sanitizer implements ISanitizer {
31
- /**
32
- * Sanitize an HTML string.
33
- *
34
- * @param dirty - The dirty text.
35
- *
36
- * @param options - The optional sanitization options.
37
- *
38
- * @returns The sanitized string.
39
- */
40
- sanitize(dirty: string, options?: ISanitizerOptions): string;
41
- private _options;
42
- }
43
- export declare const defaultSanitizer: ISanitizer;
44
- //# sourceMappingURL=sanitizer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sanitizer.d.ts","sourceRoot":"","sources":["../src/sanitizer.ts"],"names":[],"mappings":"AA4ZA,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IAEvB;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAE7C;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;CAC1D;AACD,MAAM,WAAW,UAAU;IACzB;;;;;;;;OAQG;IACH,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,iBAAiB,KAAK,MAAM,CAAC;CAClE;AAED;;GAEG;AACH,qBAAa,SAAU,YAAW,UAAU;IAC1C;;;;;;;;OAQG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,MAAM;IAI5D,OAAO,CAAC,QAAQ,CAmed;CACH;AACD,eAAO,MAAM,gBAAgB,EAAE,UAA4B,CAAC"}
package/es/url.d.ts DELETED
@@ -1,98 +0,0 @@
1
- /**
2
- * The namespace for URL-related functions.
3
- */
4
- export declare class URL {
5
- /**
6
- * Parse URL and retrieve hostname
7
- *
8
- * @param url - The URL string to parse
9
- *
10
- * @returns a hostname string value
11
- */
12
- static getHostName(url: string): string;
13
- /**
14
- * Normalize a url.
15
- */
16
- static normalize(url: string): string;
17
- static normalize(url: undefined): undefined;
18
- static normalize(url: string | undefined): string | undefined;
19
- /**
20
- * Join a sequence of url components and normalizes as in node `path.join`.
21
- *
22
- * @param parts - The url components.
23
- *
24
- * @returns the joined url.
25
- */
26
- static join(...parts: string[]): string;
27
- /**
28
- * Encode the components of a multi-segment url.
29
- *
30
- * @param url - The url to encode.
31
- *
32
- * @returns the encoded url.
33
- *
34
- * #### Notes
35
- * Preserves the `'/'` separators.
36
- * Should not include the base url, since all parts are escaped.
37
- */
38
- static encodeParts(url: string): string;
39
- /**
40
- * Parse a url into a URL object.
41
- *
42
- * @param urlString - The URL string to parse.
43
- *
44
- * @returns A URL object.
45
- */
46
- static parse(url: string): IUrl;
47
- /**
48
- * Test whether the url is a local url.
49
- *
50
- * #### Notes
51
- * This function returns `false` for any fully qualified url, including
52
- * `data:`, `file:`, and `//` protocol URLs.
53
- */
54
- static isLocal(url: string): boolean;
55
- }
56
- /**
57
- * The interface for a URL object
58
- */
59
- export interface IUrl {
60
- /**
61
- * The full URL string that was parsed with both the protocol and host
62
- * components converted to lower-case.
63
- */
64
- href: string;
65
- /**
66
- * Identifies the URL's lower-cased protocol scheme.
67
- */
68
- protocol: string;
69
- /**
70
- * The full lower-cased host portion of the URL, including the port if
71
- * specified.
72
- */
73
- host: string;
74
- /**
75
- * The lower-cased host name portion of the host component without the
76
- * port included.
77
- */
78
- hostname: string;
79
- /**
80
- * The numeric port portion of the host component.
81
- */
82
- port: string;
83
- /**
84
- * The entire path section of the URL.
85
- */
86
- pathname: string;
87
- /**
88
- * The "fragment" portion of the URL including the leading ASCII hash
89
- * `(#)` character
90
- */
91
- hash: string;
92
- /**
93
- * The search element, including leading question mark (`'?'`), if any,
94
- * of the URL.
95
- */
96
- search?: string;
97
- }
98
- //# sourceMappingURL=url.d.ts.map
package/es/url.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../src/url.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,qBAAa,GAAG;IACd;;;;;;OAMG;IACH,MAAM,CAAC,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAGvC;;OAEG;IACH,MAAM,CAAC,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IACrC,MAAM,CAAC,SAAS,CAAC,GAAG,EAAE,SAAS,GAAG,SAAS;IAC3C,MAAM,CAAC,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS;IAa7D;;;;;;OAMG;IACH,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM;IAmBvC;;;;;;;;;;OAUG;IACH,MAAM,CAAC,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAGvC;;;;;;OAMG;IACH,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAQ/B;;;;;;OAMG;IACH,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;CAOrC;AAED;;GAEG;AACH,MAAM,WAAW,IAAI;IACnB;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}