#!/usr/bin/env node
import { fileURLToPath as ___fileURLToPath } from "node:url";
import { dirname as ___dirname } from "node:path";
import { createRequire as ___createRequire} from "node:module";
const __filename = ___fileURLToPath(import.meta.url);
const __dirname = ___dirname(__filename);
const require = ___createRequire(import.meta.url);
/*! @kayahr/typedoc v0.28.19-bundle.1 | MIT */
import{Converter as k,ParameterType as h}from"@kayahr/typedoc";var g=new Map([["Awaited","awaitedtype"],["Partial","partialtype"],["Required","requiredtype"],["Readonly","readonlytype"],["Record","recordkeys-type"],["Pick","picktype-keys"],["Omit","omittype-keys"],["Exclude","excludeuniontype-excludedmembers"],["Extract","extracttype-union"],["NonNullable","nonnullabletype"],["Parameters","parameterstype"],["ConstructorParameters","constructorparameterstype"],["ReturnType","returntypetype"],["InstanceType","instancetypetype"],["NoInfer","noinfertype"],["ThisParameterType","thisparametertypetype"],["OmitThisParameter","omitthisparametertype"],["ThisType","thistypetype"]]),b=new Map([["Uppercase","uppercasestringtype"],["Lowercase","lowercasestringtype"],["Capitalize","capitalizestringtype"],["Uncapitalize","uncapitalizestringtype"]]),w=new Map([["Iterable","iterable-interface"]]);function d(e){if(e.length!==1)return;let t=e[0].path,r=g.get(t);if(r)return`https://www.typescriptlang.org/docs/handbook/utility-types.html#${r}`;let o=b.get(t);if(o)return`https://www.typescriptlang.org/docs/handbook/2/template-literal-types.html#${o}`;let l=w.get(t);if(l)return`https://www.typescriptlang.org/docs/handbook/iterators-and-generators.html#${l}`}import{readFileSync as v}from"node:fs";import{dirname as f,join as T}from"node:path";import{fileURLToPath as R}from"node:url";var S=f(f(R(import.meta.url))),P=JSON.parse(v(T(S,"mdn-links/data/web-api.json"),"utf-8"));function u(e,t,r=0){if(!e)return;let o=e[t[r].path];if(!o&&t[r].path.endsWith("Constructor")&&(o=e[t[r].path.replace(/Constructor$/,"")]),typeof o=="string")return r===t.length-1?o:void 0;if(typeof o=="object"){if(r===t.length-1)return o.url;switch(t[r+1].navigation){case"#":case"~":return u(o.inst,t,r+1);case".":return u(o.stat,t,r+1)||u(o.inst,t,r+1)}}}function m(e){return u(P,e)}var x=["typescript","@types/web","@webgpu/types"];function q(e){let t=new Set;e.options.addDeclaration({name:"resolveUtilityTypes",defaultValue:!0,help:"[typedoc-plugin-mdn-links]: Resolve references to Partial, Omit, etc to the TypeScript website.",type:h.Boolean}),e.options.addDeclaration({name:"additionalModuleSources",help:"[typedoc-plugin-mdn-links]: Additional module sources to resolve.",type:h.Array,defaultValue:[]});let r=[m];function o(n){for(let s of r){let i=s(n);if(i)return i}}e.converter.on(k.EVENT_BEGIN,()=>{e.options.getValue("resolveUtilityTypes")&&r.push(d)}),e.converter.addUnknownSymbolResolver(l);function l(n,s,i,a){return y(a?A(a):n)}function y(n){let s=[...e.options.getValue("additionalModuleSources"),...x],i=n.moduleSource;if(i&&s.includes(i)||!i&&n.resolutionStart==="global"){let a=n.symbolReference?.path;if(!a)return;let p=N(a),c=o(a);return!c&&!t.has(p)&&(t.add(p),e.logger.verbose(`[typedoc-plugin-mdn-links]: Failed to resolve type: ${p}`)),c&&{target:c,caption:p}}}}function N(e){let t=e[0].path;for(let r of e.slice(1))t+=r.navigation+r.path;return t}function A(e){return O(e.toDeclarationReference())}function O(e){return e.resolutionStart==="global"&&e.symbolReference?.path?.[0].path==="__global"?{...e,symbolReference:{...e.symbolReference,path:e.symbolReference.path.slice(1)}}:e}export{q as load};
