@i.un/libs 0.0.63 → 1.0.0

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.
@@ -1,2 +1,3 @@
1
- export * from './api';
2
- export * from './dom';
1
+ export * from "./api";
2
+ export * from "./dom";
3
+ export * from "./utils";
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Checks if the given URL is a LinkedIn URL.
3
+ * @param url - The URL string to check.
4
+ * @returns true if the URL is a LinkedIn URL, false otherwise.
5
+ */
6
+ export declare function isLinkedInUrl(url: string): boolean;
7
+ /** 表示各种 LinkedIn 页面类型的类型。 */
8
+ export type PageType = "profile" | "feed" | "post" | "company" | "login" | "messages" | "search-all" | "search-people" | "connections" | "chrome" | "chrome-extension" | "view-source" | "";
9
+ /** 将页面类型映射到数值。 */
10
+ export declare const pageTypeMap: Record<string, number>;
11
+ /**
12
+ * 根据 URL 确定 LinkedIn 页面的类型。
13
+ * @param url - 要分析的 URL。默认为空字符串。
14
+ * @returns 页面类型字符串。
15
+ */
16
+ export declare function getLinkedinPageType(url?: string): "" | "company" | "profile" | "feed" | "post" | "login" | "messages" | "search-all" | "search-people" | "connections";
17
+ /**
18
+ * 从 LinkedIn 个人资料 URL 中提取公共 ID。
19
+ * @param url - 要从中提取的 URL。默认为当前页面 URL。
20
+ * @returns 公共 ID 字符串,如果未找到则为空字符串。
21
+ */
22
+ export declare function getProfilePublicId(url?: string): string;
23
+ /**
24
+ * 从 LinkedIn 帖子 URL 中提取公共 ID。
25
+ * @param url - 要从中提取的 URL。默认为当前页面 URL。
26
+ * @returns 公共 ID 字符串,如果未找到则为空字符串。
27
+ */
28
+ export declare function getPostPublicId(url?: string): string;
29
+ /**
30
+ * 从 LinkedIn 公司 URL 中提取公共 ID。
31
+ * @param url - 要从中提取的 URL。默认为当前页面 URL。
32
+ * @returns 公共 ID 字符串,如果未找到则为空字符串。
33
+ */
34
+ export declare function getCompanyPublicId(url?: string): string;
35
+ /**
36
+ * 从 LinkedIn URL 中提取公共 ID,尝试个人资料或公司。
37
+ * @param url - 要从中提取的 URL。默认为当前页面 URL。
38
+ * @returns 公共 ID 字符串,如果未找到则为空字符串。
39
+ */
40
+ export declare function getLinkedinPublicId(url?: string): string;
41
+ /**
42
+ * 确定页面类型,检查协议或 LinkedIn 页面类型。
43
+ * @param url - 要分析的 URL。
44
+ * @returns 页面类型字符串。
45
+ */
46
+ export declare function getPageType(url?: string): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@i.un/libs",
3
- "version": "0.0.63",
3
+ "version": "1.0.0",
4
4
  "description": "一个实用的ts函数库",
5
5
  "type": "module",
6
6
  "source": "src/index.ts",
@@ -49,4 +49,4 @@
49
49
  "type": "git",
50
50
  "url": "git+https://github.com/zhyswan/libs.git"
51
51
  }
52
- }
52
+ }