@libs-ui/components-preview-text-data 0.2.357-2 → 0.2.357-20

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.
@@ -20,6 +20,18 @@ export declare const languageRegistry: Record<string, I_LanguageRegistryItem>;
20
20
  * Chặn các API nguy hiểm: eval, network calls, storage, DOM injection...
21
21
  */
22
22
  export declare const DEFAULT_SECURITY_PATTERNS: T_ForbiddenPattern[];
23
+ /**
24
+ * Các key của AST node KHÔNG phải node con (metadata vị trí, comment...) — bỏ qua khi duyệt.
25
+ */
26
+ export declare const astSkipKeys: Set<string>;
27
+ /**
28
+ * Các key chứa annotation kiểu TypeScript → con của nó nằm trong "type context" (không phải biến giá trị).
29
+ */
30
+ export declare const astTypeKeys: Set<string>;
31
+ /**
32
+ * Các node `TS*` mang GIÁ TRỊ (không phải type thuần) → con của chúng vẫn là biến giá trị bình thường.
33
+ */
34
+ export declare const tsValueNodes: Set<string>;
23
35
  /**
24
36
  * Tạo default language extension cho plain text
25
37
  * Sử dụng khi ngôn ngữ không được hỗ trợ
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Type structural tối thiểu cho AST node của `@babel/parser` (plain object, browser-safe).
3
+ *
4
+ * KHÔNG dùng `@babel/traverse` để resolve scope vì nó phụ thuộc `process` của Node → crash trên
5
+ * browser (`ReferenceError: process is not defined`). Thay vào đó tự duyệt AST (chỉ là object
6
+ * thuần). Type này chỉ khai báo các thuộc tính được dùng trong bộ duyệt semantic linter; phần
7
+ * còn lại truy cập qua index signature.
8
+ */
9
+ export type T_AstNode = {
10
+ type: string;
11
+ end?: number;
12
+ name?: string;
13
+ computed?: boolean;
14
+ id?: T_AstNode | null;
15
+ param?: T_AstNode | null;
16
+ parameter?: T_AstNode;
17
+ argument?: T_AstNode;
18
+ left?: T_AstNode;
19
+ value?: T_AstNode;
20
+ local?: {
21
+ name?: string;
22
+ };
23
+ params?: T_AstNode[];
24
+ properties?: T_AstNode[];
25
+ elements?: Array<T_AstNode | null>;
26
+ loc?: {
27
+ start: {
28
+ line: number;
29
+ column: number;
30
+ };
31
+ } | null;
32
+ [key: string]: unknown;
33
+ };