zcw-shared 1.3.0 → 1.5.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.
- package/README.md +223 -50
- package/dist/constants/colorPatterns.d.ts +2 -0
- package/dist/constants/colorPatterns.js +9 -0
- package/dist/constants/colorPatterns.js.map +1 -0
- package/dist/constants/namedColors.d.ts +2 -0
- package/dist/constants/namedColors.js +17 -0
- package/dist/constants/namedColors.js.map +1 -0
- package/dist/constants/softwareConfigs.d.ts +15 -0
- package/dist/constants/softwareConfigs.js +157 -0
- package/dist/constants/softwareConfigs.js.map +1 -0
- package/dist/functions/ag-grid/generateLicense.d.ts +1 -2
- package/dist/functions/ag-grid/generateLicense.js +2 -2
- package/dist/functions/ag-grid/generateLicense.js.map +1 -1
- package/dist/functions/altool/createAltoolClient.js +4 -10
- package/dist/functions/altool/createAltoolClient.js.map +1 -1
- package/dist/functions/altool/getAltoolAuth.d.ts +2 -0
- package/dist/functions/altool/getAltoolAuth.js +8 -0
- package/dist/functions/altool/getAltoolAuth.js.map +1 -0
- package/dist/functions/altool/getAppInfo.js +1 -54
- package/dist/functions/altool/getAppInfo.js.map +1 -1
- package/dist/functions/altool/parseAppInfoOutput.d.ts +2 -0
- package/dist/functions/altool/parseAppInfoOutput.js +55 -0
- package/dist/functions/altool/parseAppInfoOutput.js.map +1 -0
- package/dist/functions/altool/parseValidationOutput.d.ts +6 -0
- package/dist/functions/altool/parseValidationOutput.js +21 -0
- package/dist/functions/altool/parseValidationOutput.js.map +1 -0
- package/dist/functions/altool/validateApp.js +2 -21
- package/dist/functions/altool/validateApp.js.map +1 -1
- package/dist/functions/color/convertColor.d.ts +6 -0
- package/dist/functions/color/convertColor.js +308 -0
- package/dist/functions/color/convertColor.js.map +1 -0
- package/dist/functions/color/deduplicateColors.d.ts +4 -0
- package/dist/functions/color/deduplicateColors.js +55 -0
- package/dist/functions/color/deduplicateColors.js.map +1 -0
- package/dist/functions/color/detectColorFormat.d.ts +2 -0
- package/dist/functions/color/detectColorFormat.js +112 -0
- package/dist/functions/color/detectColorFormat.js.map +1 -0
- package/dist/functions/color/extractColors.d.ts +4 -0
- package/dist/functions/color/extractColors.js +98 -0
- package/dist/functions/color/extractColors.js.map +1 -0
- package/dist/functions/color-converter/convertColor.js +4 -230
- package/dist/functions/color-converter/convertColor.js.map +1 -1
- package/dist/functions/color-converter/createColorReference.d.ts +2 -0
- package/dist/functions/color-converter/createColorReference.js +12 -0
- package/dist/functions/color-converter/createColorReference.js.map +1 -0
- package/dist/functions/color-converter/extractColors.d.ts +2 -15
- package/dist/functions/color-converter/extractColors.js +9 -104
- package/dist/functions/color-converter/extractColors.js.map +1 -1
- package/dist/functions/color-converter/extractColorsFromLine.d.ts +2 -0
- package/dist/functions/color-converter/extractColorsFromLine.js +18 -0
- package/dist/functions/color-converter/extractColorsFromLine.js.map +1 -0
- package/dist/functions/color-converter/extractColorsGeneric.d.ts +2 -0
- package/dist/functions/color-converter/extractColorsGeneric.js +12 -0
- package/dist/functions/color-converter/extractColorsGeneric.js.map +1 -0
- package/dist/functions/color-converter/extractCssVariableReferences.d.ts +2 -0
- package/dist/functions/color-converter/extractCssVariableReferences.js +15 -0
- package/dist/functions/color-converter/extractCssVariableReferences.js.map +1 -0
- package/dist/functions/color-converter/extractThirdPartyVariableReferences.d.ts +2 -0
- package/dist/functions/color-converter/extractThirdPartyVariableReferences.js +15 -0
- package/dist/functions/color-converter/extractThirdPartyVariableReferences.js.map +1 -0
- package/dist/functions/color-converter/formatColorOutput.d.ts +5 -0
- package/dist/functions/color-converter/formatColorOutput.js +48 -0
- package/dist/functions/color-converter/formatColorOutput.js.map +1 -0
- package/dist/functions/color-converter/hslToRgbInternal.d.ts +2 -0
- package/dist/functions/color-converter/hslToRgbInternal.js +24 -0
- package/dist/functions/color-converter/hslToRgbInternal.js.map +1 -0
- package/dist/functions/color-converter/isValidColorValue.d.ts +1 -0
- package/dist/functions/color-converter/isValidColorValue.js +4 -0
- package/dist/functions/color-converter/isValidColorValue.js.map +1 -0
- package/dist/functions/color-converter/isValidHslColor.d.ts +2 -0
- package/dist/functions/color-converter/isValidHslColor.js +14 -0
- package/dist/functions/color-converter/isValidHslColor.js.map +1 -0
- package/dist/functions/color-converter/isValidRgbColor.d.ts +2 -0
- package/dist/functions/color-converter/isValidRgbColor.js +14 -0
- package/dist/functions/color-converter/isValidRgbColor.js.map +1 -0
- package/dist/functions/color-converter/normalizeColorInput.d.ts +6 -0
- package/dist/functions/color-converter/normalizeColorInput.js +94 -0
- package/dist/functions/color-converter/normalizeColorInput.js.map +1 -0
- package/dist/functions/color-converter/parseColorString.d.ts +0 -3
- package/dist/functions/color-converter/parseColorString.js +0 -27
- package/dist/functions/color-converter/parseColorString.js.map +1 -1
- package/dist/functions/color-converter/parseCssVariables.d.ts +2 -0
- package/dist/functions/color-converter/parseCssVariables.js +19 -0
- package/dist/functions/color-converter/parseCssVariables.js.map +1 -0
- package/dist/functions/color-converter/parseHexColor.d.ts +6 -0
- package/dist/functions/color-converter/parseHexColor.js +42 -0
- package/dist/functions/color-converter/parseHexColor.js.map +1 -0
- package/dist/functions/color-converter/rgbToHslInternal.d.ts +2 -0
- package/dist/functions/color-converter/rgbToHslInternal.js +31 -0
- package/dist/functions/color-converter/rgbToHslInternal.js.map +1 -0
- package/dist/functions/css/extractCssVariables.d.ts +12 -0
- package/dist/functions/css/extractCssVariables.js +53 -0
- package/dist/functions/css/extractCssVariables.js.map +1 -0
- package/dist/functions/dom/detectOverflow.js.map +1 -1
- package/dist/functions/dom/getElementRect.js.map +1 -1
- package/dist/functions/dom/getRelativePosition.js.map +1 -1
- package/dist/functions/dom/getViewportRect.js.map +1 -1
- package/dist/functions/dom/getViewportSize.js.map +1 -1
- package/dist/functions/image/generateMacIcons.js.map +1 -1
- package/dist/functions/image/generateMacTrayIcon.js.map +1 -1
- package/dist/functions/image/generatePaddedImage.js.map +1 -1
- package/dist/functions/image/generatePwaIcons.js.map +1 -1
- package/dist/functions/image/generateRoundedImage.js.map +1 -1
- package/dist/functions/ipc/dispatchIpcRequest.js +1 -1
- package/dist/functions/ipc/dispatchIpcRequest.js.map +1 -1
- package/dist/functions/software/buildPathExecutables.js +11 -1
- package/dist/functions/software/buildPathExecutables.js.map +1 -1
- package/dist/functions/software/buildSoftwarePaths.d.ts +1 -1
- package/dist/functions/software/createConfigGenerator.d.ts +1 -1
- package/dist/functions/software/detectPlatform.d.ts +1 -1
- package/dist/functions/software/detectPlatform.js +6 -1
- package/dist/functions/software/detectPlatform.js.map +1 -1
- package/dist/functions/software/find.js +1 -1
- package/dist/functions/software/find.js.map +1 -1
- package/dist/functions/software/findSoftware.d.ts +1 -2
- package/dist/functions/software/findSoftware.js +33 -19
- package/dist/functions/software/findSoftware.js.map +1 -1
- package/dist/functions/software/findSoftwareWithGenerator.d.ts +1 -1
- package/dist/functions/software/getConfigGenerator.d.ts +1 -1
- package/dist/functions/software/getEnvironmentSoftwarePath.js +5 -1
- package/dist/functions/software/getEnvironmentSoftwarePath.js.map +1 -1
- package/dist/functions/software/parseEnvironmentPaths.js +6 -2
- package/dist/functions/software/parseEnvironmentPaths.js.map +1 -1
- package/dist/functions/string/base64.d.ts +2 -0
- package/dist/functions/string/base64.js +6 -0
- package/dist/functions/string/base64.js.map +1 -0
- package/dist/functions/string/caseConverter.d.ts +20 -0
- package/dist/functions/string/caseConverter.js +101 -0
- package/dist/functions/string/caseConverter.js.map +1 -0
- package/dist/functions/string/desensitize.d.ts +13 -0
- package/dist/functions/string/desensitize.js +107 -0
- package/dist/functions/string/desensitize.js.map +1 -0
- package/dist/functions/string/htmlEscape.d.ts +17 -0
- package/dist/functions/string/htmlEscape.js +68 -0
- package/dist/functions/string/htmlEscape.js.map +1 -0
- package/dist/functions/string/pad.d.ts +14 -0
- package/dist/functions/string/pad.js +53 -0
- package/dist/functions/string/pad.js.map +1 -0
- package/dist/functions/string/similarity.js +1 -26
- package/dist/functions/string/similarity.js.map +1 -1
- package/dist/functions/tencent-cloud/getSecret.d.ts +1 -2
- package/dist/functions/tencent-cloud/getSecret.js +2 -3
- package/dist/functions/tencent-cloud/getSecret.js.map +1 -1
- package/dist/functions/uniapp/app-plus/androidProjectStrategy.d.ts +6 -20
- package/dist/functions/uniapp/app-plus/androidProjectStrategy.js +43 -48
- package/dist/functions/uniapp/app-plus/androidProjectStrategy.js.map +1 -1
- package/dist/functions/uniapp/app-plus/buildAndroidProject.js +2 -2
- package/dist/functions/uniapp/app-plus/buildAndroidProject.js.map +1 -1
- package/dist/functions/uniapp/app-plus/configureAndroidProject.js +2 -2
- package/dist/functions/uniapp/app-plus/configureAndroidProject.js.map +1 -1
- package/dist/functions/uniapp/waitForPages.d.ts +1 -1
- package/dist/functions/uniapp/waitForPages.js +3 -2
- package/dist/functions/uniapp/waitForPages.js.map +1 -1
- package/dist/functions/utils/flow.d.ts +1 -1
- package/dist/functions/utils/flow.js +5 -1
- package/dist/functions/utils/flow.js.map +1 -1
- package/dist/functions/vue/checkVueType.d.ts +8 -0
- package/dist/functions/vue/checkVueType.js +29 -0
- package/dist/functions/vue/checkVueType.js.map +1 -0
- package/dist/functions/vue/deduplicateColors.d.ts +2 -0
- package/dist/functions/vue/deduplicateColors.js +13 -0
- package/dist/functions/vue/deduplicateColors.js.map +1 -0
- package/dist/functions/vue/extractColorsFromVueFile.d.ts +3 -0
- package/dist/functions/vue/extractColorsFromVueFile.js +27 -0
- package/dist/functions/vue/extractColorsFromVueFile.js.map +1 -0
- package/dist/functions/vue/extractColorsFromVueSection.d.ts +3 -0
- package/dist/functions/vue/extractColorsFromVueSection.js +53 -0
- package/dist/functions/vue/extractColorsFromVueSection.js.map +1 -0
- package/dist/functions/vue/filterSections.d.ts +2 -0
- package/dist/functions/vue/filterSections.js +11 -0
- package/dist/functions/vue/filterSections.js.map +1 -0
- package/dist/functions/vue/parseVueFile.d.ts +2 -0
- package/dist/functions/vue/parseVueFile.js +53 -0
- package/dist/functions/vue/parseVueFile.js.map +1 -0
- package/dist/functions/vue/processVueFile.d.ts +3 -0
- package/dist/functions/vue/processVueFile.js +26 -0
- package/dist/functions/vue/processVueFile.js.map +1 -0
- package/dist/functions/vue/saveVueSection.d.ts +2 -0
- package/dist/functions/vue/saveVueSection.js +11 -0
- package/dist/functions/vue/saveVueSection.js.map +1 -0
- package/dist/hooks/useAltool.d.ts +68 -0
- package/dist/hooks/useAltool.js +350 -0
- package/dist/hooks/useAltool.js.map +1 -0
- package/package.json +26 -44
- package/types/color.d.ts +30 -3
- package/types/geometry.d.ts +3 -1
- package/types/software.d.ts +27 -0
- package/types/vue.d.ts +30 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"waitForPages.js","sourceRoot":"","sources":["../../../src/functions/uniapp/waitForPages.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"waitForPages.js","sourceRoot":"","sources":["../../../src/functions/uniapp/waitForPages.ts"],"names":[],"mappings":"AAiCA,MAAM,UAAU,YAAY,CAAC,MAAiB,EAAE,KAAe,EAAE,OAAO,GAAG,IAAI;IAC7E,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAE7B,MAAM,UAAU,GAAG,GAAG,EAAE;YACtB,MAAM,KAAK,GAAG,MAAM,CAAC,eAAe,EAAE,CAAC;YAEvC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACrB,OAAO,CAAC,KAAK,CAAC,CAAC;gBACf,OAAO;YACT,CAAC;YAGD,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,GAAG,OAAO,EAAE,CAAC;gBACrC,MAAM,CAAC,IAAI,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;gBAC7B,OAAO;YACT,CAAC;YAGD,KAAK,CAAC,UAAU,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;QACpC,CAAC,CAAC;QAEF,UAAU,EAAE,CAAC;IACf,CAAC,CAAC,CAAC;AACL,CAAC;AAAA,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function flow<T>(functions: Array<(arg: T) => T | Promise<T>>): (arg: T) =>
|
|
1
|
+
export declare function flow<T>(...functions: Array<(arg: T) => T | Promise<T>>): (arg: T) => Promise<T>;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
export function flow(functions) {
|
|
1
|
+
export function flow(...functions) {
|
|
2
|
+
if (functions.length === 0)
|
|
3
|
+
return async (arg) => arg;
|
|
4
|
+
if (functions.length === 1)
|
|
5
|
+
return async (arg) => await functions[0](arg);
|
|
2
6
|
return async (arg) => {
|
|
3
7
|
let result = arg;
|
|
4
8
|
for (const fn of functions) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow.js","sourceRoot":"","sources":["../../../src/functions/utils/flow.ts"],"names":[],"mappings":"AA2BA,MAAM,UAAU,IAAI,CAAI,SAA4C;
|
|
1
|
+
{"version":3,"file":"flow.js","sourceRoot":"","sources":["../../../src/functions/utils/flow.ts"],"names":[],"mappings":"AA2BA,MAAM,UAAU,IAAI,CAAI,GAAG,SAA4C;IACrE,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,KAAK,EAAE,GAAM,EAAE,EAAE,CAAC,GAAG,CAAA;IACxD,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,KAAK,EAAE,GAAM,EAAE,EAAE,CAAC,MAAM,SAAS,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;IAE5E,OAAO,KAAK,EAAE,GAAM,EAAc,EAAE;QAClC,IAAI,MAAM,GAAM,GAAG,CAAA;QAEnB,KAAK,MAAM,EAAE,IAAI,SAAS,EAAE,CAAC;YAC3B,MAAM,GAAG,MAAM,EAAE,CAAC,MAAM,CAAC,CAAA;QAC3B,CAAC;QAED,OAAO,MAAM,CAAA;IACf,CAAC,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Component, VNode } from '../../../references/vue.d';
|
|
2
|
+
export type VueTypeCheckResult = {
|
|
3
|
+
isComponent: boolean;
|
|
4
|
+
isVNode: boolean;
|
|
5
|
+
type: 'component' | 'vnode' | 'unknown';
|
|
6
|
+
};
|
|
7
|
+
export declare function checkVueType(content: unknown): VueTypeCheckResult;
|
|
8
|
+
export declare function isVueRelated(content: unknown): content is Component | VNode;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export function checkVueType(content) {
|
|
2
|
+
const isComponent = (typeof content === 'object' &&
|
|
3
|
+
content !== null &&
|
|
4
|
+
('render' in content || 'setup' in content || 'template' in content));
|
|
5
|
+
const isVNodeResult = (typeof content === 'object' && content !== null && '__v_isVNode' in content);
|
|
6
|
+
let type;
|
|
7
|
+
if (isComponent) {
|
|
8
|
+
type = 'component';
|
|
9
|
+
}
|
|
10
|
+
else if (isVNodeResult) {
|
|
11
|
+
type = 'vnode';
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
type = 'unknown';
|
|
15
|
+
}
|
|
16
|
+
return {
|
|
17
|
+
isComponent,
|
|
18
|
+
isVNode: isVNodeResult,
|
|
19
|
+
type
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export function isVueRelated(content) {
|
|
23
|
+
const isComponent = (typeof content === 'object' &&
|
|
24
|
+
content !== null &&
|
|
25
|
+
('render' in content || 'setup' in content || 'template' in content));
|
|
26
|
+
const isVNodeResult = (typeof content === 'object' && content !== null && '__v_isVNode' in content);
|
|
27
|
+
return isComponent || isVNodeResult;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=checkVueType.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkVueType.js","sourceRoot":"","sources":["../../../src/functions/vue/checkVueType.ts"],"names":[],"mappings":"AAgCA,MAAM,UAAU,YAAY,CAAC,OAAgB;IAE3C,MAAM,WAAW,GAAG,CAClB,OAAO,OAAO,KAAK,QAAQ;QAC3B,OAAO,KAAK,IAAI;QAChB,CAAC,QAAQ,IAAI,OAAO,IAAI,OAAO,IAAI,OAAO,IAAI,UAAU,IAAI,OAAO,CAAC,CACrE,CAAA;IAGD,MAAM,aAAa,GAAG,CACpB,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,IAAI,IAAI,aAAa,IAAI,OAAO,CAC5E,CAAA;IAED,IAAI,IAAuC,CAAA;IAC3C,IAAI,WAAW,EAAE,CAAC;QAChB,IAAI,GAAG,WAAW,CAAA;IACpB,CAAC;SAAM,IAAI,aAAa,EAAE,CAAC;QACzB,IAAI,GAAG,OAAO,CAAA;IAChB,CAAC;SAAM,CAAC;QACN,IAAI,GAAG,SAAS,CAAA;IAClB,CAAC;IAED,OAAO;QACL,WAAW;QACX,OAAO,EAAE,aAAa;QACtB,IAAI;KACL,CAAA;AACH,CAAC;AAOD,MAAM,UAAU,YAAY,CAAC,OAAgB;IAE3C,MAAM,WAAW,GAAG,CAClB,OAAO,OAAO,KAAK,QAAQ;QAC3B,OAAO,KAAK,IAAI;QAChB,CAAC,QAAQ,IAAI,OAAO,IAAI,OAAO,IAAI,OAAO,IAAI,UAAU,IAAI,OAAO,CAAC,CACrE,CAAA;IAED,MAAM,aAAa,GAAG,CACpB,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,IAAI,IAAI,aAAa,IAAI,OAAO,CAC5E,CAAA;IAED,OAAO,WAAW,IAAI,aAAa,CAAA;AACrC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export function deduplicateColors(colors) {
|
|
2
|
+
const seen = new Set();
|
|
3
|
+
const result = [];
|
|
4
|
+
for (const color of colors) {
|
|
5
|
+
const key = `${color.file}:${color.line}:${color.originalValue}`;
|
|
6
|
+
if (!seen.has(key)) {
|
|
7
|
+
seen.add(key);
|
|
8
|
+
result.push(color);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
return result;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=deduplicateColors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deduplicateColors.js","sourceRoot":"","sources":["../../../src/functions/vue/deduplicateColors.ts"],"names":[],"mappings":"AA0BA,MAAM,UAAU,iBAAiB,CAAC,MAAwB;IACxD,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAA;IAC9B,MAAM,MAAM,GAAqB,EAAE,CAAA;IAEnC,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,GAAG,GAAG,GAAG,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,aAAa,EAAE,CAAA;QAChE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YACnB,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;YACb,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QACpB,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { parseVueFile } from './parseVueFile';
|
|
2
|
+
import { extractColorsFromVueSection } from './extractColorsFromVueSection';
|
|
3
|
+
import { extractColors } from '../color/extractColors';
|
|
4
|
+
import { deduplicateColors } from '../color/deduplicateColors';
|
|
5
|
+
export function extractColorsFromVueFile(code, filePath, options = {}) {
|
|
6
|
+
const colors = [];
|
|
7
|
+
const globalColors = extractColors(code, filePath, { validOnly: options.validOnly });
|
|
8
|
+
const sections = parseVueFile(code);
|
|
9
|
+
const filteredSections = filterVueSections(sections, options);
|
|
10
|
+
for (const section of filteredSections) {
|
|
11
|
+
const sectionColors = extractColorsFromVueSection(section, filePath, options);
|
|
12
|
+
colors.push(...sectionColors);
|
|
13
|
+
}
|
|
14
|
+
const allColors = [...globalColors, ...colors];
|
|
15
|
+
return deduplicateColors(allColors);
|
|
16
|
+
}
|
|
17
|
+
function filterVueSections(sections, options) {
|
|
18
|
+
let filteredSections = sections;
|
|
19
|
+
if (options.includeSections && options.includeSections.length > 0) {
|
|
20
|
+
filteredSections = filteredSections.filter(section => options.includeSections.includes(section.type));
|
|
21
|
+
}
|
|
22
|
+
if (options.excludeSections && options.excludeSections.length > 0) {
|
|
23
|
+
filteredSections = filteredSections.filter(section => !options.excludeSections.includes(section.type));
|
|
24
|
+
}
|
|
25
|
+
return filteredSections;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=extractColorsFromVueFile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extractColorsFromVueFile.js","sourceRoot":"","sources":["../../../src/functions/vue/extractColorsFromVueFile.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAA;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAuB9D,MAAM,UAAU,wBAAwB,CACtC,IAAY,EACZ,QAAgB,EAChB,UAAgC,EAAE;IAElC,MAAM,MAAM,GAAqB,EAAE,CAAA;IAGnC,MAAM,YAAY,GAAG,aAAa,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC,CAAA;IAGpF,MAAM,QAAQ,GAAG,YAAY,CAAC,IAAI,CAAC,CAAA;IAGnC,MAAM,gBAAgB,GAAG,iBAAiB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;IAG7D,KAAK,MAAM,OAAO,IAAI,gBAAgB,EAAE,CAAC;QACvC,MAAM,aAAa,GAAG,2BAA2B,CAC/C,OAAO,EACP,QAAQ,EACR,OAAO,CACR,CAAA;QACD,MAAM,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,CAAA;IAC/B,CAAC;IAGD,MAAM,SAAS,GAAG,CAAC,GAAG,YAAY,EAAE,GAAG,MAAM,CAAC,CAAA;IAC9C,OAAO,iBAAiB,CAAC,SAAS,CAAC,CAAA;AACrC,CAAC;AAMD,SAAS,iBAAiB,CACxB,QAAsB,EACtB,OAA6B;IAE7B,IAAI,gBAAgB,GAAG,QAAQ,CAAA;IAG/B,IAAI,OAAO,CAAC,eAAe,IAAI,OAAO,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAClE,gBAAgB,GAAG,gBAAgB,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CACnD,OAAO,CAAC,eAAgB,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAChD,CAAA;IACH,CAAC;IAGD,IAAI,OAAO,CAAC,eAAe,IAAI,OAAO,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAClE,gBAAgB,GAAG,gBAAgB,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CACnD,CAAC,OAAO,CAAC,eAAgB,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CACjD,CAAA;IACH,CAAC;IAED,OAAO,gBAAgB,CAAA;AACzB,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { ColorReference } from '../../../types/color.d';
|
|
2
|
+
import type { VueSection, VueProcessingOptions } from '../../../types/vue.d';
|
|
3
|
+
export declare function extractColorsFromVueSection(section: VueSection, filePath: string, options?: VueProcessingOptions): ColorReference[];
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { extractColors } from '../color/extractColors';
|
|
2
|
+
export function extractColorsFromVueSection(section, filePath, options = {}) {
|
|
3
|
+
const colors = [];
|
|
4
|
+
if (!section || !section.content) {
|
|
5
|
+
return colors;
|
|
6
|
+
}
|
|
7
|
+
switch (section.type) {
|
|
8
|
+
case 'template':
|
|
9
|
+
return extractColorsFromTemplate(section, filePath, options);
|
|
10
|
+
case 'script':
|
|
11
|
+
return extractColorsFromScript(section, filePath, options);
|
|
12
|
+
case 'style':
|
|
13
|
+
return extractColorsFromStyle(section, filePath, options);
|
|
14
|
+
default:
|
|
15
|
+
return extractColors(section.content, filePath, { validOnly: options.validOnly });
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function extractColorsFromTemplate(section, filePath, options) {
|
|
19
|
+
const colors = [];
|
|
20
|
+
const lines = section.content.split('\n');
|
|
21
|
+
lines.forEach((line, index) => {
|
|
22
|
+
const lineNumber = section.startLine + index;
|
|
23
|
+
const styleMatches = line.match(/style\s*=\s*["']([^"']*)["']/gi);
|
|
24
|
+
if (styleMatches) {
|
|
25
|
+
styleMatches.forEach(styleMatch => {
|
|
26
|
+
const styleContent = styleMatch.replace(/style\s*=\s*["']([^"']*)["']/i, '$1');
|
|
27
|
+
const styleColors = extractColors(styleContent, filePath, { validOnly: options.validOnly });
|
|
28
|
+
colors.push(...styleColors);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
const lineColors = extractColors(line, filePath, { validOnly: options.validOnly });
|
|
32
|
+
colors.push(...lineColors);
|
|
33
|
+
});
|
|
34
|
+
return colors;
|
|
35
|
+
}
|
|
36
|
+
function extractColorsFromScript(section, filePath, options) {
|
|
37
|
+
const colors = [];
|
|
38
|
+
const lines = section.content.split('\n');
|
|
39
|
+
lines.forEach((line, index) => {
|
|
40
|
+
const lineNumber = section.startLine + index;
|
|
41
|
+
const trimmedLine = line.trim();
|
|
42
|
+
if (trimmedLine.startsWith('//') || trimmedLine.startsWith('/*') || trimmedLine.startsWith('*')) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
const lineColors = extractColors(line, filePath, { validOnly: options.validOnly });
|
|
46
|
+
colors.push(...lineColors);
|
|
47
|
+
});
|
|
48
|
+
return colors;
|
|
49
|
+
}
|
|
50
|
+
function extractColorsFromStyle(section, filePath, options) {
|
|
51
|
+
return extractColors(section.content, filePath, { validOnly: options.validOnly });
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=extractColorsFromVueSection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extractColorsFromVueSection.js","sourceRoot":"","sources":["../../../src/functions/vue/extractColorsFromVueSection.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export function filterSections(sections, options) {
|
|
2
|
+
let filteredSections = sections;
|
|
3
|
+
if (options.includeSections && options.includeSections.length > 0) {
|
|
4
|
+
filteredSections = filteredSections.filter(section => options.includeSections.includes(section.type));
|
|
5
|
+
}
|
|
6
|
+
if (options.excludeSections && options.excludeSections.length > 0) {
|
|
7
|
+
filteredSections = filteredSections.filter(section => !options.excludeSections.includes(section.type));
|
|
8
|
+
}
|
|
9
|
+
return filteredSections;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=filterSections.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filterSections.js","sourceRoot":"","sources":["../../../src/functions/vue/filterSections.ts"],"names":[],"mappings":"AA6BA,MAAM,UAAU,cAAc,CAC5B,QAAsB,EACtB,OAA6B;IAE7B,IAAI,gBAAgB,GAAG,QAAQ,CAAA;IAG/B,IAAI,OAAO,CAAC,eAAe,IAAI,OAAO,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAClE,gBAAgB,GAAG,gBAAgB,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CACnD,OAAO,CAAC,eAAgB,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAChD,CAAA;IACH,CAAC;IAGD,IAAI,OAAO,CAAC,eAAe,IAAI,OAAO,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAClE,gBAAgB,GAAG,gBAAgB,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CACnD,CAAC,OAAO,CAAC,eAAgB,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CACjD,CAAA;IACH,CAAC;IAED,OAAO,gBAAgB,CAAA;AACzB,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export function parseVueFile(code) {
|
|
2
|
+
const sections = [];
|
|
3
|
+
const lines = code.split('\n');
|
|
4
|
+
let currentSection = null;
|
|
5
|
+
let sectionStartLine = 0;
|
|
6
|
+
let sectionContent = [];
|
|
7
|
+
for (let i = 0; i < lines.length; i++) {
|
|
8
|
+
const line = lines[i];
|
|
9
|
+
const trimmedLine = line.trim();
|
|
10
|
+
if (trimmedLine.startsWith('<template') && !trimmedLine.includes('</template>')) {
|
|
11
|
+
saveSectionIfValid(sections, currentSection, sectionStartLine, sectionContent);
|
|
12
|
+
currentSection = 'template';
|
|
13
|
+
sectionStartLine = i + 1;
|
|
14
|
+
sectionContent = [];
|
|
15
|
+
}
|
|
16
|
+
else if (trimmedLine.startsWith('<script') && !trimmedLine.includes('</script>')) {
|
|
17
|
+
saveSectionIfValid(sections, currentSection, sectionStartLine, sectionContent);
|
|
18
|
+
currentSection = 'script';
|
|
19
|
+
sectionStartLine = i + 1;
|
|
20
|
+
sectionContent = [];
|
|
21
|
+
}
|
|
22
|
+
else if (trimmedLine.startsWith('<style') && !trimmedLine.includes('</style>')) {
|
|
23
|
+
saveSectionIfValid(sections, currentSection, sectionStartLine, sectionContent);
|
|
24
|
+
currentSection = 'style';
|
|
25
|
+
sectionStartLine = i + 1;
|
|
26
|
+
sectionContent = [];
|
|
27
|
+
}
|
|
28
|
+
else if (trimmedLine === '</template>' ||
|
|
29
|
+
trimmedLine === '</script>' ||
|
|
30
|
+
trimmedLine === '</style>') {
|
|
31
|
+
if (currentSection) {
|
|
32
|
+
saveSectionIfValid(sections, currentSection, sectionStartLine, sectionContent);
|
|
33
|
+
currentSection = null;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
else if (currentSection) {
|
|
37
|
+
sectionContent.push(line);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
saveSectionIfValid(sections, currentSection, sectionStartLine, sectionContent);
|
|
41
|
+
return sections;
|
|
42
|
+
}
|
|
43
|
+
function saveSectionIfValid(sections, sectionType, startLine, content) {
|
|
44
|
+
if (sectionType && content.length > 0) {
|
|
45
|
+
sections.push({
|
|
46
|
+
type: sectionType,
|
|
47
|
+
content: content.join('\n'),
|
|
48
|
+
startLine,
|
|
49
|
+
endLine: startLine + content.length - 1
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=parseVueFile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseVueFile.js","sourceRoot":"","sources":["../../../src/functions/vue/parseVueFile.ts"],"names":[],"mappings":"AA8BA,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,MAAM,QAAQ,GAAiB,EAAE,CAAA;IACjC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IAE9B,IAAI,cAAc,GAA0B,IAAI,CAAA;IAChD,IAAI,gBAAgB,GAAG,CAAC,CAAA;IACxB,IAAI,cAAc,GAAa,EAAE,CAAA;IAEjC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACtC,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAA;QACrB,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,EAAE,CAAA;QAG/B,IAAI,WAAW,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC;YAChF,kBAAkB,CAAC,QAAQ,EAAE,cAAc,EAAE,gBAAgB,EAAE,cAAc,CAAC,CAAA;YAC9E,cAAc,GAAG,UAAU,CAAA;YAC3B,gBAAgB,GAAG,CAAC,GAAG,CAAC,CAAA;YACxB,cAAc,GAAG,EAAE,CAAA;QACrB,CAAC;aAAM,IAAI,WAAW,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;YACnF,kBAAkB,CAAC,QAAQ,EAAE,cAAc,EAAE,gBAAgB,EAAE,cAAc,CAAC,CAAA;YAC9E,cAAc,GAAG,QAAQ,CAAA;YACzB,gBAAgB,GAAG,CAAC,GAAG,CAAC,CAAA;YACxB,cAAc,GAAG,EAAE,CAAA;QACrB,CAAC;aAAM,IAAI,WAAW,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;YACjF,kBAAkB,CAAC,QAAQ,EAAE,cAAc,EAAE,gBAAgB,EAAE,cAAc,CAAC,CAAA;YAC9E,cAAc,GAAG,OAAO,CAAA;YACxB,gBAAgB,GAAG,CAAC,GAAG,CAAC,CAAA;YACxB,cAAc,GAAG,EAAE,CAAA;QACrB,CAAC;aAAM,IAAI,WAAW,KAAK,aAAa;YAC7B,WAAW,KAAK,WAAW;YAC3B,WAAW,KAAK,UAAU,EAAE,CAAC;YACtC,IAAI,cAAc,EAAE,CAAC;gBACnB,kBAAkB,CAAC,QAAQ,EAAE,cAAc,EAAE,gBAAgB,EAAE,cAAc,CAAC,CAAA;gBAC9E,cAAc,GAAG,IAAI,CAAA;YACvB,CAAC;QACH,CAAC;aAAM,IAAI,cAAc,EAAE,CAAC;YAC1B,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAC3B,CAAC;IACH,CAAC;IAGD,kBAAkB,CAAC,QAAQ,EAAE,cAAc,EAAE,gBAAgB,EAAE,cAAc,CAAC,CAAA;IAE9E,OAAO,QAAQ,CAAA;AACjB,CAAC;AAMD,SAAS,kBAAkB,CACzB,QAAsB,EACtB,WAAkC,EAClC,SAAiB,EACjB,OAAiB;IAEjB,IAAI,WAAW,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtC,QAAQ,CAAC,IAAI,CAAC;YACZ,IAAI,EAAE,WAAW;YACjB,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;YAC3B,SAAS;YACT,OAAO,EAAE,SAAS,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC;SACxC,CAAC,CAAA;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { ColorReference } from '../../../types/color.d';
|
|
2
|
+
import type { VueProcessorDependencies, VueProcessingOptions } from '../../../types/vue.d';
|
|
3
|
+
export declare function processVueFile(code: string, filePath: string, dependencies: VueProcessorDependencies, options?: VueProcessingOptions): ColorReference[];
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { parseVueFile } from './parseVueFile';
|
|
2
|
+
import { extractColorsFromVueSection } from './extractColorsFromVueSection';
|
|
3
|
+
import { deduplicateColors } from './deduplicateColors';
|
|
4
|
+
export function processVueFile(code, filePath, dependencies, options = {}) {
|
|
5
|
+
const colors = [];
|
|
6
|
+
const globalColors = dependencies.extractColors(code, filePath, dependencies, options);
|
|
7
|
+
const sections = parseVueFile(code);
|
|
8
|
+
const filteredSections = filterVueSections(sections, options);
|
|
9
|
+
for (const section of filteredSections) {
|
|
10
|
+
const sectionColors = extractColorsFromVueSection(section, filePath, dependencies, options);
|
|
11
|
+
colors.push(...sectionColors);
|
|
12
|
+
}
|
|
13
|
+
const allColors = [...globalColors, ...colors];
|
|
14
|
+
return deduplicateColors(allColors);
|
|
15
|
+
}
|
|
16
|
+
function filterVueSections(sections, options) {
|
|
17
|
+
let filteredSections = sections;
|
|
18
|
+
if (options.includeSections && options.includeSections.length > 0) {
|
|
19
|
+
filteredSections = filteredSections.filter(section => options.includeSections.includes(section.type));
|
|
20
|
+
}
|
|
21
|
+
if (options.excludeSections && options.excludeSections.length > 0) {
|
|
22
|
+
filteredSections = filteredSections.filter(section => !options.excludeSections.includes(section.type));
|
|
23
|
+
}
|
|
24
|
+
return filteredSections;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=processVueFile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"processVueFile.js","sourceRoot":"","sources":["../../../src/functions/vue/processVueFile.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAA;AAE3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAkCvD,MAAM,UAAU,cAAc,CAC5B,IAAY,EACZ,QAAgB,EAChB,YAAsC,EACtC,UAAgC,EAAE;IAElC,MAAM,MAAM,GAAqB,EAAE,CAAA;IAGnC,MAAM,YAAY,GAAG,YAAY,CAAC,aAAa,CAAC,IAAI,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,CAAC,CAAA;IAGtF,MAAM,QAAQ,GAAG,YAAY,CAAC,IAAI,CAAC,CAAA;IAGnC,MAAM,gBAAgB,GAAG,iBAAiB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;IAG7D,KAAK,MAAM,OAAO,IAAI,gBAAgB,EAAE,CAAC;QACvC,MAAM,aAAa,GAAG,2BAA2B,CAC/C,OAAO,EACP,QAAQ,EACR,YAAY,EACZ,OAAO,CACR,CAAA;QACD,MAAM,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,CAAA;IAC/B,CAAC;IAGD,MAAM,SAAS,GAAG,CAAC,GAAG,YAAY,EAAE,GAAG,MAAM,CAAC,CAAA;IAC9C,OAAO,iBAAiB,CAAC,SAAS,CAAC,CAAA;AACrC,CAAC;AAMD,SAAS,iBAAiB,CACxB,QAAsB,EACtB,OAA6B;IAE7B,IAAI,gBAAgB,GAAG,QAAQ,CAAA;IAG/B,IAAI,OAAO,CAAC,eAAe,IAAI,OAAO,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAClE,gBAAgB,GAAG,gBAAgB,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CACnD,OAAO,CAAC,eAAgB,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAChD,CAAA;IACH,CAAC;IAGD,IAAI,OAAO,CAAC,eAAe,IAAI,OAAO,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAClE,gBAAgB,GAAG,gBAAgB,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CACnD,CAAC,OAAO,CAAC,eAAgB,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CACjD,CAAA;IACH,CAAC;IAED,OAAO,gBAAgB,CAAA;AACzB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export function saveVueSection(sections, sectionType, startLine, content) {
|
|
2
|
+
if (sectionType && content.length > 0) {
|
|
3
|
+
sections.push({
|
|
4
|
+
type: sectionType,
|
|
5
|
+
content: content.join('\n'),
|
|
6
|
+
startLine,
|
|
7
|
+
endLine: startLine + content.length - 1
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=saveVueSection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"saveVueSection.js","sourceRoot":"","sources":["../../../src/functions/vue/saveVueSection.ts"],"names":[],"mappings":"AA6BA,MAAM,UAAU,cAAc,CAC5B,QAAsB,EACtB,WAAkC,EAClC,SAAiB,EACjB,OAAiB;IAEjB,IAAI,WAAW,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtC,QAAQ,CAAC,IAAI,CAAC;YACZ,IAAI,EAAE,WAAW;YACjB,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;YAC3B,SAAS;YACT,OAAO,EAAE,SAAS,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC;SACxC,CAAC,CAAA;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { NodeChildProcess } from '../../references/node.d';
|
|
2
|
+
import type { AltoolAuth, AltoolAppType, AltoolOutputFormat, AltoolBaseResult } from '../../types/altool.d';
|
|
3
|
+
export interface AltoolUploadOptions {
|
|
4
|
+
file: string;
|
|
5
|
+
type: AltoolAppType;
|
|
6
|
+
auth: AltoolAuth;
|
|
7
|
+
outputFormat?: AltoolOutputFormat;
|
|
8
|
+
}
|
|
9
|
+
export interface AltoolValidateOptions {
|
|
10
|
+
file: string;
|
|
11
|
+
type: AltoolAppType;
|
|
12
|
+
auth: AltoolAuth;
|
|
13
|
+
outputFormat?: AltoolOutputFormat;
|
|
14
|
+
}
|
|
15
|
+
export interface AltoolValidateResult {
|
|
16
|
+
hasWarnings: boolean;
|
|
17
|
+
hasErrors: boolean;
|
|
18
|
+
warnings: string[];
|
|
19
|
+
errors: string[];
|
|
20
|
+
}
|
|
21
|
+
export interface AltoolAppInfoOptions {
|
|
22
|
+
type: AltoolAppType;
|
|
23
|
+
auth: AltoolAuth;
|
|
24
|
+
outputFormat?: AltoolOutputFormat;
|
|
25
|
+
}
|
|
26
|
+
export interface AppInfo {
|
|
27
|
+
bundleId: string;
|
|
28
|
+
name: string;
|
|
29
|
+
version: string;
|
|
30
|
+
build: string;
|
|
31
|
+
}
|
|
32
|
+
export interface AltoolConfig {
|
|
33
|
+
altoolPath: string;
|
|
34
|
+
defaultAuth?: AltoolAuth;
|
|
35
|
+
defaultAppType?: AltoolAppType;
|
|
36
|
+
defaultOutputFormat?: AltoolOutputFormat;
|
|
37
|
+
childProcess: NodeChildProcess;
|
|
38
|
+
}
|
|
39
|
+
export interface AltoolState {
|
|
40
|
+
initialized: boolean;
|
|
41
|
+
available: boolean;
|
|
42
|
+
version: string | null;
|
|
43
|
+
loading: boolean;
|
|
44
|
+
error: string | null;
|
|
45
|
+
lastResult: AltoolBaseResult | null;
|
|
46
|
+
}
|
|
47
|
+
export interface AltoolActions {
|
|
48
|
+
initialize: () => Promise<void>;
|
|
49
|
+
upload: (options: Omit<AltoolUploadOptions, 'auth'> & {
|
|
50
|
+
auth?: AltoolAuth;
|
|
51
|
+
}) => Promise<string>;
|
|
52
|
+
validate: (options: Omit<AltoolValidateOptions, 'auth'> & {
|
|
53
|
+
auth?: AltoolAuth;
|
|
54
|
+
}) => Promise<AltoolValidateResult>;
|
|
55
|
+
getInfo: (options: Omit<AltoolAppInfoOptions, 'auth'> & {
|
|
56
|
+
auth?: AltoolAuth;
|
|
57
|
+
}) => Promise<AppInfo[]>;
|
|
58
|
+
reset: () => void;
|
|
59
|
+
clearError: () => void;
|
|
60
|
+
}
|
|
61
|
+
export declare function useAltool(config: AltoolConfig): {
|
|
62
|
+
state: AltoolState;
|
|
63
|
+
isReady: () => boolean;
|
|
64
|
+
hasError: () => boolean;
|
|
65
|
+
canOperate: () => boolean;
|
|
66
|
+
actions: AltoolActions;
|
|
67
|
+
subscribe: (listener: () => void) => () => void;
|
|
68
|
+
};
|