lokal-react 1.2.1 → 1.3.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/package.json +2 -2
- package/src/types/lokal-core.d.ts +30 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lokal-react",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "React & React Native adapter for LOKAL - Hooks and Context Providers",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"lint": "echo 'Use root lint command'"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"lokal-core": "
|
|
25
|
+
"lokal-core": "file:../core"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/node": "^20.10.0",
|
|
@@ -29,6 +29,36 @@ declare module 'lokal-core' {
|
|
|
29
29
|
componentName?: string;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
export interface WrapOptions {
|
|
33
|
+
functionName?: string;
|
|
34
|
+
componentName?: string;
|
|
35
|
+
excludePatterns?: RegExp[];
|
|
36
|
+
keyPrefix?: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface WrappedString {
|
|
40
|
+
original: string;
|
|
41
|
+
wrapped: string;
|
|
42
|
+
key: string;
|
|
43
|
+
line: number;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface WrapResult {
|
|
47
|
+
file: string;
|
|
48
|
+
wrapped: WrappedString[];
|
|
49
|
+
errors: string[];
|
|
50
|
+
modified: boolean;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export class ASTWrapper {
|
|
54
|
+
constructor(options?: WrapOptions);
|
|
55
|
+
generateKey(text: string, filePath: string): string;
|
|
56
|
+
shouldExclude(text: string): boolean;
|
|
57
|
+
wrapFile(filePath: string): WrapResult;
|
|
58
|
+
wrapContent(content: string, filePath?: string): WrapResult;
|
|
59
|
+
wrapDirectory(dirPath: string, extensions?: string[], dryRun?: boolean): { results: WrapResult[], modifiedFiles: number };
|
|
60
|
+
}
|
|
61
|
+
|
|
32
62
|
export class ConfigLoader {
|
|
33
63
|
load(configPath?: string): Promise<LokalConfig>;
|
|
34
64
|
loadSync(configPath?: string): LokalConfig;
|