File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,9 @@ function resolveTypeName(type?: SomeType | null | undefined): string | null {
4646 if ( type . package === "@atproto/api" ) {
4747 return resolveAtprotoLexiconTypeName ( type ) ;
4848 }
49+ if ( type . package ?. startsWith ( "@atcute/" ) && type . symbolId ?. fileName . endsWith ( "lexicons.d.ts" ) ) {
50+ return type . qualifiedName ;
51+ }
4952 if ( type . package === "quick-lru" && type . name === "default" ) {
5053 return "QuickLRU" ;
5154 }
Original file line number Diff line number Diff line change @@ -69,6 +69,19 @@ function resolveAtprotoTypeUrl(type: ReferenceType): string | null {
6969 return null ;
7070}
7171
72+ function resolveAtcuteTypeUrl ( type : ReferenceType ) : string | null {
73+ if ( ! type . qualifiedName ) return null ;
74+
75+ const lexiconPath = type . qualifiedName . split ( "." ) . shift ( ) ?. split ( / (? = [ A - Z ] ) / ) . reduce ( ( acc , part , i ) => {
76+ if ( i < 3 ) return acc + part . toLowerCase ( ) + "/" ;
77+ if ( i === 3 ) return acc + part . toLowerCase ( ) ;
78+ return acc + part ;
79+ } , "" ) ;
80+ if ( ! lexiconPath ) return null ;
81+
82+ return `https://github.com/bluesky-social/atproto/tree/main/lexicons/${ lexiconPath } .json` ;
83+ }
84+
7285export function resolveSourceUrl ( reflection : Reflection & { sources ?: Array < SourceReference > } ) {
7386 const source = reflection . sources ?. [ 0 ] ;
7487 if ( ! source ) return null ;
@@ -93,6 +106,9 @@ export function resolveTypeUrl(type?: SomeType | null | undefined): string | nul
93106 if ( type . package === "@atproto/api" ) {
94107 return resolveAtprotoTypeUrl ( type ) ;
95108 }
109+ if ( type . package ?. startsWith ( "@atcute/" ) && type . symbolId ?. fileName . endsWith ( "lexicons.d.ts" ) ) {
110+ return resolveAtcuteTypeUrl ( type ) ;
111+ }
96112 return null ;
97113}
98114
You can’t perform that action at this time.
0 commit comments