@candriajs/git-neko-kit 1.1.0 → 1.1.1

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.
package/dist/index.d.ts CHANGED
@@ -25,9 +25,7 @@ declare enum ProxyProtocol {
25
25
  /** HTTPS */
26
26
  HTTPS = "https",
27
27
  /** SOCKS */
28
- SOCKS = "socks",
29
- /** SOCKS5 */
30
- SOCKS5 = "socks5"
28
+ SOCKS = "socks"
31
29
  }
32
30
  /**
33
31
  * 基本代理配置
@@ -38,7 +36,7 @@ interface BaseProxyType<T extends ProxyType | ProxyProtocol> {
38
36
  address: ProxyUrlType;
39
37
  }
40
38
  /** 代理配置参数类型 */
41
- type ProxyParamsType = BaseProxyType<ProxyProtocol.HTTP> | BaseProxyType<ProxyProtocol.HTTPS> | BaseProxyType<ProxyProtocol.SOCKS> | BaseProxyType<ProxyProtocol.SOCKS5> | BaseProxyType<ProxyType.Common> | BaseProxyType<ProxyType.Reverse>;
39
+ type ProxyParamsType = BaseProxyType<ProxyProtocol.HTTP> | BaseProxyType<ProxyProtocol.HTTPS> | BaseProxyType<ProxyProtocol.SOCKS> | BaseProxyType<ProxyType.Common> | BaseProxyType<ProxyType.Reverse>;
42
40
 
43
41
  /** 本地Git仓库信息 */
44
42
  interface GitRepoInfoType {
@@ -2080,19 +2078,18 @@ declare function get_remote_repo_default_branch(remote_url: string): Promise<str
2080
2078
  * 2. 有序列表项2
2081
2079
  * `);
2082
2080
  *
2083
- * // 输出结果:
2084
- * // <h1>标题</h1>
2085
- * // <ul style="list-style: none;">
2086
- * // <li>无序列表项1</li>
2087
- * // <li>无序列表项2</li>
2088
- * // <ul style="list-style: none;">
2089
- * // <li>子列表项</li>
2090
- * // </ul>
2091
- * // </ul>
2092
- * // <ol style="list-style: none;">
2093
- * // <li>有序列表项1</li>
2094
- * // <li>有序列表项2</li>
2095
- * // </ol>
2081
+ * -> <h1>标题</h1>
2082
+ * <ul style="list-style: none;">
2083
+ * <li>无序列表项1</li>
2084
+ * <li>无序列表项2</li>
2085
+ * <ul style="list-style: none;">
2086
+ * <li>子列表项</li>
2087
+ * </ul>
2088
+ * </ul>
2089
+ * <ol style="list-style: none;">
2090
+ * <li>有序列表项1</li>
2091
+ * <li>有序列表项2</li>
2092
+ * </ol>
2096
2093
  * ```
2097
2094
  */
2098
2095
  declare function render_markdown(md: string): Promise<string>;
@@ -2158,15 +2155,24 @@ declare function format_date(dateString: string, locale?: string, format?: strin
2158
2155
  /**
2159
2156
  * 获取相对时间
2160
2157
  * @param dateString - 日期字符串
2161
- * @param locale - 语言环境,默认为 'zh-cn'
2162
- * @returns 相对时间
2158
+ * @param options - 可选参数对象
2159
+ * @param options.locale - 语言环境,默认为 'zh-cn'
2160
+ * @param options.useAbsoluteIfOver30Days - 是否在超过30天时返回绝对时间
2161
+ * @returns 相对时间或绝对时间
2163
2162
  * @example
2164
- * ```ta
2163
+ * ```ts
2165
2164
  * console.log(await get_relative_time('2023-04-01 12:00:00'))
2166
- * -> 1 小时前
2165
+ * -> "1 小时前"
2166
+ *
2167
+ * // 如果当前时间距离该日期已超过30天,则返回绝对时间
2168
+ * console.log(await get_relative_time('2023-01-01 12:00:00', { useAbsoluteIfOver30Days: true }))
2169
+ * -> "2025-07-01 13:00:00"
2167
2170
  * ```
2168
2171
  */
2169
- declare function get_relative_time(dateString: string, locale?: string): Promise<string>;
2172
+ declare function get_relative_time(dateString: string, options?: {
2173
+ locale?: string;
2174
+ useAbsoluteIfOver30Days?: boolean;
2175
+ }): Promise<string>;
2170
2176
  /**
2171
2177
  * 根据语言名称获取对应的颜色值
2172
2178
  * @param language - 语言名称