|
1 | 1 | import globals from 'globals'; |
2 | 2 |
|
| 3 | +// The default type map path |
| 4 | +export const DEFAULT_TYPE_MAP = import.meta.resolve('./typeMap.json'); |
| 5 | + |
3 | 6 | // These are string replacements specific to Node.js API docs for anchor IDs |
4 | 7 | export const DOC_API_SLUGS_REPLACEMENTS = [ |
5 | 8 | { from: /node.js/i, to: 'nodejs' }, // Replace Node.js |
@@ -95,199 +98,6 @@ export const DOC_TYPES_MAPPING_GLOBALS = { |
95 | 98 | 'WebAssembly.Instance': 'WebAssembly/Instance', |
96 | 99 | }; |
97 | 100 |
|
98 | | -// This is a mapping for types within the Markdown content and their respective |
99 | | -// Node.js types within the Node.js API docs (refers to a different API doc page) |
100 | | -// Note: These hashes are generated with the GitHub Slugger |
101 | | -export const DOC_TYPES_MAPPING_NODE_MODULES = { |
102 | | - AbortController: 'globals.html#class-abortcontroller', |
103 | | - AbortSignal: 'globals.html#class-abortsignal', |
104 | | - |
105 | | - Algorithm: 'webcrypto.html#class-algorithm', |
106 | | - AlgorithmIdentifier: 'webcrypto.html#class-algorithmidentifier', |
107 | | - AsyncHook: 'async_hooks.html#async_hookscreatehookcallbacks', |
108 | | - AsyncLocalStorage: 'async_context.html#class-asynclocalstorage', |
109 | | - AsyncResource: 'async_hooks.html#class-asyncresource', |
110 | | - |
111 | | - AesCbcParams: 'webcrypto.html#class-aescbcparams', |
112 | | - AesCtrParams: 'webcrypto.html#class-aesctrparams', |
113 | | - AesGcmParams: 'webcrypto.html#class-aesgcmparams', |
114 | | - AesKeyAlgorithm: 'webcrypto.html#class-aeskeyalgorithm', |
115 | | - AesKeyGenParams: 'webcrypto.html#class-aeskeygenparams', |
116 | | - AesDerivedKeyParams: 'webcrypto.html#class-aesderivedkeyparams', |
117 | | - |
118 | | - Blob: 'buffer.html#class-blob', |
119 | | - BroadcastChannel: |
120 | | - 'worker_threads.html#class-broadcastchannel-extends-eventtarget', |
121 | | - Buffer: 'buffer.html#class-buffer', |
122 | | - |
123 | | - ByteLengthQueuingStrategy: 'webstreams.html#class-bytelengthqueuingstrategy', |
124 | | - |
125 | | - Channel: 'diagnostics_channel.html#class-channel', |
126 | | - ChildProcess: 'child_process.html#class-childprocess', |
127 | | - Cipher: 'crypto.html#class-cipher', |
128 | | - Cipheriv: 'crypto.html#class-cipheriv', |
129 | | - Decipheriv: 'crypto.html#class-decipheriv', |
130 | | - ClientHttp2Session: 'http2.html#class-clienthttp2session', |
131 | | - ClientHttp2Stream: 'http2.html#class-clienthttp2stream', |
132 | | - |
133 | | - CountQueuingStrategy: 'webstreams.html#class-countqueuingstrategy', |
134 | | - |
135 | | - Crypto: 'webcrypto.html#class-crypto', |
136 | | - CryptoKey: 'webcrypto.html#class-cryptokey', |
137 | | - CryptoKeyPair: 'webcrypto.html#class-cryptokeypair', |
138 | | - |
139 | | - CustomEvent: 'events.html#class-customevent', |
140 | | - |
141 | | - Decipher: 'crypto.html#class-decipher', |
142 | | - DiffieHellman: 'crypto.html#class-diffiehellman', |
143 | | - DiffieHellmanGroup: 'crypto.html#class-diffiehellmangroup', |
144 | | - Domain: 'domain.html#class-domain', |
145 | | - |
146 | | - Duplex: 'stream.html#class-streamduplex', |
147 | | - |
148 | | - ECDH: 'crypto.html#class-ecdh', |
149 | | - EcdhKeyDeriveParams: 'webcrypto.html#class-ecdhkeyderiveparams', |
150 | | - EcdsaParams: 'webcrypto.html#class-ecdsaparams', |
151 | | - EcKeyAlgorithm: 'webcrypto.html#class-eckeyalgorithm', |
152 | | - EcKeyGenParams: 'webcrypto.html#class-eckeygenparams', |
153 | | - EcKeyImportParams: 'webcrypto.html#class-eckeyimportparams', |
154 | | - Ed448Params: 'webcrypto.html#class-ed448params', |
155 | | - |
156 | | - Event: 'events.html#class-event', |
157 | | - EventEmitter: 'events.html#class-eventemitter', |
158 | | - EventListener: 'events.html#event-listener', |
159 | | - EventTarget: 'events.html#class-eventtarget', |
160 | | - |
161 | | - File: 'buffer.html#class-file', |
162 | | - FileHandle: 'fs.html#class-filehandle', |
163 | | - |
164 | | - Handle: 'net.html#serverlistenhandle-backlog-callback', |
165 | | - Hash: 'crypto.html#class-hash', |
166 | | - Histogram: 'perf_hooks.html#class-histogram', |
167 | | - HkdfParams: 'webcrypto.html#class-hkdfparams', |
168 | | - Hmac: 'crypto.html#class-hmac', |
169 | | - HmacImportParams: 'webcrypto.html#class-hmacimportparams', |
170 | | - HmacKeyAlgorithm: 'webcrypto.html#class-hmackeyalgorithm', |
171 | | - HmacKeyGenParams: 'webcrypto.html#class-hmackeygenparams', |
172 | | - |
173 | | - Http2SecureServer: 'http2.html#class-http2secureserver', |
174 | | - Http2Server: 'http2.html#class-http2server', |
175 | | - Http2Session: 'http2.html#class-http2session', |
176 | | - Http2Stream: 'http2.html#class-http2stream', |
177 | | - |
178 | | - Immediate: 'timers.html#class-immediate', |
179 | | - |
180 | | - IntervalHistogram: |
181 | | - 'perf_hooks.html#class-intervalhistogram-extends-histogram', |
182 | | - |
183 | | - LockManager: 'worker_threads.html#class-lockmanager', |
184 | | - |
185 | | - KeyAlgorithm: 'webcrypto.html#class-keyalgorithm', |
186 | | - KeyObject: 'crypto.html#class-keyobject', |
187 | | - |
188 | | - MIMEParams: 'util.html#class-utilmimeparams', |
189 | | - MessagePort: 'worker_threads.html#class-messageport', |
190 | | - |
191 | | - MockModuleContext: 'test.html#class-mockmodulecontext', |
192 | | - |
193 | | - NodeEventTarget: 'events.html#class-nodeeventtarget', |
194 | | - |
195 | | - Pbkdf2Params: 'webcrypto.html#class-pbkdf2params', |
196 | | - PerformanceEntry: 'perf_hooks.html#class-performanceentry', |
197 | | - PerformanceNodeTiming: 'perf_hooks.html#class-performancenodetiming', |
198 | | - PerformanceObserver: 'perf_hooks.html#class-performanceobserver', |
199 | | - PerformanceObserverEntryList: |
200 | | - 'perf_hooks.html#class-performanceobserverentrylist', |
201 | | - |
202 | | - Readable: 'stream.html#class-streamreadable', |
203 | | - ReadableByteStreamController: |
204 | | - 'webstreams.html#class-readablebytestreamcontroller', |
205 | | - ReadableStream: 'webstreams.html#class-readablestream', |
206 | | - ReadableStreamBYOBReader: 'webstreams.html#class-readablestreambyobreader', |
207 | | - ReadableStreamBYOBRequest: 'webstreams.html#class-readablestreambyobrequest', |
208 | | - ReadableStreamDefaultController: |
209 | | - 'webstreams.html#class-readablestreamdefaultcontroller', |
210 | | - ReadableStreamDefaultReader: |
211 | | - 'webstreams.html#class-readablestreamdefaultreader', |
212 | | - |
213 | | - ModuleRequest: 'vm.html#type-modulerequest', |
214 | | - |
215 | | - DatabaseSync: 'sqlite.html#class-databasesync', |
216 | | - |
217 | | - RecordableHistogram: |
218 | | - 'perf_hooks.html#class-recordablehistogram-extends-histogram', |
219 | | - |
220 | | - RsaHashedKeyAlgorithm: 'webcrypto.html#class-rsahashedkeyalgorithm', |
221 | | - RsaHashedImportParams: 'webcrypto.html#class-rsahashedimportparams', |
222 | | - RsaHashedKeyGenParams: 'webcrypto.html#class-rsahashedkeygenparams', |
223 | | - RsaOaepParams: 'webcrypto.html#class-rsaoaepparams', |
224 | | - RsaPssParams: 'webcrypto.html#class-rsapssparams', |
225 | | - |
226 | | - ServerHttp2Session: 'http2.html#class-serverhttp2session', |
227 | | - ServerHttp2Stream: 'http2.html#class-serverhttp2stream', |
228 | | - |
229 | | - Sign: 'crypto.html#class-sign', |
230 | | - |
231 | | - Disposable: |
232 | | - 'https://tc39.es/proposal-explicit-resource-management/#sec-disposable-interface', |
233 | | - |
234 | | - Session: 'sqlite.html#class-session', |
235 | | - StatementSync: 'sqlite.html#class-statementsync', |
236 | | - |
237 | | - Stream: 'stream.html#stream', |
238 | | - |
239 | | - SubtleCrypto: 'webcrypto.html#class-subtlecrypto', |
240 | | - |
241 | | - TestsStream: 'test.html#class-testsstream', |
242 | | - |
243 | | - TextDecoderStream: 'webstreams.html#class-textdecoderstream', |
244 | | - TextEncoderStream: 'webstreams.html#class-textencoderstream', |
245 | | - |
246 | | - Timeout: 'timers.html#class-timeout', |
247 | | - Timer: 'timers.html#timers', |
248 | | - |
249 | | - Tracing: 'tracing.html#tracing-object', |
250 | | - TracingChannel: 'diagnostics_channel.html#class-tracingchannel', |
251 | | - |
252 | | - Transform: 'stream.html#class-streamtransform', |
253 | | - TransformStream: 'webstreams.html#class-transformstream', |
254 | | - TransformStreamDefaultController: |
255 | | - 'webstreams.html#class-transformstreamdefaultcontroller', |
256 | | - |
257 | | - URL: 'url.html#the-whatwg-url-api', |
258 | | - URLSearchParams: 'url.html#class-urlsearchparams', |
259 | | - |
260 | | - Verify: 'crypto.html#class-verify', |
261 | | - |
262 | | - Writable: 'stream.html#class-streamwritable', |
263 | | - WritableStream: 'webstreams.html#class-writablestream', |
264 | | - WritableStreamDefaultController: |
265 | | - 'webstreams.html#class-writablestreamdefaultcontroller', |
266 | | - WritableStreamDefaultWriter: |
267 | | - 'webstreams.html#class-writablestreamdefaultwriter', |
268 | | - |
269 | | - Worker: 'worker_threads.html#class-worker', |
270 | | - |
271 | | - X509Certificate: 'crypto.html#class-x509certificate', |
272 | | - |
273 | | - 'brotli options': 'zlib.html#class-brotlioptions', |
274 | | - |
275 | | - 'import.meta': 'esm.html#importmeta', |
276 | | - |
277 | | - 'os.constants.dlopen': 'os.html#dlopen-constants', |
278 | | - |
279 | | - 'readlinePromises.Interface': 'readline.html#class-readlinepromisesinterface', |
280 | | - |
281 | | - require: 'modules.html#requireid', |
282 | | - module: 'modules.html#the-module-object', |
283 | | - |
284 | | - 'zlib options': 'zlib.html#class-options', |
285 | | - 'zstd options': 'zlib.html#class-zstdoptions', |
286 | | - |
287 | | - 'HTTP/2 Headers Object': 'http2.html#headers-object', |
288 | | - 'HTTP/2 Settings Object': 'http2.html#settings-object', |
289 | | -}; |
290 | | - |
291 | 101 | // This is a mapping for miscellaneous types within the Markdown content and their respective |
292 | 102 | // external reference on appropriate 3rd-party vendors/documentation sites. |
293 | 103 | export const DOC_TYPES_MAPPING_OTHER = { |
|
0 commit comments