source.d.ts 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. /** https://github.com/gedoor/legado/tree/master/app/src/main/java/io/legado/app/data/entities */
  2. type BaseSource = {
  3. /**
  4. * 并发率
  5. */
  6. concurrentRate?: string
  7. /**
  8. * 登录地址
  9. */
  10. loginUrl?: string
  11. /**
  12. * 登录UI
  13. */
  14. loginUi?: string
  15. /**
  16. * 请求头
  17. */
  18. header?: string
  19. /**
  20. * 启用cookieJar
  21. */
  22. enabledCookieJar?: boolean
  23. /**
  24. * js库
  25. */
  26. jsLib?: string
  27. }
  28. type BookSoure = BaseSource & {
  29. // 地址,包括 http/https
  30. bookSourceUrl: string
  31. // 名称
  32. bookSourceName: string
  33. // 分组
  34. bookSourceGroup?: string
  35. // 类型,0 文本,1 音频, 2 图片, 3 文件(指的是类似知轩藏书只提供下载的网站)
  36. bookSourceType: number
  37. // 详情页url正则
  38. bookUrlPattern?: string
  39. // 手动排序编号
  40. customOrder: number
  41. // 是否启用
  42. enabled: boolean
  43. // 启用发现
  44. enabledExplore: boolean
  45. // 登录检测js
  46. loginCheckJs?: string
  47. // 封面解密js
  48. coverDecodeJs?: string
  49. // 注释
  50. bookSourceComment?: string
  51. // 自定义变量说明
  52. variableComment?: string
  53. // 最后更新时间,用于排序
  54. lastUpdateTime: number
  55. // 响应时间,用于排序
  56. respondTime: number
  57. // 智能排序的权重
  58. weight: number
  59. // 发现url
  60. exploreUrl?: string
  61. // 发现筛选规则
  62. exploreScreen?: string
  63. // 发现规则
  64. ruleExplore?: ExploreRule
  65. // 搜索url
  66. searchUrl?: string
  67. // 搜索规则
  68. ruleSearch?: SearchRule
  69. // 书籍信息页规则
  70. ruleBookInfo?: BookInfoRule
  71. // 目录页规则
  72. ruleToc?: TocRule
  73. // 正文页规则
  74. ruleContent?: ContentRule
  75. // 段评规则
  76. ruleReview?: ReviewRule
  77. }
  78. type RuleSearch = {
  79. checkKeyWord?: string
  80. [prop: string]: string
  81. }
  82. /* type ExploreRule = {
  83. [prop:string]: string
  84. }
  85. type BookInfoRule = {
  86. [prop:string]: string
  87. }
  88. type TocRule = {
  89. [prop:string]: string
  90. }
  91. type ContentRule = {
  92. [prop:string]: string
  93. }
  94. type ReviewRule = {
  95. [prop:string]: string
  96. } */
  97. type RssSource = BaseSource & {
  98. sourceUrl: string
  99. // 名称
  100. sourceName: string
  101. // 图标
  102. sourceIcon: string
  103. // 分组
  104. sourceGroup?: string
  105. // 注释
  106. sourceComment?: string
  107. // 是否启用
  108. enabled: boolean
  109. // 自定义变量说明
  110. variableComment?: string
  111. /**登录检测js**/
  112. loginCheckJs?: string
  113. /**封面解密js**/
  114. coverDecodeJs?: string
  115. /**分类Url**/
  116. sortUrl?: string
  117. /**是否单url源**/
  118. singleUrl: boolean
  119. /*列表规则*/
  120. /**列表样式,0,1,2**/
  121. articleStyle: number
  122. /**列表规则**/
  123. ruleArticles?: string
  124. /**下一页规则**/
  125. ruleNextPage?: string
  126. /**标题规则**/
  127. ruleTitle?: string
  128. /**发布日期规则**/
  129. rulePubDate?: string
  130. /*webView规则*/
  131. /**描述规则**/
  132. ruleDescription?: string
  133. /**图片规则**/
  134. ruleImage?: string
  135. /**链接规则**/
  136. ruleLink?: string
  137. /**正文规则**/
  138. ruleContent?: string
  139. /**正文url白名单**/
  140. contentWhitelist?: string
  141. /**正文url黑名单**/
  142. contentBlacklist?: string
  143. /**
  144. * 跳转url拦截,
  145. * js, 返回true拦截,js变量url,可以通过js打开url,比如调用阅读搜索,添加书架等,简化规则写法,不用webView js注入
  146. * **/
  147. shouldOverrideUrlLoading?: string
  148. /**webView样式**/
  149. style?: string
  150. enableJs: boolean
  151. loadWithBaseUrl: boolean
  152. /**注入js**/
  153. injectJs?: string
  154. /*其它规则*/
  155. /**最后更新时间,用于排序**/
  156. lastUpdateTime: number
  157. customOrder: number
  158. }
  159. type Source = BookSoure | RssSource
  160. export { Source, BookSoure, RssSource }